mpv icon indicating copy to clipboard operation
mpv copied to clipboard

No audio on pipewire

Open akrram09 opened this issue 6 months ago • 21 comments

mpv Information

mpv v0.40.0-dirty Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
 built on May 21 2025 20:53:16
libplacebo version: v7.351.0
FFmpeg version: n7.1.1
FFmpeg library versions:
   libavcodec      61.19.101
   libavdevice     61.3.100
   libavfilter     10.4.100
   libavformat     61.7.100
   libavutil       59.39.100
   libswresample   5.3.100
   libswscale      8.3.100

Other Information

- Linux version: Arch Linux
- Kernel Version: 6.15.2-arch1-1
- GPU Model: intel integrated 620
- Mesa/GPU Driver Version: mesa-1:25.1.3-3
- Window Manager and Version: sway version 1.11
- Source of mpv: arch packages
- Latest known working version: /
- Issue started after the following happened: i tried to play a video but noticed no audio

Reproduction Steps

im using pipewire and noticed when i try to play a video i get no output here is mpv --audio-device=help List of detected audio devices: 'auto' (Autoselect device) 'pipewire' (Default (pipewire)) 'pipewire/alsa_output.pci-0000_00_1f.3.analog-stereo' (Built-in Audio Analog Stereo) 'alsa' (Default (alsa)) 'alsa/pipewire' (PipeWire Sound Server) 'alsa/default:CARD=PCH' (HDA Intel PCH, ALC298 Analog/Default Audio Device) 'alsa/sysdefault:CARD=PCH' (HDA Intel PCH, ALC298 Analog/Default Audio Device) 'alsa/front:CARD=PCH,DEV=0' (HDA Intel PCH, ALC298 Analog/Front output / input) 'alsa/surround21:CARD=PCH,DEV=0' (HDA Intel PCH, ALC298 Analog/2.1 Surround output to Front and Subwoofer speakers) 'alsa/surround40:CARD=PCH,DEV=0' (HDA Intel PCH, ALC298 Analog/4.0 Surround output to Front and Rear speakers) 'alsa/surround41:CARD=PCH,DEV=0' (HDA Intel PCH, ALC298 Analog/4.1 Surround output to Front, Rear and Subwoofer speakers) 'alsa/surround50:CARD=PCH,DEV=0' (HDA Intel PCH, ALC298 Analog/5.0 Surround output to Front, Center and Rear speakers) 'alsa/surround51:CARD=PCH,DEV=0' (HDA Intel PCH, ALC298 Analog/5.1 Surround output to Front, Center, Rear and Subwoofer speakers) 'alsa/surround71:CARD=PCH,DEV=0' (HDA Intel PCH, ALC298 Analog/7.1 Surround output to Front, Center, Side, Rear and Woofer speakers) 'alsa/hdmi:CARD=PCH,DEV=0' (HDA Intel PCH, HDMI 0/HDMI Audio Output) 'alsa/hdmi:CARD=PCH,DEV=1' (HDA Intel PCH, HDMI 1/HDMI Audio Output) 'alsa/hdmi:CARD=PCH,DEV=2' (HDA Intel PCH, HDMI 2/HDMI Audio Output) 'jack' (Default (jack)) 'openal' (Default (openal)) but i noticed when i do mpv --ao=alsa --audio-device=alsa/default:CARD=PCH the audio working but when i do mpv --ao=pipewire --audio-device=pipewire/alsa_output.pci-0000_00_1f.3.analog-stereo" audio i get no audio

Expected Behavior

audio working on pipewire

Actual Behavior

no audio on pipewire when playing video

Log File

output.txt

Sample Files

i can reproduce with default config

I carefully read all instruction and confirm that I did the following:

  • [x] I tested with the latest mpv version to validate that the issue is not already fixed.
  • [x] I provided all required information including system and mpv version.
  • [x] I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • [x] I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • [x] I attached the full, untruncated log file.
  • [x] I attached the backtrace in the case of a crash.

akrram09 avatar Jun 18 '25 00:06 akrram09

Maybe this bug: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4713

It's fixed in git and should be in the next pipewire release.

I've started forcing ao=pulse since I've had a bunch of issues with the pipewire backend personally, although this one is on the pipewire side of things. But good to have people testing it in any case.

snrubthinks avatar Jun 18 '25 01:06 snrubthinks

Do you have mpv muted in pipewire's mixer? Find mpv in ~/.local/state/wireplumber/stream-properties and delete those lines, or delete/rename the file if you don't care about your remembered volumes for any application. I don't know what causes this but a few people have complained about this.

