Skip to content

Frequent Device Busy errors - pulseaudio interfering #289

Closed

Description

@lgirdwood

Seeing lots of device busy failure recently

020-07-15 08:45:13 UTC [REMOTE_COMMAND] sof-tplgreader.py /lib/firmware/intel/sof-tplg/sof-bdw-rt286.tplg -f 'type:playback' -b ' pcm:HDA Digital,Media Playback,DMIC16k' -e
2020-07-15 08:45:13 UTC [REMOTE_INFO] Testing: Low Latency [hw:0,0]
2020-07-15 08:45:13 UTC [REMOTE_COMMAND] aplay -D hw:0,0 -c 2 -r 48000 -f S16_LE /dev/zero -q
aplay: main:830: audio open error: Device or resource busy
2020-07-15 08:45:13 UTC [REMOTE_INFO] /home/ubuntu/sof-test/test-case/multiple-pipeline-playback.sh will use topology /lib/firmware/intel/sof-tplg/sof-bdw-rt286.tplg to run the test case
2020-07-15 08:45:13 UTC [REMOTE_INFO] Pipeline list to ignore is specified, will ignore 'pcm=HDA Digital,Media Playback,DMIC16k' in test case
2020-07-15 08:45:13 UTC [REMOTE_INFO] Run command to get pipeline parameters
2020-07-15 08:45:13 UTC [REMOTE_COMMAND] sof-tplgreader.py /lib/firmware/intel/sof-tplg/sof-bdw-rt286.tplg -f 'type:capture' -b ' pcm:HDA Digital,Media Playback,DMIC16k' -e
2020-07-15 08:45:13 UTC [REMOTE_INFO] Testing: Low Latency [hw:0,0]

but nothing in dmesg or sof-logger to indicate any FW or driver problems.

This is causing a poor SNR with test results.

Activity

  1. lgirdwood commented on Jul 15, 2020

    @lgirdwood
    MemberAuthor

    Could something else in userspace be opening the device in these failures ? Do we check the result of close() on these devices ?

  2. paulstelian97 commented on Jul 15, 2020

    @paulstelian97

    Are we sure PA isn't causing trouble on Ubuntu 20.04?

  3. aiChaoSONG commented on Jul 16, 2020

    @aiChaoSONG

    @lgirdwood @paulstelian97 Pulseaudio will go through pipelines after system start up. Currently, we don't find a good way to disable and enable PA during test, so we remove PA. I am upgrading OS to Ubuntu 20.04 this week, and forget to remove PA after upgrading, that's why we see device busy. Sorry for the inconvenience, now checked PA on DUTs upgraded, issue should disappear.

  4. lgirdwood commented on Jul 16, 2020

    @lgirdwood
    MemberAuthor

    @aiChaoSONG thanks, I think there is a global pulseuadio file where you can disable the respawning. i.e. this would allow your scripts to start and stop pulseaudio as needed. Please google for the details.

  5. plbossart commented on Jul 16, 2020

    @plbossart
    Member

    /etc/pulse/client.conf
    ; autospawn = yes
    ->
    autospawn = no

  6. aiChaoSONG commented on Jul 17, 2020

    @aiChaoSONG

    I think @Bin-QA has tried the audospawn option, seems not work

  7. lgirdwood commented on Jul 20, 2020

    @lgirdwood
    MemberAuthor

    @Bin-QA @aiChaoSONG please also check systemd config for pulseaudio - it could be respawning. It could also be a gnome setting that's doing this too.

  8. aiChaoSONG commented on Jul 20, 2020

    @aiChaoSONG

    @lgirdwood We tried a lot of ways to deal with pulseaudio, but in vain. And now we temporarily remove PA at every deployment to avoid failures brought by PA. @marc-hb is trying to find a good way to disable/enable PA during test. Before he comes up with a solution, we will keeps the PA removal solution.
    BTW, you shouldn't see this issue any more, because PA is 99.999999% percent removed.

  9. marc-hb commented on Jul 27, 2020

    @marc-hb
    Collaborator

    @marc-hb is trying to find a good way to disable/enable PA during test.

    We de-prioritized this. If some pulseaudio testing is needed in the mean time it will be performed on other devices dedicated to pulseaudio.

  10. changed the title [-]Frequent Device Busy errors[/-] [+]Frequent Device Busy errors - pulseaudio interfering[/+] on Jul 27, 2020
  11. juimonen commented on Jul 30, 2020

    @juimonen

    At least in Ubuntu I needed to do this (in addition with above mentioned config file changes, could work without them also)

    stop:
    systemctl --user stop pulseaudio.socket && systemctl --user stop pulseaudio.service

    start:
    systemctl --user start pulseaudio.socket && systemctl --user start pulseaudio.service

  12. marc-hb commented on Sep 3, 2020

    @marc-hb
    Collaborator

    Or this?

    systemctl --user disable --now pulseaudio.socket
    systemctl --user disable --now pulseaudio.service
    

    man journalctl

  13. marc-hb commented on Jul 2, 2021

    @marc-hb
    Collaborator

    Finally identified a tricky a corner case: the gdm session manager can open its own pulseaudio instance when the system is on the login screen! This is very common when running tests remotely.

    The only simple way to disable this particular instance is with --global as in systemctl --global mask ... See more details in comments of New systemctl_show_pulseaudio() that catches the sneaky 'gdm' user at #728

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

type:bugSomething doesn't work as expected

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions