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

mpv passthrough with Pipewire: "no target node available", ALSA works #15804

Open
6 tasks done
Tatsh opened this issue Feb 5, 2025 · 9 comments
Open
6 tasks done

mpv passthrough with Pipewire: "no target node available", ALSA works #15804

Tatsh opened this issue Feb 5, 2025 · 9 comments

Comments

@Tatsh
Copy link

Tatsh commented Feb 5, 2025

mpv Information

mpv 0.39.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
libplacebo version: v7.349.0
FFmpeg version: 6.1.2
FFmpeg library versions:
   libavcodec      60.31.102
   libavdevice     60.3.100
   libavfilter     9.12.100
   libavformat     60.16.100
   libavutil       58.29.100
   libswresample   4.12.100
   libswscale      7.5.100

Other Information

- Linux version: Gentoo
- Kernel Version: Linux limelight 6.13.1-gentoo-limelight #1 SMP PREEMPT_DYNAMIC TKG Tue Feb  4 17:42:27 EST 2025 x86_64 11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz GenuineIntel GNU/Linux
- GPU Model: 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation AD102 [GeForce RTX 4090] [10de:2684] (rev a1)
- Mesa/GPU Driver Version: 570.86.16
- Window Manager and Version: Plasma 6.2.5
- Source of mpv: Gentoo ebuild
- Latest known working version: n/a

ALSA works after disabling pipewire: mpv --ao=alsa --audio-channels=5.1,stereo '--audio-device=alsa/hdmi:CARD=NVidia,DEV=1' --audio-exclusive=yes file.mkv.

Reproduction Steps

  1. Make sure AC3 is enabled:
    Image
    pw e NODE_ID Props | grep -F Codecs -A 3
  Prop: key Spa:Pod:Object:Param:Props:iec958Codecs (65553), flags 00000000
    Array: child.size 4, child.type Spa:Id
      Id 1        (Spa:Enum:AudioIEC958Codec:PCM)
      Id 3        (Spa:Enum:AudioIEC958Codec:AC3)
  1. Use this command line: mpv --ao=pipewire --audio-channels=5.1,stereo '--audio-device=pipewire/alsa_output.pci-0000_01_00.1.hdmi-surround-extra1' --audio-exclusive=yes --audio-spdif=ac3 file.mkv

Expected Behavior

Video should play. AC3 bitstream should be sent to receiver.

Actual Behavior

The video does not start. Error message:

[ao/pipewire] Stream in error state, trying to reload...
[ao/pipewire] Error during playback: No such file or directory, no target node available

Log File

output.txt.gz

Sample Files

No response

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

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • 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.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
@avatar1024
Copy link

I'm facing exactly the same issue. And thank you @Tatsh for the trick, using alsa while specifying the device worked very well for me too! Though I also had to specify the option --audio=spdif=ac3 for it to work

@t-8ch
Copy link
Contributor

t-8ch commented Mar 7, 2025

Can you run mpv with the env variable PIPEWIRE_DEBUG=5 and post the output?

@t-8ch
Copy link
Contributor

t-8ch commented Mar 7, 2025

What happens without --audio-channels=5.1,stereo '--audio-device=pipewire/alsa_output.pci-0000_01_00.1.hdmi-surround-extra1' --audio-exclusive=yes ?

@Tatsh
Copy link
Author

Tatsh commented Mar 7, 2025

Can you run mpv with the env variable PIPEWIRE_DEBUG=5 and post the output?

Arguments at top of log.

With the arguments: pw-debug.log.gz

Without the arguments: pw-no-extra-args-debug.log.gz

What happens without --audio-channels=5.1,stereo '--audio-device=pipewire/alsa_output.pci-0000_01_00.1.hdmi-surround-extra1' --audio-exclusive=yes ?

Because I've set the HDMI device to default, basically the same thing.

@t-8ch
Copy link
Contributor

t-8ch commented Mar 8, 2025

Can you also enable logs from wireplumber? wp-ctl set-log-level D?
The logs will show up in journalctl --user --unit wireplumber

@Tatsh
Copy link
Author

Tatsh commented Mar 9, 2025

I realised that PulseAudio Volume Control (pavucontrol-qt) really likes to grab all of the devices so I killed it, and I killed easyeffects just in case. With those not running, mpv stops on the first frame.

 $ mpv --audio-spdif=ac3 file.mkv
● Video  --vid=1  (hevc 1920x1080 29.97 fps) [default]
● Audio  --aid=1  (ac3 6ch 48000 Hz) [default]
File tags:
Failed to parse codec profile.
Using hardware decoding (nvdec).
AO: [pipewire] 48000Hz stereo 2ch spdif-ac3
VO: [gpu] 1920x1080 cuda[nv12]
[auto_profiles] Applying auto profile: fhd30
AV: 00:00:00.033 / 01:58:17.664 (0%) A-V:  0.000

I checked to make sure it wasn't my config and the same thing happens with --config=no. Adding --ao=alsa works (and I do not have to kill Pipewire).

The 'Failed to parse codec profile' message is from ad_spdif.c.

Here is the Wireplumber log: wireplumber.log.gz

@t-8ch
Copy link
Contributor

t-8ch commented Mar 12, 2025

This looks better.

Could you provide pipewire/mpv/wireplumber logs without pavucontrol/easyeffects running for the command mpv --config=no --msg-level=ao/pipewire=trace --audio-spdif=ac3 file.mkv.
I'd like to look at a consistent set of logs.

@t-8ch
Copy link
Contributor

t-8ch commented Mar 12, 2025

And for journalctl use --output=short-iso-precise for high-res timestamps.

@Tatsh
Copy link
Author

Tatsh commented Mar 13, 2025

Just for consistency in testing I am using the following commands:

To set up and run mpv (after receiver is turned on):

clear; wpctl set-log-level D; export PIPEWIRE_DEBUG=5; pw-cli s alsa_card.pci-0000_01_00.1 Profile '{ name = "output:hdmi-surround71" }' && sleep 1 && pw-cli s alsa_output.pci-0000_01_00.1.hdmi-surround71 Props '{ iec958Codecs : [ PCM DTS AC3 EAC3 TrueHD DTS-HD ] }' && systemd-cat -p info -t mpvtesting <<< 'mpv starts here' && mpv --config=no --msg-level=ao/pipewire=trace --audio-spdif=ac3 ~/Downloads/file.mkv &> ~/Downloads/mpv.log; systemd-cat -p info -t mpvtesting <<< 'mpv stops here'

mpv.log

To get the journal output:

journalctl --output=short-iso-precise -f --user _SYSTEMD_USER_UNIT=wireplumber.service + SYSLOG_IDENTIFIER=mpvtesting > ~/Downloads/wireplumber.log

wireplumber.log

In the journal log above, look for 'mpv starts here' and 'mpv stops here' text to see when mpv starts and stops.

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

No branches or pull requests

4 participants