KMix: poor cooperation with PulseAudio #23

Open
opened 4 years ago by jstolarek · 5 comments
Collaborator

Basic information

  • TDE version: R14.0.9
  • Distribution: Debian Buster with backported kernel 5.6.0
  • Hardware: amd64
  • nvidia drivers: 440.64
  • PulseAudio: 12.2

Hardware

  • GeForce RTX 2070 Super (3 Display ports, 1 HDMI port, and 1 USB-C port))
  • ROG Crosshair VIII Impact with SupremeFX S1220 audio codec - PulseAudio identifies this as Starship/Matisse HD Audio Controller. This is an on-board card with back and front panels, which I use, and an S/PDIF port, which I don't use

Description

My system recognizes two audio cards:

$ cat /proc/asound/cards
 0 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xfc080000 irq 79
 1 [Generic        ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xfcb00000 irq 98

Card 0 is the HDMI output on the GeForce, card 1 is the on-board sound card. Both cards are handled by snd_hda_intel kernel module. Pulseaudio recognizes the same two cards, with one active sink for each card:

$ pactl list sinks short
0       alsa_output.pci-0000_09_00.1.hdmi-stereo-extra1 module-alsa-card.c      s16le 2ch 44100Hz       IDLE
1       alsa_output.pci-0000_0b_00.4.analog-stereo      module-alsa-card.c      s16le 2ch 44100Hz       IDLE

Here's a list of KMix problems that I noticed:

  1. KMix creates three mixers: one for each card, and the third one for PulseAudio. PulseAudio mixer is enumerated at index -1, which seems fishy.

    $ dcop kmix Mixer-1 mixerName
    PulseAudio
    $ dcop kmix Mixer0 mixerName
    HDA NVidia
    $ dcop kmix Mixer1 mixerName
    HD-Audio Generic
    
  2. KMix master slider (one that shows after clicking on the tray icon) does nothing, regardless of which card is used. Also, clicking on the tray icon to mute sound does nothing.

  3. KMix povides no way of switching the active card. This can only be done with pavucontrol or via PulseAudio command line tools. Note: fixing this is conceptually non-trivial in a sense that PulseAudio assigns active sink on a per-stream basis. Therefore there is no real concept of a single active output card in PulseAudio, since all the cards can be active. (For me, personally, this is a horrible misfeature though I see its usefullness in some setups.)

  4. Upon opening KMix window, the PulseAudio mixer slider works only for streams assigned to HD-Audio Generic, but not to ones assigned to HDA NVidia.

  5. Continuing with KMix, the HDA NVidia mixer only shows seven toggles labelled as IEC958. These correspond to seven output ports for HDA NVidia seen by PulseAudio, e.g.:

    hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, available)
            Properties:
                    device.icon_name = "video-display"
                    device.product.name = "HP VH240a"
            Part of profile(s): output:hdmi-stereo-extra1
    

    The above corresponds the active HDMI output. Flipping the corresponding toggle in KMix (un)mutes the HDMI output. There are no volume sliders available for HDMI outputs.

  6. For the record, sliders for the HD-Audio Generic mixer all work as expected.

Out of the above I would pick (2) as the single most annoying problem. A lot of PulseAudio behaviour can be scripted, but the main mixer not working leaves me without a quick way of adjusting and muting the volume. I either have to open one of the mixers (KMix, pavucontrol) or create my own scripts and assign them to keyboard shortcuts. Moreover, if the main volume slider worked correctly I could give up on PulseAudio altogether and just rely on KMix.

It is worth noting that behaviour of KMix is consistent with command line alsamixer:

  1. alsamixer lists three audio cards labeled as -, 0 and 1, with respective labels PulseAudio, HDA NVidia, and HD-Audio Generic.

  2. Slider for PulseAudio card only affects streams playing on HD-Audio Generic but not the ones playing on the HDMI output.

  3. Mixer for HDA NVidia lists only seven toggles and (incorrectly) labels them as S/PDIF outputs. Again, it is possible to (un)mute the HDMI output via one of the toggles.

Additional observations

  1. It is possible to switch the order in which HDA NVidia and HD-Audio Generic cards are enumerated by the kernel (idea taken from here) but this doesn't change anything.

  2. Apparently there should be a way of making PulseAudio visible as an ALSA device (see here) but I couldn't find the required packages in Debian repositories. This is weird - has this feature been removed? I definitely remember playing with ~/.asoundrc (which is needed to expose PA sinks to ALSA) in the past. I experimented with creating the ~/.asoundrc file and populating it with settings but nothing seemed to happen.

  3. If I uninstall PulseAudio I get no sound at all. I didn't attempt to debug this since I don't see an option of giving up on PulseAudio, given that KMix currently can't control volume of HDMI card.

