No audio in most apps: ALSA error: snd_pcm_open failed: No such file or directory

Maybe related to recent upgrade to new kernel & reboot: 5.10.2-2-MANJARO

Audio was allright after reboot, but suddenly stopped: system sounds plays OK, but media players not playing any audio or video sound (can not hear anything), except Clementine which plays audio. Audacious shows error “ALSA error: snd_pcm_open failed: No such file or directory.”

In VLC player / Tools / messages i see:

alsa error: cannot open ALSA device “default”: No such file or directory
main error: module not functional
main debug: keeping audio output
main error: failed to create audio output
main debug: reusing audio output
alsa error: cannot open ALSA device “default”: No such file or directory
main error: module not functional
main debug: keeping audio output
main error: failed to create audio output
main debug: reusing audio output
alsa error: cannot open ALSA device “default”: No such file or directory
main error: module not functional
main debug: keeping audio output
main error: failed to create audio output
main debug: reusing audio output
alsa error: cannot open ALSA device “default”: No such file or directory

when i go to Audio / Audio device / and switch Default ALSA output (currently pulseaudio sound server) to —> HDA Intel PCH, ALC233 Analog default audio device
then audio start playing. But on VLC reopen it is back to non playing default.

Pulseaudio is running and here are audio devices: PrivateBin

when i tried to switch device in “pulseaudio” interface, it not helped. Please kindly what to try, which commands to run?

Update: This issue may be caused by hanged VLC process, it may help to kill it:
kill -9 $(pidof vlc)

3 days later, no reply. I have found this in journalctl output. Sound works in Clementine.
videos like this:
mp4 no sound (no matter which video device is selected in VLC player)
avi sound plays
mkv only some files sound plays

Mentioned output:

jan 07 00:06:33 username CROND[1682966]: (username) CMDOUT ([00007f88a6358840] main decoder error: failed to create audio output)
jan 07 00:06:33 username CROND[1682966]: (username) CMDOUT ([000055a80423de90] main audio output error: module not functional)
jan 07 00:06:33 username CROND[1682966]: (username) CMDOUT ([000055a80423de90] alsa audio output error: cannot open ALSA device “default”: No such file or directory)
jan 07 00:06:33 username CROND[1682966]: (username) CMDOUT (ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave)
jan 07 00:06:33 username CROND[1682966]: (username) CMDOUT ([00007f88a6358840] main decoder error: failed to create audio output)
jan 07 00:06:33 username CROND[1682966]: (username) CMDOUT ([000055a80423de90] main audio output error: module not functional)
jan 07 00:06:33 username CROND[1682966]: (username) CMDOUT ([000055a80423de90] alsa audio output error: cannot open ALSA device “default”: No such file or directory)
jan 07 00:06:33 username CROND[1682966]: (username) CMDOUT (ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave)
jan 07 00:06:33 username CROND[1682966]: (username) CMDOUT ([00007f88a6358840] main decoder error: failed to create audio output)
jan 07 00:06:33 username CROND[1682966]: (username) CMDOUT ([000055a80423de90] main audio output error: module not functional)
jan 07 00:06:33 username CROND[1682966]: (username) CMDOUT ([000055a80423de90] alsa audio output error: cannot open ALSA device “default”: No such file or directory)
jan 07 00:06:33 username CROND[1682966]: (username) CMDOUT (ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave)

anyone can help please?

$ alsactl restore

alsactl: state_lock:125: file /var/lib/alsa/asound.state lock error: File exists
alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: File exists
alsa-lib parser.c:260:(error_node) UCM is not supported for this HDA model (HDA Intel HDMI at 0xf3610000 irq 52)
alsa-lib main.c:1014:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -6
Found hardware: "HDA-Intel" "Intel Haswell HDMI" "HDA:number1,number2,number3" "0x17aa" "0x3978"
Hardware is initialized using a generic method
alsa-lib parser.c:260:(error_node) UCM is not supported for this HDA model (HDA Intel PCH at 0xf3614000 irq 51)
alsa-lib main.c:1014:(snd_use_case_mgr_open) error: failed to import hw:1 use case configuration -6
Found hardware: "HDA-Intel" "Realtek ALC233" "HDA:string1,string2,string3" "0x17aa" "0x3978"
Hardware is initialized using a generic method
alsa-lib main.c:1014:(snd_use_case_mgr_open) error: failed to import hw:2 use case configuration -2
Found hardware: "USB-Audio" "USB Mixer" "USBstringhere:numberhere" "" ""
Hardware is initialized using a generic method

$ cat /proc/asound/cards

0 [HDMI ]: HDA-Intel - HDA Intel HDMI
HDA Intel HDMI at 0xf3610000 irq 52
1 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0xf3614000 irq 51
2 [Device ]: USB-Audio - USB Audio Device
C-Media Electronics Inc. USB Audio Device at usb-0000:00:14.0-5.4, full speed

so it is weird that HDMI has top priority right? i think device 1 should be top priority (0 or engative number?)

at ALSA - Manjaro i read i need to set device in file /etc/asound.conf but it was empty so i set it like this:

$ cd;echo -e "defaults.pcm.card 1\ndefaults.ctl.card 1" > asound.conf;sudo mv asound.conf /etc/;cd -
(1 is the number under which is shown my primary internal soundcard in above command $ cat /proc/asound/cards )

then i tried to reload:
pulseaudio -k; pulseaudio --start

then i see that the audio started working :white_check_mark: and VLC player offers selecting from only 2 devices instead of showing bunch of non working pseudo/virual devices) which is correct, maybe developers failed to make it properly detect and set the device before. But it worked before the Christmas kernel upgrade.
Anyone can help debug this so this issue can be fixed?

Manjaro is usually configured to use PulseAudio by default to allow multiple audio streams
to use the same audio device

If you set a package to play direct to an ALSA device it is likely to take exclusive control of the audio device
From your description I suspect you have Clementine using an ALSA device exclusively
so Audacious is not able to use the same device
and VLC cannot access the device via ALSA ‘default’ (PulseAudio) for the same reason

Data shows the systemd service for PulseAudio is running OK, but that may no longer be the case.
pulseaudio.service can fail if command pulseaudio -k is used instead of systemctl restart pulseaudio.service

ALSA data for playback devices shows onboard audio as:

