univrsal / obs-mpv

MPV video source for obs-studio
GNU General Public License v2.0
7 stars 0 forks source link

Sound in PipeWire #2

Open b4zz4 opened 2 months ago

b4zz4 commented 2 months ago

OS: Arch Linux

Great program. I was looking for a program that reproduces lists in gnu/linux but does not work the sound within OBS. (alsa, pulse, openAL they listen, but it doesn't work for the PipeWire transition)

Make with:

  cmake -B build \
  -DCMAKE_BUILD_TYPE=None \
  -DCMAKE_INSTALL_PREFIX='/usr' \
  -DCMAKE_INSTALL_LIBDIR=lib \
  -DLINUX_PORTABLE=OFF 

But don't work pipewire...

univrsal commented 2 months ago

Can you post a full obs log? Also you might need to restart the playback after changing to pipewire.

b4zz4 commented 2 months ago

Yeah, reboot many times. The video (OBS) appears in Pulse Audio and don't play or recorded in the transmission. Not even the level changes. Player windows don't allowed to interact.

https://github.com/univrsal/obs-mpv/assets/643833/92c9c119-9544-4d9a-8d1f-89ca511736d4

univrsal commented 2 months ago

The interaction not working is an issue with libmpv, nothing I can do about it. I also still need an obs log. Also I meant restarting the playback, not rebooting, like this:

https://github.com/univrsal/obs-mpv/assets/8353672/a62df9cc-6ed5-4843-b07e-47be0e3a4b05

b4zz4 commented 2 months ago

But the audio capture is done using the Desktop audio?

univrsal commented 2 months ago

It's the same when I use the builtin source:

https://github.com/univrsal/obs-mpv/assets/8353672/2b28451b-7582-429f-b7b5-fba7bc01a3dc

b4zz4 commented 2 months ago

Sure, that with pipewire isn't working on me. It's mute.

univrsal commented 2 months ago

What do the source properties look like after loading the file? Can you select a different audio track in there?

b4zz4 commented 2 months ago

It seems deactivated in the "interact" but in the source it is chosen.

Maybe it's a mistake in my compilation that parameters use in cmake

univrsal commented 2 months ago

does it happen with all video files? Do you have one that you could upload?

b4zz4 commented 2 months ago

I did tests with many, it seems he's trying to connect with jack only …

info: [obs-mpv] log:  (+) Video --vid=1 (*) (h264 1024x1280 25.000fps)
info: [obs-mpv] log:  (+) Audio --aid=1 (*) (aac 2ch 44100Hz)
info: [obs-mpv] log: File tags:
info: [obs-mpv] log:  Date: 2023/10/13 17:01:32
error: [obs-mpv] log: cannot open server
error: [obs-mpv] log: Failed to initialize audio driver 'jack'
error: [obs-mpv] log: Could not open/initialize audio device -> no sound.
info: [obs-mpv] log: Audio: no audio
info: [obs-mpv] log: VO: [libmpv] 1024x1280 yuv420p
info: [obs-mpv] log: Track switched:
info: [obs-mpv] log:  (+) Video --vid=1 (*) (h264 1024x1280 25.000fps)
info: [obs-mpv] log:      Audio --aid=1 (*) (aac 2ch 44100Hz)
univrsal commented 2 months ago

Try changing these two lines from "jack" to "pipewire" https://github.com/univrsal/obs-mpv/blob/master/src/mpv-backend.c#L420 https://github.com/univrsal/obs-mpv/blob/master/src/mpv-backend.c#L425

b4zz4 commented 2 months ago

It is heard by the speakers but not within OBS

univrsal commented 2 months ago

No clue what the issue is then