Bug 1948299 - PipeWire's default target is unavailable with "aplay -D"
Summary: PipeWire's default target is unavailable with "aplay -D"
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: pipewire
Version: 34
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Wim Taymans
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-11 16:47 UTC by ludovicflb@gmail.com
Modified: 2021-04-11 22:02 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: ---
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)
Output of `aplay -l` and `aplay -L` (3.85 KB, text/plain)
2021-04-11 16:47 UTC, ludovicflb@gmail.com
no flags Details

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).


Note You need to log in before you can comment on or make changes to this bug.