You are not logged in.

#1 2019-09-18 13:04:13

krafczyk
Member
Registered: 2015-09-08
Posts: 30

[SOLVED] 'Greedy' HDMI audio sink (pulseaudio/alsa ?)

I recently changed my desktop motherboard as it was failing. I went from MSI X99S SLI PLUS to MSI X99A Godlike gaming.

I also have two Nvidia GTX 1080 8GB graphics cards, one for gaming and the other for extra compute power and for pci passthrough to a windows VM on occasion. I also have two monitors one of which has speakers, the other doesn't, each has both DVI and HDMI input. I've hooked two monitors to each GPU one DVI one HDMI that way when I do GPU passthrough, I have dedicated monitors.

This was always worked fine in the past, but now this HDMI audio sink has gotten 'greedy'. It constantly selects itself as the default audio sink, and I can't change it. I also can't change some audio streams or recording streams which select the HDMI audio sink. I'm looking for any insight on how to either make this audio sink behave normally, or if that fails, how to 'blacklist' that audio sink from being used at all.

Some config info:

nvidia-smi:

Wed Sep 18 07:58:18 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 435.21       Driver Version: 435.21       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1080    Off  | 00000000:02:00.0  On |                  N/A |
|  0%   45C    P8    13W / 200W |    448MiB /  8119MiB |     23%      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 1080    Off  | 00000000:03:00.0  On |                  N/A |
|  0%   48C    P8    11W / 200W |      2MiB /  8111MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0       697      G   /usr/lib/Xorg                                317MiB |
|    0      1086      G   xfwm4                                          3MiB |
|    0      1593      G   ...-token=6D339DCE6542BDF0034EC9C9102A1A27    13MiB |
|    0     10000      G   ...quest-channel-token=9426611388646059051    44MiB |
|    0     19991      G   ...ew/.local/share/Steam/ubuntu12_32/steam    43MiB |
|    0     20016      G   ./steamwebhelper                               2MiB |
+-----------------------------------------------------------------------------+

pacmd list-sinks | grep -e 'index:' -e 'name:'

  * index: 0
	name: <alsa_output.pci-0000_02_00.1.hdmi-stereo-extra1>
    index: 1
	name: <alsa_output.pci-0000_00_1b.0.analog-stereo>

Strangely, the problem is intermittent, usually when nothing is playing I can set the default normally, but when stuff is playing, it magically changes to the hdmi audio sink and then default gets changed to so everything goes to the hdmi audio sink.

Last edited by krafczyk (2019-09-20 01:09:25)

Offline

#2 2019-09-18 13:13:37

d_fajardo
Member
Registered: 2017-07-28
Posts: 494

Re: [SOLVED] 'Greedy' HDMI audio sink (pulseaudio/alsa ?)

You can set your desired device indexing in /etc/modprobe.d/alsa-base.conf.

cat /proc/asound/modules

to list the indexing. Then you can edit alsa-base.conf with options i.e.

options snd_hda_intel index=0
options snd_usb_intel index=1

or whatever your card listing is.

Online

#3 2019-09-18 14:32:00

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 7,773

Re: [SOLVED] 'Greedy' HDMI audio sink (pulseaudio/alsa ?)

Do you have module-switch-on-connect loaded? That will switch everything to newly available sinks, you will want to not load it for your usecase.

Offline

#4 2019-09-18 17:50:17

krafczyk
Member
Registered: 2015-09-08
Posts: 30

Re: [SOLVED] 'Greedy' HDMI audio sink (pulseaudio/alsa ?)

V1del: I have "load-module module-switch-on-port-available" in /etc/pulse/default.pa but not "module-switch-on-connect" as you suggested. Will this cause the same effect?

d_fajardo:

cat /proc/asound/modules         
 0 snd_hda_intel
 1 snd_hda_intel
 2 snd_hda_intel
 3 snd_usb_audio

I don't see any nvidia sound modules listed, How does this help me?

Offline

#5 2019-09-18 19:09:37

d_fajardo
Member
Registered: 2017-07-28
Posts: 494

Re: [SOLVED] 'Greedy' HDMI audio sink (pulseaudio/alsa ?)

krafczyk wrote:

I don't see any nvidia sound modules listed,

I am not sure why this is. This is probably why it keeps defaulting to the said HDMI device since the nvidia modules are not seen.
Out of curiosity, did you change the motherboard before or after installing nvidia?

Online

