You are not logged in.
I installed Arch last week and am trying to build myself a workable desktop-ish environment. I have xfce and herbstluftwm both installed which I invoke from the login shell with startxfce or xinit herbstluftwm. I'm trying to get sound to work reliably using a USB DAC/Amp device.
%aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [DELL S2721DGF]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 0: ALCS1200A Analog [ALCS1200A Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 1: ALCS1200A Digital [ALCS1200A Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Hel [Schiit Hel], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0I believe sound initially worked to the USB device everywhere, but I quickly got into a state where herbstluftwm would not play sound either through Firefox or through speaker-test in xterm unless done with sudo. In the login shell speaker-test continued to produce sound as well as both Firefox and speaker-test in xfce as an unprivileged user.
Yesterday, I updated with pacman -Syu and reboot after which sound stopped working with:
%speaker-test -c 2
speaker-test 1.2.8
Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
Playback open error: -2,No such file or directoryFollowing the documentation here, I landed on the following configuration file that fixes speaker-test everywhere but Firefox continues to be silent:
%cat /etc/asound.conf
pcm.!default {
type hw
card Hel
}
ctl.!default {
type hw
card Hel
}Following the troubleshooting page, I do not believe that PulseAudio is the culprit. Also, before figuring out asound.conf, I also tried assigning an index order to snd_usb_audio, but when I did so, the Hel fell off the device list on reboot.
I'd appreciate pointers on where to go next. I'm also very curious for my general understanding why, prior to updating the system, herbstluftwm would break sound but xfce would not.
Offline
The best is to establish the system sounding from ALSA alone before pulseaudio or pipewire.
I would recommend to configure your asouind.conf in $HOME user directory instead of /etc. It makes it easier to make changes and the configuration is not overwritten on system updates.
You are not pointing to the correct card when you ran your speaker test.
Have a good read again of ALSA particularly on the speaker test. And also perhaps undo whatever you've done with asound.conf, run aplay -L | grep :CARD to check the card naming first, then write the configuration in $HOME instead. You can even try without asound.conf first.
Last edited by d_fajardo (2023-05-07 11:18:22)
Offline
Without the configuration file, speaker-test fails as above. speaker-test -D default:Hel does produce sound.
%aplay -L | grep :CARD
hdmi:CARD=NVidia,DEV=0
hdmi:CARD=NVidia,DEV=1
hdmi:CARD=NVidia,DEV=2
hdmi:CARD=NVidia,DEV=3
sysdefault:CARD=Generic
front:CARD=Generic,DEV=0
surround21:CARD=Generic,DEV=0
surround40:CARD=Generic,DEV=0
surround41:CARD=Generic,DEV=0
surround50:CARD=Generic,DEV=0
surround51:CARD=Generic,DEV=0
surround71:CARD=Generic,DEV=0
iec958:CARD=Generic,DEV=0
sysdefault:CARD=Hel
front:CARD=Hel,DEV=0
surround21:CARD=Hel,DEV=0
surround40:CARD=Hel,DEV=0
surround41:CARD=Hel,DEV=0
surround50:CARD=Hel,DEV=0
surround51:CARD=Hel,DEV=0
surround71:CARD=Hel,DEV=0
iec958:CARD=Hel,DEV=0The configuration file in original post, now moved to $HOME/.asoundrc, fixes speaker-test but not Firefox. As far as I know, I am using neither pulseaudio nor pipewire.
Offline
As for why firefox doesn't work, that's due a pecularity/inconsistency with how ALSA device enumeration works and how applications can ask for their default device. Your config completely overrides the default and this removes the default device from the PCM list (aplay -L, which happens to be what firefox uses to determine the default device) and due to that will also disallow simultaneous playback as this override disables dmix.
The easiest way to override just the default card leaving everything else intact is to just override the card definition which is easiest done with the config of
defaults.pcm.!card "'Hel"
defaults.ctl.!card "Hel"as explained in https://wiki.archlinux.org/title/Advanc … aults_node
FWIW Fixing ALSA before moving to pulse/pipewire makes no sense as the configuration access handling differs enough that whatever ALSA config you are doing will most likely be obsoleted. If you decide for moving to one of those remove your ALSA config, setup pipewire/pulse and install the corresponding abstraction pipewire-alsa/pulseaudio-alsa and use pulse clients like pavucontrol/pactl for output/volume control.
Last edited by V1del (2023-05-07 15:54:08)
Offline