card 1: PCH [HDA Intel PCH], device 0: ALC233 Analog [ALC233 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Subdevices: 1/1 indicates analog audio subdevice is available and active in ALSA
but I would expect it to show as 0/1 (unavailable/active) if PulseAudio was active and accepting an output stream connection from PulseAudio

It is common to see HDMI as first audio device, to allow it to retain default device status
so audio streams revert to fallback device if HDMI is unplugged disconnects
and streams reconnect to HDMI when it is plugged in and available
Onboard audio cannot be completely unplugged in the same way and does not need
to be first on the ALSA device list

If HDMI audio is not supported or not wanted, usually just need to set the PulseAudio Profile to Off and PulseAudio will use the available output sink as default

I suggest you run

sudo alsactl nrestore

to rescan audio devices
with root access to rewrite ALSA settings file /var/lib/alsa/asound.state it should be able to update ALSA configuration to include any changes from update packages

I suspect you have Clementine using an ALSA device exclusively
so Audacious is not able to use the same device
and VLC cannot access the device via ALSA ‘default’ (PulseAudio) for the same reason

During the issue, i tried to close Clementine and open the VLC to play but it not helped.

$ systemctl restart pulseaudio.service
Failed to restart pulseaudio.service: Unit pulseaudio.service not found.

$ systemctl list-units --all|grep -i alsa
  alsa-restore.service                                                                                                                                  loaded    inactive dead      Save/Restore Sound Card State                                                                                 
  alsa-state.service                                                                                                                                    loaded    inactive dead      Manage Sound Card State (restore and store)   

$ sudo alsactl nrestore
alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: No such file or directory
alsa-lib parser.c:260:(error_node) UCM is not supported for this HDA model (HDA Intel HDMI at 0xf3610000 irq 52)
alsa-lib main.c:1014:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -6
Found hardware: "HDA-Intel" "Intel Haswell HDMI" "HDA:number1,number2,number3" "0x17aa" "0x3978"
Hardware is initialized using a generic method
alsa-lib parser.c:260:(error_node) UCM is not supported for this HDA model (HDA Intel PCH at 0xf3614000 irq 51)
alsa-lib main.c:1014:(snd_use_case_mgr_open) error: failed to import hw:1 use case configuration -6
Found hardware: "HDA-Intel" "Realtek ALC233" "HDA:string1,string2,string3" "0x17aa" "0x3978"
Hardware is initialized using a generic method

so audio is working (maybe due to me setting the device in mentioned file /etc/asound.conf)

so i tried to again empty that conf file and stop alsa:
$ > /etc/asound.conf;systemctl --user stop pulseaudio.socket;systemctl --user stop pulseaudio.service

audio is not playing and VLC again shows the bunch of Audio devices where the default selected is:
Default ALSA output (currently pulseaudio sound server)
when i switch to:
HDA Intel PCH, ALC233 Analog default audio device
audio start playing, but on file reopen it is reseted back to non playing: Default ALSA output

so i again set the device in conf file (1 is my internal sound card as described in my previous post):
$ cd;echo -e "defaults.pcm.card 1\ndefaults.ctl.card 1" > asound.conf;sudo mv asound.conf /etc/;cd -

and instantly without service restart i hear audio started playing in my VLC player. On VLC restart i see it shows bunch of audio devices where ALSA is default and plaiyng.

Then i do:
$ systemctl --user restart pulseaudio.socket;systemctl --user restart pulseaudio.service
Job for pulseaudio.service failed because the control process exited with error code.
See “systemctl --user status pulseaudio.service” and “journalctl --user -xe” for details.

$ systemctl --user status pulseaudio.service
● pulseaudio.service - Sound Service
     Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2021-01-08 14:13:18; 5s ago
TriggeredBy: ● pulseaudio.socket
    Process: 361295 ExecStart=/usr/bin/pulseaudio --daemonize=no --log-target=journal (code=exited, status=1/FAILURE)
   Main PID: 361295 (code=exited, status=1/FAILURE)

led 08 14:13:17 myusername systemd[778]: Failed to start Sound Service.
led 08 14:13:18 myusername systemd[778]: pulseaudio.service: Scheduled restart job, restart counter is at 5.
led 08 14:13:18 myusername systemd[778]: Stopped Sound Service.
led 08 14:13:18 myusername systemd[778]: pulseaudio.service: Start request repeated too quickly.
led 08 14:13:18 myusername systemd[778]: pulseaudio.service: Failed with result 'exit-code'.
led 08 14:13:18 myusername systemd[778]: Failed to start Sound Service.

Then i do:
pulseaudio -k; pulseaudio --start

and VLC start showing only one, working device: Built-In Audio Analog Stereo

so i think something is wrong with how is defined my audio device in Manjaro (since it needed me to manually define it in .conf file)? Do you have ideas to find the cause or get more details?

Different error from alsactl this time, no settings file exists

alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: No such file or directory

I suggest you check ALSA settings in alsamixer for all devices have the correct settings to suit your needs
Then create an asound.state file with this command

sudo alsactl store

Data from pulseaudio.service data confirms the failure I warned about

pulseaudio.service can fail if command pulseaudio -k is used instead of systemctl restart pulseaudio.service

I suggest you reboot system to try to get pulseaudio.service restarted
and check the pulseaudio.service and pulseaudio.socket are both ok

systemctl --user status pulseaudio.*

Manjaro normally does not have a file /etc/asound.conf

Manjaro default ALSA configuration (from package pulseaudio-alsa) is /etc/alsa/conf.d/99-pulseaudio-default.conf

# Default to PulseAudio

pcm.!default {
    type pulse
    fallback "sysdefault"
    hint {
        show on
        description "Default ALSA Output (currently PulseAudio Sound Server)"
    }
}

ctl.!default {
    type pulse
    fallback "sysdefault"
}

The instructions from Manjaro Wiki you linked to relate to using ALSA and apulse
“on systems which only have ALSA installed”

There does appear a typo in the heading ‘Use ALSA on with Applications requiring PulseAudio’
which should probably be ‘Use ALSA only with Applications requiring PulseAudio’
but it does not apply to your system because you have PulseAudio installed,
so you do not need apulse and ALSA workarounds for audio

We are getting closer to the issue cause!
After wasting some more time i have found that the sound problem is happening when i open the video file from within qBittorrent (4.3.1, qt 5.15.2) application (qbittorrent [Installed] 4.3.1-1 community)
But when i open from Dolphin or other app, then the sound plays. (i am on XFCE desktop)
One more observation: when the sound does not play, then the VLC media player/Audio/Audio Device shows long list of various “devices”, none working to play the sound, (except when i connect external USB sound card and select it there in VLC Audio devices). BUT when i opened file via Dolphin file manager or from within different app (Fsearch) - it opens in my default player VLC, then audio plays and the VLC shows only short list of audio devices:

  1. Built-in Audio Analog Stereo
  2. Audio Adapter (myUSBAdapterNameHere) Analog Stereo

when i open .mp3 from qbittorrent, then the Audacity says:
ALSA error: snd_pcm_open failed: Device or resource busy.

but when i open it not from qbittorrent, then Audacity plays.

If anyone want to try,
pamac install qbittorrent
sample magnet link

Which commands to try to find the cause?

If i have missed to answer any questions @nikgnomic please let me know.

VLC media player/Audio/Audio Device shows long list of various “devices”

I suspect that in this case VLC is set to use Output Module: ALSA audio output

these devices are probably ALSA pcm plugins and hardware devices that can also be seen listed in

aplay -L

Most of these options do not work for me, because most of my hardware devices are under the control of PulseAudio
but I can select 2 options to use either:

Default ALSA Output (currently PulseAudio Sound Server)
PulseAudio Sound Server

(your system may show the Default ALSA output differently if you have changed the Manjaro default by adding your own asound.conf configuration)

But it is simpler to change to Output Module: Pulseaudio audio output**
and choose audio device for playback in PulseAudio

I suggest that you stop using VLC as an audio diagnostic tool
It is a good cross-platform video player, but it is a complex application with 2 options to view the settings (simple and all) so it is difficult to know what exactly is going wrong with your settings. VLC also has a bug and can to fail to close properly so it could be lurking in the background causing audio problems

There are many simple Linux music players that can support audio playback to PulseAudio out of the box. A different and less complicated application may help you understand how Linux audio works

when i open .mp3 from qbittorrent, then the Audacity says:
ALSA error: snd_pcm_open failed: Device or resource busy.

This is basically the same problem as in VLC
if Audacity is trying to connect direct to an ALSA device that is already connected to PulseAudio connection will fail
Audacity does not support audio playback to PulseAudio instead of ALSA, but it should be able to use the ALSA plugin ‘pulse’
(and ‘default’ option may or may not work because of asound.conf)

1 Like

i am sad i can not report any progress @nikgnomic , you have written:

I suspect that in this case VLC is set to use Output Module: ALSA audio output
change to Output Module: Pulseaudio audio output** and choose audio device for playback in PulseAudio

i am unable to find how to do it, let me know please. In the meantime if interested, here is another mess i have seen:

After killing the unclosed VLC processes, problem remained, but when i changed default app to mpv, sound was ok, when i switched back to vlc, sound remain ok.

Then i think it messed up when i launched Clementine audio player and started playback. I now see qbittorrent and some Dolphin variant launched video files no longer play audio. (in mpv and in vlc). In VLC i have to switch to device “HDA Intel PCH, ALC233 Analog default audio device” then audio start playing (until i close VLC and start it again, then it revert to non-playing “Default ALSA Output …”). A few days back, it happened that when VLC launched via qbittorrent, then switching to that ALC233 device not made VLC play sound(update: maybe there is another glitch that i have to seek the video in order for the audio to start playing, maybe buffer?, i hate this, can i report this issue somewhere please?). Reason may be that this device was used by Clementine. I see that Clementine and “VLC set to ALC233” can not play audio both at once. This problem is only when media are launched via qbittorrent or via the Dolphin manager launched via qbittorrent (i guess some lower system rights). When i launch via normal Dolphin launched from system menu, then audio of media files plays OK even when Clementine is playing. Any idea on commands to run to discover issue and fix please?

check ALSA settings in alsamixer for all devices have the correct settings to suit your needs

When i run alsamixer, do F6 to select different device, it show then more volume controls and audio does not appear muted for different devices. I do not see any configuration that i suppose to be able to modify.

I had this problem again, but i have suspection that this misery may among other be caused by VLC process hanging and not closing properly, because after i kill it: kill -9 $(pidof vlc)
then the audio started playing it is some long term bug devs fails to fix.
Update: no this audio system is shit. I play clementine, it prevents other video players to play audio.
I quit Clementine, VLC start playing, but MPV still no auio. How to fix it? (sudo alsactl nrestore;pulseaudio -k; pulseaudio --start; not helps)
systemctl --user status pulseaudio.*

pulseaudio[910586]: GetManagedObjects() failed: org.freedesktop.DBus.Error.TimedOut: Failed to activate service ‘org.bluez’: timed out (service_start_timeout=25000ms)

(post withdrawn by author, will be automatically deleted in 4 hours unless flagged)

VLC is know to have a bug and not close properly
But it is not a major problem if VLC is set to use PulseAudio and share audio streams

you are correct - those commands usually make things worse

1 Like

i have found that the VLC player now plays the audio, it is set in VLC settings to default to PA output. But in VLC’s Audio/Audio Device menu i have HD-Audio Generic… set.

But in MPV, when i launch it via some app like qbittorrent or via Dolphin session launched via qbittorrent, then the MPV fails to play audio. When i launch same file via normal Dolphin session launched from system menu apps, then audio plays…

Here is this weird phenomenon:

Issue described also in this topic: qBittorrent, launches unprivilleged Dolphin session and no audio playback?