Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not open playback device 'default': No such file or directory #634

Open
1 of 2 tasks
0smile opened this issue Jan 10, 2022 · 6 comments
Open
1 of 2 tasks

Could not open playback device 'default': No such file or directory #634

0smile opened this issue Jan 10, 2022 · 6 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists GPU

Comments

@0smile
Copy link

0smile commented Jan 10, 2022

Version

Microsoft Windows [版本 10.0.22000.376]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.60.1

Distro Version

Ubuntu 20.04

Other Software

gazebo 11

Repro Steps

run gazebo.

Expected Behavior

Gazebo should show 3d simulation world in the right windows.

Actual Behavior

Gazebo only show gray background, no 3d object.

Output from teminal:

ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory

Diagnostic Logs

I'm using a intel Xe graphic with latest driver.

@OneBlue OneBlue transferred this issue from microsoft/WSL Jan 11, 2022
@hideyukn88
Copy link
Member

@0smile, thanks for reporting the issue. I believe this could be same issue as #455, thanks!

@hideyukn88 hideyukn88 added bug Something isn't working duplicate This issue or pull request already exists GPU labels Jan 12, 2022
@7ngn
Copy link

7ngn commented Jan 20, 2022

I receive this same error in the terminal when trying to run a rust-lang program with dependencies on libsdl2-dev and libasound2-dev.

ALSA lib confmisc.c:767:(parse_card) cannot find card '0' ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default thread 'main' panicked at 'The device doesn't support any format!?: DeviceNotAvailable', /home/brett/.cargo/registry/src/github.com-1ecc6299db9ec823/rodio-0.11.0/src/engine.rs:149:14 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

@philippmossier
Copy link

I receive this same error in the terminal when trying to run a rust-lang program with dependencies on libsdl2-dev and libasound2-dev.

ALSA lib confmisc.c:767:(parse_card) cannot find card '0' ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default thread 'main' panicked at 'The device doesn't support any format!?: DeviceNotAvailable', /home/brett/.cargo/registry/src/github.com-1ecc6299db9ec823/rodio-0.11.0/src/engine.rs:149:14 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

same problem with rust and wsl2

@jonaskuske
Copy link

jonaskuske commented Mar 13, 2022

Had the same problem with sound playback in Epiphany / GNOME Web, but managed to fix it:

  1. Create ~/.asoundrc so ALSA uses WSLg's PulseAudio server as default "sound card":
pcm.default pulse
ctl.default pulse
  1. Change the PULSE_SERVER env variable to include the unix: scheme:
export PULSE_SERVER=unix:$(sed 's/unix://g' <<< "$PULSE_SERVER")

And now it should work, at least it did for me :)

@TonalidadeHidrica
Copy link

TonalidadeHidrica commented Oct 11, 2022

@jonaskuske Hi, I have encountered a same issue and I could not resolve it with your way. Using Ubuntu 22.04. I'd be appreciated if you could give me some idea.

I prepended unix: to PULSE_SERVER environment:

$ export | grep PULSE_SERVER
PULSE_SERVER unix:/mnt/wslg/PulseServer

Without ~/.asoundrc:

$ cat ~/.asoundrc
# pcm.default pulse
# ctl.default pulse

$ run_my_program_that_acceses_alsa
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default

After modifying ~/.asoundrc:

$ cat ~/.asoundrc
pcm.default pulse
ctl.default pulse

$ run_my_program_that_acceses_alsa

ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM pulse

Could it be due to a bug of WSLg, a misconfiguration, or a bug in my program? Do you have any idea what does the error mean, why does the program does not respect $PULSE_SERVER and how could I make it recognize?
At least, I have succeeded in playing sound with ffplay in WSL2.

@TonalidadeHidrica
Copy link

TonalidadeHidrica commented Oct 16, 2022

I found a resolution, which I described in #864 . Actually, I didn't need to modify $PULSE_SERVER. Instead, I needed to install an additional PulseAudio plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists GPU
Projects
None yet
Development

No branches or pull requests

6 participants