## Basic information - TDE version: R14.0.9 - Distribution: Debian Buster with backported kernel 5.6.0 - Hardware: amd64 - nvidia drivers: 440.64 - PulseAudio: 12.2 ## Hardware - GeForce RTX 2070 Super (3 Display ports, 1 HDMI port, and 1 USB-C port)) - [ROG Crosshair VIII Impact](https://www.asus.com/Motherboards/ROG-Crosshair-VIII-Impact/) with SupremeFX S1220 audio codec - PulseAudio identifies this as Starship/Matisse HD Audio Controller. This is an on-board card with back and front panels, which I use, and an S/PDIF port, which I don't use ## Description My system recognizes two audio cards: ``` $ cat /proc/asound/cards 0 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xfc080000 irq 79 1 [Generic ]: HDA-Intel - HD-Audio Generic HD-Audio Generic at 0xfcb00000 irq 98 ``` Card 0 is the HDMI output on the GeForce, card 1 is the on-board sound card. Both cards are handled by `snd_hda_intel` kernel module. Pulseaudio recognizes the same two cards, with one active sink for each card: ``` $ pactl list sinks short 0 alsa_output.pci-0000_09_00.1.hdmi-stereo-extra1 module-alsa-card.c s16le 2ch 44100Hz IDLE 1 alsa_output.pci-0000_0b_00.4.analog-stereo module-alsa-card.c s16le 2ch 44100Hz IDLE ``` Here's a list of KMix problems that I noticed: 1. KMix creates three mixers: one for each card, and the third one for PulseAudio. PulseAudio mixer is enumerated at index -1, which seems fishy. ``` $ dcop kmix Mixer-1 mixerName PulseAudio $ dcop kmix Mixer0 mixerName HDA NVidia $ dcop kmix Mixer1 mixerName HD-Audio Generic ``` 2. KMix master slider (one that shows after clicking on the tray icon) does nothing, regardless of which card is used. Also, clicking on the tray icon to mute sound does nothing. 3. KMix povides no way of switching the active card. This can only be done with pavucontrol or via PulseAudio command line tools. Note: fixing this is conceptually non-trivial in a sense that PulseAudio assigns active sink on a per-stream basis. Therefore there is no real concept of a single active output card in PulseAudio, since all the cards can be active. (For me, personally, this is a horrible misfeature though I see its usefullness in some setups.) 4. Upon opening KMix window, the PulseAudio mixer slider works only for streams assigned to HD-Audio Generic, but not to ones assigned to HDA NVidia. 5. Continuing with KMix, the HDA NVidia mixer only shows seven toggles labelled as IEC958. These correspond to seven output ports for HDA NVidia seen by PulseAudio, e.g.: ``` hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, available) Properties: device.icon_name = "video-display" device.product.name = "HP VH240a" Part of profile(s): output:hdmi-stereo-extra1 ``` The above corresponds the active HDMI output. Flipping the corresponding toggle in KMix (un)mutes the HDMI output. There are no volume sliders available for HDMI outputs. 6. For the record, sliders for the HD-Audio Generic mixer all work as expected. Out of the above I would pick (2) as the single most annoying problem. A lot of PulseAudio behaviour can be scripted, but the main mixer not working leaves me without a quick way of adjusting and muting the volume. I either have to open one of the mixers (KMix, pavucontrol) or create my own scripts and assign them to keyboard shortcuts. Moreover, if the main volume slider worked correctly I could give up on PulseAudio altogether and just rely on KMix. It is worth noting that behaviour of KMix is consistent with command line `alsamixer`: 1. `alsamixer` lists three audio cards labeled as `-`, `0` and `1`, with respective labels PulseAudio, HDA NVidia, and HD-Audio Generic. 2. Slider for PulseAudio card only affects streams playing on HD-Audio Generic but not the ones playing on the HDMI output. 3. Mixer for HDA NVidia lists only seven toggles and (incorrectly) labels them as S/PDIF outputs. Again, it is possible to (un)mute the HDMI output via one of the toggles. ## Additional observations 1. It is possible to switch the order in which HDA NVidia and HD-Audio Generic cards are enumerated by the kernel (idea taken from [here](https://bbs.archlinux.org/viewtopic.php?id=186597)) but this doesn't change anything. 2. Apparently there should be a way of making PulseAudio visible as an ALSA device (see [here](https://wiki.archlinux.org/index.php/PulseAudio#Expose_PulseAudio_sources,_sinks_and_mixers_to_ALSA)) but I couldn't find the required packages in Debian repositories. This is weird - has this feature been removed? I definitely remember playing with `~/.asoundrc` (which is needed to expose PA sinks to ALSA) in the past. I experimented with creating the `~/.asoundrc` file and populating it with settings but nothing seemed to happen. 3. If I uninstall PulseAudio I get no sound at all. I didn't attempt to debug this since I don't see an option of giving up on PulseAudio, given that KMix currently can't control volume of HDMI card.
jstolarek added the SL/major label 4 years ago
Collaborator

