Bug 1948299

Summary: PipeWire's default target is unavailable with "aplay -D"
Product: [Fedora] Fedora Reporter: ludovicflb <ludovicflb>
Component: pipewireAssignee: Wim Taymans <wtaymans>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: brunovern.a, information, jwatt, vquintans, wtaymans
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-08 01:08:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Output of `aplay -l` and `aplay -L` none

Description ludovicflb@gmail.com 2021-04-11 16:47:56 UTC
Created attachment 1771199 [details]
Output of `aplay -l` and `aplay -L`

Description of problem:
Unable to play audio over `sysdefault` endpoint using `aplay` command.

Version-Release number of selected component (if applicable): PipeWire 0.3.25

How reproducible:
aplay -D sysdefault <audiofile.wav>

Steps to Reproduce:
1. Upgrade from Fedora 33 Worksation to Fedora 34 Worksation on bare-metal
2. Make sure the alsa-utils package is installed
3. Connect speakers to the computer's sound device
4. Play audio file over the default device with : 
$ aplay -D sysdefault <audiofile.wav>

Actual results:
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:830: erreur à l'ouverture audio: Périphérique ou ressource occupé

Expected results:
Audio of <audiofile.wav> should be played over speakers

Additional info:
Output of `aplay -l` and `aplay -L` in attachment

Comment 1 ludovicflb@gmail.com 2021-04-11 21:55:14 UTC
After further investigation, it appears that the device is not accessible with `aplay -D` when it comes to PipeWire's default target.

Let consider two audio devices A and B.
"hw:2,11" and "hdmi:CARD=HDMI,DEV=5" are equivalent to A.
"sysdefault", "hw:0,0" and "sysdefault:CARD=Headset" are equivalent to B.
Suppose the output of `pw-play --list-targets` is :
    A: description="...
*   B: description="...

So B is the default target of PipeWire.
Then we have the following result :

* `aplay -D default audiofile.wav` : OK! --> audio output on B
* `aplay -D sysdefault audiofile.wav`: ERROR : resource busy (expected : output on B)
* `aplay -D pipewire audiofile.wav` : OK! --> audio output on B
* `aplay -D hw:0,0 audiofile.wav` : ERROR : resource busy (expected : output on B)
* `aplay -D sysdefault:CARD=Headset audiofile.wav` : ERROR : resource busy (expected : output on B)
* `aplay -D hw:2,11 audiofile.wav` : OK! --> audio output on A
* `aplay -D hdmi:CARD=HDMI,DEV=5 audiofile.wav` : OK! --> audio output on A

Now if we change the default target of PipeWire.
The output of `pw-play --list-targets` will be :
*   A: description="...
    B: description="...


So A is now the default target of PipeWire.
Then we have the following result :

* `aplay -D default audiofile.wav` : OK! --> audio output on A
* `aplay -D sysdefault audiofile.wav`: OK! --> audio output on B
* `aplay -D pipewire audiofile.wav` : OK! --> audio output on A
* `aplay -D hw:0,0 audiofile.wav` : OK! --> audio output on B
* `aplay -D sysdefault:CARD=Headset audiofile.wav` : OK! --> audio output on B
* `aplay -D hw:2,11 audiofile.wav` : ERROR : resource busy (expected : output on A)
* `aplay -D hdmi:CARD=HDMI,DEV=5 audiofile.wav` : ERROR : resource busy (expected : output on A)


Therefore, it appears that the PipeWire's default target makes the device busy in the eyes of ALSA.
If this behavior is normal (or inevitable), it is not writted in the Fedora Audio Test Day (https://fedoraproject.org/wiki/QA:Testcase_PipeWire_ALSA_backend?rd=User:Lruzicka/QA:Testcase_ALSA_backend).

Comment 2 Ben Cotton 2022-05-12 16:44:26 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 3 Ben Cotton 2022-06-08 01:08:53 UTC
Fedora Linux 34 entered end-of-life (EOL) status on 2022-06-07.

Fedora Linux 34 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release.

Thank you for reporting this bug and we are sorry it could not be fixed.