#6 2019-09-19 01:53:05

krafczyk
Member
Registered: 2015-09-08
Posts: 30

Re: [SOLVED] 'Greedy' HDMI audio sink (pulseaudio/alsa ?)

d_fajardo wrote:

did you change the motherboard before or after installing nvidia?

The only thing I changed was the motherboard. I had two Nvidia GPUs before, and two nvidia GPUs after. I've always used the nvidia binary blob drivers.

Offline

#7 2019-09-19 04:25:57

krafczyk
Member
Registered: 2015-09-08
Posts: 30

Re: [SOLVED] 'Greedy' HDMI audio sink (pulseaudio/alsa ?)

Tonight, I updated my motherboard to the latest bios which fixed some ACPI errors in dmesg. I also thought it fixed my sound issue because it seemed I could change the default sink at will when playing a youtube video.

However, when I tried to plug in my headphones, and select the 'Headphones (unplugged)' Port in the pulse mixer, the HDMI sink pinning started happening. When I pick 'Line Out (plugged in)' it stops! The jack I plugged my headphones in is in the front of the case, and I remember I had to plug a connector into the motherboard for it. I wonder if alsa/pulse isn't correctly detecting that the headphones are plugged in, and so it tries to switch to a sink which it thinks can output sound (the HDMI).

Does anybody know how I can investigate how a headphone jack being used gets detected? Maybe it has something to do with there being two separate jacks one for mic and one for headphones, while my headphones have the typical 4 ring setup.

Offline

#8 2019-09-19 07:46:07

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 7,773

Re: [SOLVED] 'Greedy' HDMI audio sink (pulseaudio/alsa ?)

Yes it will likely try to rescue streams to a working output. Such "seperate" jacks usually don't get properly delegated to the sound card. FWIW what's your output for

amxier -c0

? What you can do in general is check whether you receive a acpi event for the jack plug and then write a script to do the correct thing, see this thread for an example (FWIW we might also be able to define a proper pulse path file so that pulse handles this itself)

Offline

#9 2019-09-19 14:23:26

krafczyk
Member
Registered: 2015-09-08
Posts: 30

Re: [SOLVED] 'Greedy' HDMI audio sink (pulseaudio/alsa ?)

amixer -c0
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 81 [93%] [-4.50dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 0 [0%] [-65.25dB] [off]
  Front Right: Playback 0 [0%] [-65.25dB] [off]
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Front',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 87 [100%] [0.00dB] [on]
  Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Front Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Front Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Surround',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 87 [100%] [0.00dB] [on]
  Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Center',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'LFE',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Line',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Line Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958 Default PCM',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Beep',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 50 [79%] [20.25dB] [on]
  Front Right: Capture 50 [79%] [20.25dB] [on]
Simple mixer control 'Capture',1
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 1 [2%] [-16.50dB] [off]
  Front Right: Capture 1 [2%] [-16.50dB] [off]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Front Mic' 'Rear Mic' 'Line'
  Item0: 'Rear Mic'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Front Mic' 'Rear Mic' 'Line'
  Item0: 'Front Mic'
Simple mixer control 'Loopback Mixing',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Rear Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Rear Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]

The headphones aren't plugged in right now. Should anything change about this output when I plug them in? I'll be able to test after work tonight.

Offline

#10 2019-09-20 00:47:25

krafczyk
Member
Registered: 2015-09-08
Posts: 30

Re: [SOLVED] 'Greedy' HDMI audio sink (pulseaudio/alsa ?)

So, when I look at acpi_listen, I get events when I plug my headphones into the mic jack:

acpi_listen
jack/microphone MICROPHONE plug
jack/microphone MICROPHONE unplug
jack/microphone MICROPHONE plug
jack/microphone MICROPHONE unplug

But not when I plug it into the headphone jack. This even when I used an aux cable extension which has a 3 ring format.

Offline

#11 2019-09-20 01:07:59

krafczyk
Member
Registered: 2015-09-08
Posts: 30

Re: [SOLVED] 'Greedy' HDMI audio sink (pulseaudio/alsa ?)

I've discovered a kludge solution which is good enough for me for now.

I used hdajackretask to override the front mic jack as a headphone jack. after installing the boot override and restarting, the mic jack works as expected. when plugged into the mic jack, pulse detects this, and now I don't have to fight pulse trying to reassign audio streams to the HDMI output!

I suppose I can mark this as solved.

Offline

Board footer

Powered by FluxBB