Also delete this lines in that file:

Output/Audio:media.role:Movie={"channelMap":["FL", "FR"], "channelVolumes":[0.000000, 0.000000], "mute":true, "volume":1.000000}

Output/Audio:media.role:Music={"channelMap":["FL", "FR"], "channelVolumes":[0.000000, 0.000000], "mute":true, "volume":1.000000}

Maybe this bug: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4713

It's fixed in git and should be in the next pipewire release.

I've started forcing ao=pulse since I've had a bunch of issues with the pipewire backend personally, although this one is on the pipewire side of things. But good to have people testing it in any case.

They're on 1.4.5 which already contains the fix.

llyyr avatar Jun 18 '25 01:06 llyyr

Same here. Only started happening today for me. Was fine yesterday.

mpv Information

mpv v0.40.0-dirty Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
 built on May 21 2025 20:53:16
libplacebo version: v7.351.0
FFmpeg version: n7.1.1
FFmpeg library versions:
   libavcodec      61.19.101
   libavdevice     61.3.100
   libavfilter     10.4.100
   libavformat     61.7.100
   libavutil       59.39.100
   libswresample   5.3.100
   libswscale      8.3.100

Other Information

  • OS: Arch Linux x86_64
  • Kernel: Linux 6.15.2-arch1-1
  • DE: GNOME 48.2
  • WM: Mutter 48.3 (Wayland)
  • GPU: Intel Arc A750
  • Mesa: Mesa 25.1.3-arch1.3
  • mpv:
    • mpv 1:0.40.0-3
    • mpv-mpris 1.1-3
  • PipeWire:
    • gst-plugin-pipewire 1:1.4.5-1
    • lib32-libpipewire 1:1.4.5-1
    • lib32-pipewire 1:1.4.5-1
    • lib32-pipewire-jack 1:1.4.5-1
    • libpipewire 1:1.4.5-1
    • pipewire 1:1.4.5-1
    • pipewire-alsa 1:1.4.5-1
    • pipewire-audio 1:1.4.5-1
    • pipewire-jack 1:1.4.5-1
    • pipewire-pulse 1:1.4.5-1

mpv.conf

# Video
hwdec=vaapi
vo=gpu-next
gpu-api=vulkan
gpu-context=waylandvk

# Audio
ao=pipewire
volume-max=100
audio-display=no
resume-playback=no
keep-open=yes
audio-exclusive=no

Reproduction Steps

It is reproducible with mpv --no-config video.mp4 since it defaults to PipeWire for me.

I can play audio files with ao=pipewire, like flac, mp3, etc and I can hear them. But the audio files have their volume lowered to 15% and is very quiet, even though it is at 100% when I press 0. If I play them with ao=pulse then they're at 100%.

Image

Video files have their audio lowered to 25% and are Muted too, I can't hear anything. Even though they're not muted (I did not press M, says Mute: No) and the volume is at 100% when I press 0.

Image

Only started happening today. Was fine yesterday when I was watching a movie. The only packages I updated in between watching that movie and now are these:

[2025-06-19T08:53:49+0300] [ALPM] upgraded dbus-broker (36-4 -> 37-2)
[2025-06-19T08:53:49+0300] [ALPM] upgraded dbus-broker-units (36-4 -> 37-2)
[2025-06-19T08:53:49+0300] [ALPM] upgraded github-cli (2.74.1-1 -> 2.74.2-1)
[2025-06-19T08:53:49+0300] [ALPM] upgraded libxml2 (2.14.3-1 -> 2.14.4-1)
[2025-06-19T08:53:49+0300] [ALPM] upgraded lib32-libxml2 (2.14.3-1 -> 2.14.4-1)
[2025-06-19T08:53:49+0300] [ALPM] upgraded python-markdown (3.8-1 -> 3.8.1-1)
[2025-06-19T12:17:25+0300] [ALPM] upgraded libnghttp2 (1.65.0-1 -> 1.66.0-1)
[2025-06-19T12:17:25+0300] [ALPM] upgraded lib32-libnghttp2 (1.65.0-1 -> 1.66.0-1)

Output of mpv --no-config --gpu-debug --log-file=output.txt video.mp4: output.txt

Sample video file: video.mp4

I don't know what else I can provide.

I am guessing the dbus update is to blame?

nokia8801 avatar Jun 19 '25 10:06 nokia8801

Can you also try deleting ~/.local/state/wireplumber/stream-properties? Or keep a backup, this file stores the set volumes for all apps

llyyr avatar Jun 19 '25 12:06 llyyr

Deleted it. But it restores itself to the original version with everything old in it somehow when I play a video with mpv. Only this line contains mpv.

Output/Audio:application.name:mpv={"mute":false, "channelVolumes":[1.000000, 1.000000], "volume":1.000000, "channelMap":["FL", "FR"]}

nokia8801 avatar Jun 19 '25 14:06 nokia8801

FWIW everything works fine for me with pipewire 1:1.4.5-1 but I also haven't updated for a week.

sfan5 avatar Jun 20 '25 14:06 sfan5

I'm guessing it has something to with these package updates.

[2025-06-19T08:53:49+0300] [ALPM] upgraded dbus-broker (36-4 -> 37-2)
[2025-06-19T08:53:49+0300] [ALPM] upgraded dbus-broker-units (36-4 -> 37-2)

That's about the only relevant thing that changed in my system. Isn't PipeWire and DBus or the bus related anyways?

nokia8801 avatar Jun 20 '25 14:06 nokia8801

It can't be related to dbus broker (would be very surprising if it is), it's most likely wireplumber/pipewire remembering "old" volumes or automatically muting something based on what you're doing.

llyyr avatar Jun 20 '25 14:06 llyyr

Could someone try out the following things?

  1. Start mpv with --audio-client-name=mpvsucks

  2. Compile mpv with this patch

diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c
index 88c48ddca60e..9974f172b64b 100644
--- a/audio/out/ao_pipewire.c
+++ b/audio/out/ao_pipewire.c
@@ -577,7 +577,7 @@ static int init(struct ao *ao)
     struct pw_properties *props = pw_properties_new(
         PW_KEY_MEDIA_TYPE, "Audio",
         PW_KEY_MEDIA_CATEGORY, "Playback",
-        PW_KEY_MEDIA_ROLE, ao->init_flags & AO_INIT_MEDIA_ROLE_MUSIC ?  "Music" : "Movie",
+        PW_KEY_MEDIA_ROLE, "Test",
         PW_KEY_NODE_NAME, ao->client_name,
         PW_KEY_NODE_DESCRIPTION, ao->client_name,
         PW_KEY_APP_NAME, ao->client_name,
  1. Both together

llyyr avatar Jun 20 '25 14:06 llyyr

Just updated my system. Now with dbus-broker 37-2 audio still works...

sfan5 avatar Jun 20 '25 15:06 sfan5

Could someone try out the following things?

1. Start mpv with `--audio-client-name=mpvsucks`

2. Compile mpv with this patch

diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c index 88c48ddca60e..9974f172b64b 100644 --- a/audio/out/ao_pipewire.c +++ b/audio/out/ao_pipewire.c @@ -577,7 +577,7 @@ static int init(struct ao *ao) struct pw_properties *props = pw_properties_new( PW_KEY_MEDIA_TYPE, "Audio", PW_KEY_MEDIA_CATEGORY, "Playback",

  •    PW_KEY_MEDIA_ROLE, ao->init_flags & AO_INIT_MEDIA_ROLE_MUSIC ?  "Music" : "Movie",
    
  •    PW_KEY_MEDIA_ROLE, "Test",
       PW_KEY_NODE_NAME, ao->client_name,
       PW_KEY_NODE_DESCRIPTION, ao->client_name,
       PW_KEY_APP_NAME, ao->client_name,
    
    1. Both together

Works with the patch. The --audio-client-name option does nothing it seems. Tested on gentoo, with pipewire 1.4.6 and mpv 0.40

ghost avatar Jul 29 '25 00:07 ghost

Check your wireplumber settings then. This points toward it having muted mpv's stream for some reason.

sfan5 avatar Jul 29 '25 07:07 sfan5

Works with the patch

Then your wireplumber/pipewire is muting all streams with the "Movie" media role. Delete your caches and try again

llyyr avatar Jul 29 '25 08:07 llyyr

I'm having it too since a few days, on Ubuntu 24.04.

Here, the bug appears when I use the audio-delay mpv property.

audio-delay = 150

Luckily, I no longer use Bluetooth headphones, which had an audio delay, so I no longer need to use audio-delay.

stax76 avatar Aug 26 '25 19:08 stax76

I think I had a very similar issue (on OpenSUSE Tumbleweed 20250910, mpv 0.40 from Flathub):

  • Audio works for videos with --ao=pulse, doesn't work with --ao=pipewire For pipewire:
  • Audio works for audio files, but not for videos
    • Audio extracted from video with ffmpeg works
    • Both streams talk to the same sink in wpctl status
    • No errors in logs, both audio and video had normal [ao/pipewire] queued 1024 of 1024 samples in logs

Then I finally rechecked with VLC (3.0.21 from Flathub). It had no audio too, but it was muted. I unmuted it and... mpv got its audio back (after starting mpv again).

Yup, when looking at wpctl get-volume <MPV_STREAM_ID_FROM_WPCTL_STATUS>, the output was Volume: 1.00 [MUTED]. Interestingly enough, both mpv itself and pavucontrol didn't think mpv was muted. [edit: I just found out that mpv shows the pipewire stream as muted in the info panel reachable with 'I' key] KDE's (6.4.4) Audio Volume tray panel (and System Settings->Sound) seems to get it right, though.

In general, it looks to me as if VLC could toggle some globalish state, but I know little about pipewire and its surroundings. Can somebody more knowledgeable chip in and confirm or deny this explanation?

My reproducer:

  • open problematic video with VLC
  • ensure that VLC is muted
  • open problematic video with mpv
    • mpv should be muted

prawilny avatar Sep 12 '25 16:09 prawilny

If you start playing a YouTube video in Firefox, then pause the video and start MPV with ao=pipewire and audio-exclusive=yes then MPV will not play audio. MPV will repeatedly output the following to the console:

cplayer: AO: [pipewire] 44100Hz stereo 2ch s16
ao/pipewire: Stream in error state, trying to reload...
ao/pipewire: Error during playback: No such file or directory, no target node available

If you close the tab, or once the video ends, MPV will be able to play audio. I'm not sure if this is considered a bug but I figured I'd let you guys know either way because I found this issue very annoying, and couldn't figure out why MPV wasn't playing audio!

Baysul avatar Oct 05 '25 09:10 Baysul

@prawilny Thanks, I've started having the same issue recently and your repro steps helped me. I should also note, that I don't have a VLC installed, so I don't think it's related, but the check/fix flow is the same:

# get mpv id
wpctl status
# check if pipewire is muted
wpctl get-volume <MPV_STREAM_ID>
# unmute
wpctl set-mute <MPV_STREAM_ID> 0

Gigas002 avatar Nov 08 '25 02:11 Gigas002

Been a long time since I made this comment on this report. I've been using pulse ever since because pipewire was broken on mpv.

I just recently tried ao=pipewire and audio is back, it's working now. Although for some reason it is reporting volume as 103% even though it's set at 100% and I even have volume-max=100 in config file.

Image

I don't really know what fixed this. A lot of packages got updated since I made my comment.

nokia8801 avatar Nov 09 '25 10:11 nokia8801

Thanks for all the info in this issue.

systemctl --user stop wireplumber
rm -rf ~/.local/state/wireplumber/*
rm -rf ~/.cache/wireplumber/*
systemctl --user start wireplumber

Cleaning up these fixed it for me.

ManuLinares avatar Nov 14 '25 07:11 ManuLinares

If you start playing a YouTube video in Firefox, then pause the video and start MPV with ao=pipewire and audio-exclusive=yes then MPV will not play audio. MPV will repeatedly output the following to the console:

cplayer: AO: [pipewire] 44100Hz stereo 2ch s16
ao/pipewire: Stream in error state, trying to reload...
ao/pipewire: Error during playback: No such file or directory, no target node available

Exclusive audio access with Pipewire is oxymoronic. There should probably be some guard against mpv even trying that because it does not make sense; or you must have some very good reason. And since Firefox and thus pipewire-pulse is already connected, albeit paused, there is simply no way to get exclusive access. The very purpose of sound servers like pipewire is to share one hardware device among multiple clients, with individual stream volumes and other niceties on top.

WhitePeter avatar Nov 14 '25 14:11 WhitePeter

I just recently tried ao=pipewire and audio is back, it's working now. Although for some reason it is reporting volume as 103% even though it's set at 100% and I even have volume-max=100 in config file.

volume-max is unrelated to what you see in that screenshot, because it shows ao-volume, aka the volume of the pipewire stream. So maybe the mpv's volume slider in pavucontrol got nudged a little over the 100% mark. volume-max only sets the upper limit for volume, mpv's internal software volume.

WhitePeter avatar Nov 14 '25 14:11 WhitePeter