Skip to content

Instantly share code, notes, and snippets.

@jstolarek
Last active July 30, 2020 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstolarek/9541d35cded45e593b41ed48aaadc521 to your computer and use it in GitHub Desktop.
Save jstolarek/9541d35cded45e593b41ed48aaadc521 to your computer and use it in GitHub Desktop.
Some thoughts on KMix and PulseAudio setup on my machine

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

Software:

  • Debian Buster with backported kernel 5.6.0
  • nvidia drivers 440.64
  • PulseAudio 12.2
  • TDE 14.0.9 PSB

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 works 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.

Some things I thought about:

  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. If bug (2) above is fixed then I could manually mute/unmute HDMi output and control the volume via the master slider, at which point I can remove PulseAudio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment