Linux: ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave

By | 02/28/2019

Have a fresh Arch Linux system setup.

After some Viber’s fixes (see the Viber: no connection – Incompatible version of OpenSSL post) – sound system sometimes stops working.

It looks like next: run qmmp, press Play and:

DecoderMAD: Fixed rate detected
DecoderMAD: Total time: 297900
ReplayGain: disabled
Dithering: disabled
ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave
OutputALSA: Error opening PCM device default
OutputWriter: unable to initialize output
StateHandler: Current state: FatalError; previous state: Stopped
DecoderMAD: deleting input_buf
OutputALSA: setupMixer()
OutputALSA: setupMixer() success
StateHandler: Current state: Stopped; previous state: FatalError

The solution

Check audio-devices and drivers:

lspci -knn|grep -iA2 audio
00:1b.0 Audio device [0403]: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 05)
Subsystem: ASUSTeK Computer Inc. 8 Series/C220 Series Chipset High Definition Audio Controller [1043:8576]
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel
01:00.1 Audio device [0403]: NVIDIA Corporation GP107GL High Definition Audio Controller [10de:0fb9] (rev a1)
Subsystem: ASUSTeK Computer Inc. GP107GL High Definition Audio Controller [1043:8613]
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel

Create the /etc/modprobe.d/default.conf file:

options snd_hda_intel index=1

And reboot system.

Then check audio with for example speaker-test:

speaker-test -c2
speaker-test 1.1.8
Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 1048576
Period size range from 32 to 349526
Using max buffer size 1048576
Periods = 4
was set period_size = 262144
was set buffer_size = 1048576
0 - Front Left
1 - Front Right
^CTime per period = 10.940188