Ceci est une ancienne révision du document !
Years ago, I bought an “Asus Xonar Essence STX sound card. The sound is great and support under Linux is OK. The Xonar card is connected via fiber cable to a “Canton DM55” sound bar below my screen. My PC also has a GeForce GTX 560 Ti Nvidia graphic card installed. Therefore there are two potential sources for the sound: Nvidia via HDMI and the Xonar sound card.
For my music-collection, I use QuodLibet, Mpv to watch videos, and Audacious for listening to radio stations.
Every time I boot Linux, Nvidia and Xonar are discovered in a different order, as seen in Alsamixer:
- default
0 Nvidia
1 Xonar STX 2 HD Pro Webcam C920
or:
- default
0 Xonar STX
1 Nvidia 2 HD Pro Webcam C920
QuodLibet and/or Mpv started sometimes without sound. But Audacious never had a problem finding the right Xonar S/PDF port.
After several attempts, and some extensive searching on the Internet, I found a hint: It says in an aside that some programs accept symbolic names. I queried the symbolic names with:
aplay -L
iec958:CARD=STX,DEV=0 Xonar STX, Multichannel IEC958 (S/PDIF) Digital Audio Output <=== for Canton-DM55 <===
and defined the symbolic name to use alsa in:
QuodLibet>File>Preferences>Playback>Output Pipeline: alsasink device=iec958
and in Mpv:
~/.conf/mpv/mpv.conf: audio-device=alsa/iec958
QuodLibet and Mpv seem to belong to these “some” programs, the sound is working fine, Audacious has still no problems, but Firefox remained silent.
I tried to fix that with:
cat ~/.asoundrc
defaults.pcm.!card STX default.pcm.!device 1 defaults.ctl.!card STX
Finally there is sound in Firefox, but not for long … after some restarts it didn’t work any longer. I tried other browsers (Vivaldi, Chromium) – all remained silent.
I disabled in BIOS the sound-chip on the mainboard a long time ago. Now I looked for a way to disable the Nvidia audio. However, I didn’t find any button or option in the “Nvidia X server settings” in the newest linux-driver (390.87).
Searching the internet again, I found another hint: the kernel module snd_hda_intel is causing trouble!
sudo lspci -vv
… 01:00.1 Audio device: NVIDIA Corporation GF114 HDMI Audio Controller (rev a1) Subsystem: CardExpert Technology GF114 HDMI Audio Controller … Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel … 03:04.0 Multimedia audio controller: C-Media Electronics Inc CMI8788 [Oxygen HD Audio] Subsystem: ASUSTeK Computer Inc. Virtuoso 100 (Xonar Essence STX) … Kernel driver in use: snd_virtuoso Kernel modules: snd_virtuoso
To prevent Linux from loading snd_hda_intel during startup I defined a blacklist:
/etc/modeprobe.d/blacklist.conf:
blacklist snd_hda_intel
After a restart Alsamixer shows
- default
0 Xonar STX
1 HD Pro Webcam C920
the Nvidia is no longer in the list! After enabling card and port with Alsamixer I did an
alsactl store
After another restart Firefox remained silent; Audacious and QuodLibet with sound, as before.
At least the Xonar remained always in position 0.
Somebody had written the sound MUST be configured in pavucontrol for Firefox:
pavucontrol
>Configuration>Profile>Digital Stereo Duplex(IEC958)
Configuration>Output Device>Port>Digital Output (S/PDIF)
Configuration>Input Device>Port>Digital Input (S/PDIF)
After another restart, the sound worked fine in Audacious, Mpv, QuodLibet AND Firefox (finally!).
P.S. I’ve used Linux since 1996, first S.U.S.E, then, around 2004 I switched to Ubuntu, and 2013 to Mint. At the moment, I play around with MX-Linux with XFCE. And yes, sound was always kind of a problem.
References: https://superuser.com/questions/53957/what-do-alsa-devices-like-hw0-0-mean-how-do-i-figure-out-which-to-use
https://wiki.gentoo.org/wiki/ALSA#Hardware_detection
https://techgage.com/news/disabling_nvidias_hdmi_audio_under_linux/