Are you using the preliminary builds?

There should be a fix or an option that you can try.

You can choose custom master channel.

Are you using the preliminary builds? There should be a fix or an option that you can try. You can choose custom master channel.
Poster
Collaborator

I am using PSB and don't see such an option in KMix.

I am using PSB and don't see such an option in KMix.
Owner

Are you using the preliminary builds?

There should be a fix or an option that you can try.

You can choose custom master channel.

This is only on PTB, not on PSB due to changes in API.

> Are you using the preliminary builds? > > There should be a fix or an option that you can try. > > You can choose custom master channel. This is only on PTB, not on PSB due to changes in API.
Owner
  1. KMix creates three mixers: one for each card, and the third one for PulseAudio. PulseAudio mixer is enumerated at index -1, which seems fishy.
    $ dcop kmix Mixer-1 mixerName
    PulseAudio
    $ dcop kmix Mixer0 mixerName
    HDA NVidia
    $ dcop kmix Mixer1 mixerName
    HD-Audio Generic
    

It is actually something done by PulseAudio, I believe to make sure it shows up as the first master. You can try:

alsamixer        --> will open PulseAudio master
alsamixer -c 0   --> will open the mixer for the first card
  1. KMix master slider (one that shows after clicking on the tray icon) does nothing, regardless of which card is used. Also, clicking on the tray icon to mute sound does nothing.

Uhm... this is weird, it should be fixed by now. I wonder if this a PulseAudio problem. Just for test have you tried killing pulseaudio and relaunch it as

pulseaudio --check
pulseaudio -D

?
Also when the problem happens, can you try using alsamixer to change the pulseaudio slider volume, to understand whether it is a kmix issue or pulseaudio issue.

  1. KMix povides no way of switching the active card. This can only be done with pavucontrol or via PulseAudio command line tools. Note: fixing this is conceptually non-trivial in a sense that PulseAudio assigns active sink on a per-stream basis. Therefore there is no real concept of a single active output card in PulseAudio, since all the cards can be active. (For me, personally, this is a horrible misfeature though I see its usefullness in some setups.)

Yeah, definitely not implemented at the moment. We want to do more work on Pulseaudio after we release R14.1.0

  1. Upon opening KMix window, the PulseAudio mixer slider works only for streams assigned to HD-Audio Generic, but not to ones assigned to HDA NVidia.

Can't say for sure, but I suggest to do the same test using alsamixer to at least understand if this is a kmix problem or pulseaudio problem. I suspect the second to be honest, because kmix simple changes the volume of the pulseaudio master.

  1. Continuing with KMix, the HDA NVidia mixer only shows seven toggles labelled as IEC958. These correspond to seven output ports for HDA NVidia seen by PulseAudio, e.g.:
    hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, available)
            Properties:
                    device.icon_name = "video-display"
                    device.product.name = "HP VH240a"
            Part of profile(s): output:hdmi-stereo-extra1
    
    The above corresponds the active HDMI output. Flipping the corresponding toggle in KMix (un)mutes the HDMI output. There are no volume sliders available for HDMI outputs.

For this can you capture screenshots of kmix window and alsamixer to show the available channels and upload them as reference?

create my own scripts and assign them to keyboard shortcuts

Have you installed kmilo package? it provides shortcut for volume adjustment too.

  1. alsamixer lists three audio cards labeled as -, 0 and 1, with respective labels PulseAudio, HDA NVidia, and HD-Audio Generic.

I assume the '-' is the -1 of pulseaudio 😄

  1. Mixer for HDA NVidia lists only seven toggles and (incorrectly) labels them as S/PDIF outputs. Again, it is possible to (un)mute the HDMI output via one of the toggles.

In KMix or also in alsamixer? As said above, screenshots would help

> 1. KMix creates three mixers: one for each card, and the third one for PulseAudio. PulseAudio mixer is enumerated at index -1, which seems fishy. > ``` > $ dcop kmix Mixer-1 mixerName > PulseAudio > $ dcop kmix Mixer0 mixerName > HDA NVidia > $ dcop kmix Mixer1 mixerName > HD-Audio Generic > ``` It is actually something done by PulseAudio, I believe to make sure it shows up as the first master. You can try: ``` alsamixer --> will open PulseAudio master alsamixer -c 0 --> will open the mixer for the first card ``` > 2. KMix master slider (one that shows after clicking on the tray icon) does nothing, regardless of which card is used. Also, clicking on the tray icon to mute sound does nothing. Uhm... this is weird, it should be fixed by now. I wonder if this a PulseAudio problem. Just for test have you tried killing pulseaudio and relaunch it as ``` pulseaudio --check pulseaudio -D ``` ? Also when the problem happens, can you try using alsamixer to change the pulseaudio slider volume, to understand whether it is a kmix issue or pulseaudio issue. > 3. KMix povides no way of switching the active card. This can only be done with pavucontrol or via PulseAudio command line tools. Note: fixing this is conceptually non-trivial in a sense that PulseAudio assigns active sink on a per-stream basis. Therefore there is no real concept of a single active output card in PulseAudio, since all the cards can be active. (For me, personally, this is a horrible misfeature though I see its usefullness in some setups.) Yeah, definitely not implemented at the moment. We want to do more work on Pulseaudio after we release R14.1.0 > 4. Upon opening KMix window, the PulseAudio mixer slider works only for streams assigned to HD-Audio Generic, but not to ones assigned to HDA NVidia. Can't say for sure, but I suggest to do the same test using alsamixer to at least understand if this is a kmix problem or pulseaudio problem. I suspect the second to be honest, because kmix simple changes the volume of the pulseaudio master. > 5. Continuing with KMix, the HDA NVidia mixer only shows seven toggles labelled as IEC958. These correspond to seven output ports for HDA NVidia seen by PulseAudio, e.g.: > ``` > hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, available) > Properties: > device.icon_name = "video-display" > device.product.name = "HP VH240a" > Part of profile(s): output:hdmi-stereo-extra1 > ``` > The above corresponds the active HDMI output. Flipping the corresponding toggle in KMix (un)mutes the HDMI output. There are no volume sliders available for HDMI outputs. For this can you capture screenshots of kmix window and alsamixer to show the available channels and upload them as reference? > create my own scripts and assign them to keyboard shortcuts Have you installed kmilo package? it provides shortcut for volume adjustment too. > 1. `alsamixer` lists three audio cards labeled as `-`, `0` and `1`, with respective labels PulseAudio, HDA NVidia, and HD-Audio Generic. I assume the '-' is the -1 of pulseaudio :smile: > 3. Mixer for HDA NVidia lists only seven toggles and (incorrectly) labels them as S/PDIF outputs. Again, it is possible to (un)mute the HDMI output via one of the toggles. In KMix or also in alsamixer? As said above, screenshots would help
Poster
Collaborator

You can try alsamixer -c 0

Yes, but that only changes the card shown initially at startup and not how cards are enumerated.

have you tried killing pulseaudio and relaunch it as

pulseaudio --check
pulseaudio -D

?

I don't get any sound this way: neither KMix nor Amarok can see pulseaudio running. I need to start with pulseaudio --daemonize=no for sound to work.

Can’t say for sure, but I suggest to do the same test using alsamixer to at least understand if this is a kmix problem or pulseaudio problem. I suspect the second to be honest, because kmix simple changes the volume of the pulseaudio master.

Indeed, the same happens with alsamixer. Also, if I load module-combine-sink in PulseAudio then moving the slider changes the volume of sound played via HDMI.

Have you installed kmilo package? it provides shortcut for volume adjustment too.

No - I'm on a desktop and don't even have a keyboard with multimedia buttons.

I assume the ‘-’ is the -1 of pulseaudio

Yes, that's my assumption as well.

> You can try `alsamixer -c 0` Yes, but that only changes the card shown initially at startup and not how cards are enumerated. > have you tried killing pulseaudio and relaunch it as > ``` > pulseaudio --check > pulseaudio -D > ``` > ? I don't get any sound this way: neither KMix nor Amarok can see pulseaudio running. I need to start with `pulseaudio --daemonize=no` for sound to work. > Can’t say for sure, but I suggest to do the same test using alsamixer to at least understand if this is a kmix problem or pulseaudio problem. I suspect the second to be honest, because kmix simple changes the volume of the pulseaudio master. Indeed, the same happens with `alsamixer`. Also, if I load `module-combine-sink` in PulseAudio then moving the slider changes the volume of sound played via HDMI. > Have you installed kmilo package? it provides shortcut for volume adjustment too. No - I'm on a desktop and don't even have a keyboard with multimedia buttons. > I assume the ‘-’ is the -1 of pulseaudio Yes, that's my assumption as well.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: TDE/tdemultimedia#23
Loading…
There is no content yet.