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

--ao=pipewire not working with pipewire 0.3.75 #11995

Closed
JosefLitos opened this issue Jul 23, 2023 · 12 comments · Fixed by #11996
Closed

--ao=pipewire not working with pipewire 0.3.75 #11995

JosefLitos opened this issue Jul 23, 2023 · 12 comments · Fixed by #11996
Labels

Comments

@JosefLitos
Copy link

JosefLitos commented Jul 23, 2023

Important Information

Provide following Information:

  • mpv version: 0.35.1-dirty
  • Linux Distribution and Version: Archlinux
  • Source of the mpv binary: archlinux/extra
  • If known which version of mpv introduced the problem: no
  • Window Manager and version: sway 1.8.1
  • GPU driver and version: idk, not relevant
  • Possible screenshot or video of visual glitches

If you're not using git master or the latest release, update.
Releases are listed here: https://github.com/mpv-player/mpv/releases

Reproduction steps

use latest pipewire release (0.3.75)
open something with mpv --ao=pipewire

Expected behavior

play audio

Actual behavior

no audio (unless specified backup) - pipewire doesn't work with mpv (but works through pulse wrapper)

Log file

 mpv --ao=pipewire audio.opus
 (+) Audio --aid=1 (opus 2ch 48000Hz)
[ao] Failed to initialize audio driver 'pipewire'
Could not open/initialize audio device -> no sound.
Audio: no audio

Exiting... (Errors when loading file)

Sample files

any file with audio

@t-8ch
Copy link
Contributor

t-8ch commented Jul 23, 2023

Also reported at https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3374

t-8ch added a commit to t-8ch/mpv that referenced this issue Jul 23, 2023
Doing a pw_thread_loop_wait() without checking conditions is invalid.
The thread loop could be signalled for other reasons and in this case
the wait needs to continue.

PipeWire added such additional signaling in
commit 33be898130f0 ("thread-loop: signal when started").

This meant that for_each_sink would return before the callbacks have
fired and session_has_sink() would incorrectly return "false", failing
the initialization of ao_pipewire.

Fixes mpv-player#11995
@t-8ch
Copy link
Contributor

t-8ch commented Jul 23, 2023

This should be fixed by #11996, could you validate?

@JosefLitos
Copy link
Author

when I try to compile it as described in readme, meson setup build gives me:

ERROR: Neither source directory 'build' nor build directory None contain a build file meson.build.```

@q234rty
Copy link

q234rty commented Jul 23, 2023

I can confirm that #11996 fixes this for me under pipewire 0.3.75 w/ ao=pipewire

@t-8ch
Copy link
Contributor

t-8ch commented Jul 23, 2023

@JosefLitos

when I try to compile it as described in readme, meson setup build gives me:

Is your working directory the mpv source directory?

@JosefLitos
Copy link
Author

JosefLitos commented Jul 23, 2023

yes, but it seems to work for @q234rty so I would believe it works just as expected.

@t-8ch
Copy link
Contributor

t-8ch commented Jul 23, 2023

Can you give me a full transcript of your shell?

@JosefLitos
Copy link
Author

JosefLitos commented Jul 23, 2023

I am not sure what you mean by that. I am using fish.
image

@t-8ch
Copy link
Contributor

t-8ch commented Jul 23, 2023

You are still on the master branch of my repository.
Which is very old and does not contain the fix nor meson config.

For your convenience I pushed the new bugfix to my master branch.
Please delete your clone and redo the same steps.

@JosefLitos
Copy link
Author

oh, whoops, I was supposed to checkout.

@JosefLitos
Copy link
Author

yes, works just fine with your patch.

sfan5 pushed a commit that referenced this issue Jul 23, 2023
Doing a pw_thread_loop_wait() without checking conditions is invalid.
The thread loop could be signalled for other reasons and in this case
the wait needs to continue.

PipeWire added such additional signaling in
commit 33be898130f0 ("thread-loop: signal when started").

This meant that for_each_sink would return before the callbacks have
fired and session_has_sink() would incorrectly return "false", failing
the initialization of ao_pipewire.

Fixes #11995
@hmpfkafka
Copy link

works, thanks for the fix!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants