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

ALSA lib confmisc.c:768:(parse_card) cannot find card '0' #52

Closed
spyrospph opened this issue Jun 27, 2018 · 24 comments
Closed

ALSA lib confmisc.c:768:(parse_card) cannot find card '0' #52

spyrospph opened this issue Jun 27, 2018 · 24 comments

Comments

@spyrospph
Copy link

spyrospph commented Jun 27, 2018

Hi,

Using all images that you have provided I get the following error:

  Test 1 - Desktop
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4292:(_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:4292:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4292:(_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:4292:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default

My configuration is:

  1. DockerFile:
FROM cypress/base:10
RUN npm install --save-dev cypress
  1. docker run command:
docker run -it -v=mye2e:mye2e -w="mye2e" <container name> /node_modules/cypress/bin/cypress run

Is there anything we need to do to surpass this problem?

@spyrospph
Copy link
Author

Just a follow up on what i have seen.

this happens with the electron browser on the base images.
It does not happen on the chrome image (cypress/browsers:chrome67) using the chrome browser.

Also needs ipc: host on your docker-compose file

@aldarund
Copy link

Same situation. Happens with electron

@kschingiz
Copy link

Any news here? How to solve this issue? What if this is happening in CI and I need electron browser that's the only supported browser can run headless?

@aldarund
Copy link

@kschingiz despite this error happens tests are going fine

@kschingiz
Copy link

@aldarund no, my tests was broken when this error was thrown.

I fixed this bug, electron browser required sound cards, but my virtual server doesn't have any physical sound card. If you see this bug happening, that means you have not setup ALSA in your OS.
In case if you are using virtual linux server, that doesn't have any physical sound card, you should install dummy sound card.
Here are instructions:
https://www.alsa-project.org/main/index.php/Matrix:Module-dummy

And don't forget to add "jenkins" user to the "audio" group, in case if jenkins doesn't see any sound cards.

@aldarund
Copy link

aldarund commented Jul 26, 2018

For me tests not broken although this error printed on every test.
although this solution will work in some cases, its wont work for all e.g. in hosted CI, since u cant add sound card in hosted CI

@aldarund
Copy link

@bahmutov is there a better way to workaround this?

@bahmutov
Copy link
Contributor

bahmutov commented Jul 26, 2018 via email

@aldarund
Copy link

@bahmutov i dont use any of sound myself on my website but its still throwing this error. Maybe freshchat widget do smthing..
For example it happens on https://beta.tenantreport.net/auth/login ( when deployed on CI )

[12:21:05] Rendering url /auth/login/
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
...

@bahmutov
Copy link
Contributor

@aldarund can you see why it would pass on our CI machines (cypress-io/cypress-test-tiny#32) and not in your docker container?

@aldarund
Copy link

@bahmutov for me it pass too unlike the someone who said it crash completely. But it also print that error in output.
https://i.imgur.com/GsUtIaz.png

@aldarund
Copy link

Maybe your ci have an audio device configured?

@aldarund
Copy link

Ye, it probably goes from freshchat since its loading https://wchat.freshchat.com/assets/audio/notif.mp3
But its loaded async so another option might be that during that short test it just dont have time to load

@bahmutov
Copy link
Contributor

Excellent @aldarund I added cy.wait(10000) and see the error messages (although it does not fail the build on Circle) in https://circleci.com/gh/cypress-io/cypress-test-tiny/1037

Running: spec.js...                                                                      (1 of 1) 


  beta.tenantreport.net
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4259:(_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:4259:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4259:(_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:4259:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
    ✓ loads (12012ms)

and I see same errors on Codeship (also, not failing the build)

ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4248:(_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:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default

@aldarund
Copy link

Ye, exactly, for me it also just spam this error into console on wercker ci but build still successful and tests passed.

@bahmutov
Copy link
Contributor

hmm, I wonder if there is a way to disable the sound completely to remove these errors, ughhh

@Francismb
Copy link

Getting this error on my local machine in WSL. It, however, does not prevent the tests from running, it just clogs up the logs.

@calaldees
Copy link

I was able to suppress these warnings by configuring ALSA to use a pcm.null destination.
(This may not be ideal for all use cases because my assumption is that videos recorded with electron will not record with audio.)

example asound.conf

pcm.!default {
    type plug
    slave.pcm "null"
}

example .dockerfile

FROM cypress/browsers

COPY asound.conf /etc/asound.conf

@vicusbass
Copy link

@calaldees weirdly enough, I am still getting the warning ONCE using your trick :)

@iegik
Copy link

iegik commented Jun 5, 2019

cypress-io/cypress#4351

@vlodko
Copy link

vlodko commented Jul 9, 2020

is there a way to disable sound for cypress tests?

@wb-08
Copy link

wb-08 commented Aug 11, 2022

You need to install pulseaudio or pulseaudio-alsa and run your container like
docker run
-v /run/user/1000/pulse/native:/run/user/1000/pulse/native
-e PULSE_SERVER=unix:/run/user/1000/pulse/native
-u 1000:1000 \

@GuillaumeBAECHLER
Copy link

Not sure if this is a good solution but here is what I just experienced:

Using docker image cypress/included:11.2.0 in jenkins.
Running Electron in headless.
I got the ALSA lib confmisc.c:768:(parse_card) cannot find card '0' error and also got libva error.

Tried to apply this comment workaround but then ALSA was complaining about the configuration file being old or corrupted. libva error was still there.

Took a look at Xvfb and tried to start X11 server before running cypress even if nothing is running in parallel.

Adding these commands before running cypress is what removed both libva and ALSA errors for me.

Xvfb :99 &
export DISPLAY=:99;

Hope this can help. If you think this is not a good solution I would be happy to know 😅

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented May 24, 2024

This is an old issue for versions which are no longer supported.

If the issue is still occurring, please open a new issue with details.

@MikeMcC399 MikeMcC399 closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests