Clarification: I normally physically log on to and play media on host A using mpv, displaying the video on an external monitor HDMI-A-2 and playing the audio from host A’s headphone jack connected to external speakers. Today, I tried not physically logging on to host A, but remotely logging in from host B (my phone) using ssh from the same network and running the mpv command from host B. mpv then displays the video on the expected display HDMI-A-2, but it doesn’t play any audio.

Symptomatically, if I haven’t logged on physically to host A, mpv only displays video, plays no audio and throws errors. Why do I need to be physically logged on to host A for mpv to be able to access audio? You’d think a video feed would be more guarded than an audio one. But maybe this isn’t about security at all? Please enlighten me! 😊

  • balsoft@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    22 hours ago

    Can you show the output for when you’re running it while physically logged in, particularly the AO: output?

    • printf("%s", name);@piefed.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      21 hours ago

      I tried for literally an hour or so to redirect mpv’s output from host A (laptop) to host B (phone/termux) using all conceivable combinations and variations of
      cat /dev/tty1
      cat /dev/tty1 > /dev/pts/0
      cat /proc/[pid]/fd/[1-3]
      And adding 2>&1 to the above for good measure, but also the program reptyr and simply kill -STOP [pid] kill -CONT [pid] to absolutely no avail, so here’s a picture. Please forgive my lazy ass.

      ao at the bottom.

      z7snJMl9z4u57zL.jpg

      • balsoft@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        20 hours ago

        Aha, ok, so it’s using pipewire when logged in locally, and it can’t find it when using it remotely.

        Can you try logging in via ssh again and checking if there’s a /run/user/$UID/pipewire-0 (or other pipewire-<NUMBER> sockets)?

        If there isn’t, that means your pipewire service isn’t running, you can try starting it with systemctl --user start pipewire wireplumber. You may need a loginctl enable-linger $USER and a re-login for that to work. You can also do systemctl --user enable pipewire wireplumber so that it auto-starts them whenever you log in, if that’s not already the case.

        If/once that socket is there, you may need to export XDG_RUNTIME_DIR=/run/user/$uid so that mpv can find the socket. You should probably do that in your .profile so it’s set automatically.