dimtpap / obs-pipewire-audio-capture

🔊 Audio device and application capture for OBS Studio using PipeWire
https://obsproject.com/forum/resources/pipewire-audio-capture.1458/
GNU General Public License v2.0
298 stars 9 forks source link

sound disappearing #17

Closed VladimirMrzv closed 1 year ago

VladimirMrzv commented 1 year ago

I am streaming video from games. Before i used virtual card from pipewire. Now trying this plugin, but after 3:30 minutes sound disappearing.

https://www.twitch.tv/videos/1533647249?t=0h3m17s from 3:30 no sound

Trying change input source, but not help. And no indication for sound in mixer.

dimtpap commented 1 year ago

This may take a while to fix because it's happened to me before but it's very hard to reproduce since it's rare and random. What version of PipeWire are you running?

VladimirMrzv commented 1 year ago

I am on Ubuntu 22.04 pipewire 0.3.55 from https://launchpad.net/~pipewire-debian/+archive/ubuntu/pipewire-upstream

VladimirMrzv commented 1 year ago

I can help to reproduce it and save log. Write please how to do it.

dimtpap commented 1 year ago

I generated a 3 hour audio file and let it run in its entirety two times, the stream never stopped. If you can reproduce it run pw-dump > pw-dump.log in a terminal and upload the pw-dump.log file here, thank you

Heliozoa commented 1 year ago

Here's my pw-dump.log after the same issue. I can't reproduce it at will but it only takes a couple of minutes to happen on my PC so if there's something else I can do identify the issue let me know.

pw-dump.log

New sources work, but the one that has this issue stops doing anything, even after changing the application or checking "Capture all apps except this one".

I'm running Pop!_OS 22.04 LTS, OBS 27.2.4, pipewire 0.3.53 and version 1.0.4 of the plugin.

dimtpap commented 1 year ago

What are the outputs of journalctl -e --user-unit pipewire and journalctl -e --user-unit wireplumber? Also does it occur consistently after a few minutes?

Heliozoa commented 1 year ago

I forgot to mention it in the first post, but I think I've only tried using the plugin with games using Steam Proton so far. The application is wine64-preloader, which all Steam games seem to show up as when running them through Proton. The game the OP was playing doesn't have a native linux version, so I believe they were using Proton as well.

For today, the first is

-- Boot 20c48f78746748a19eb15919084990aa --
heinä 18 14:25:23 pop-os systemd[3225]: Started PipeWire Multimedia Service.

and the second

-- Boot 20c48f78746748a19eb15919084990aa --
heinä 18 14:25:23 pop-os systemd[3225]: Started Multimedia Service Session Manager.
heinä 18 14:25:23 pop-os wireplumber[3243]: Failed to set scheduler settings: Operation not permitted
heinä 18 14:25:24 pop-os wireplumber[3243]: <WpSiAudioAdapter:0x56094ab490b0> Object activation aborted: proxy destroyed
heinä 18 14:25:24 pop-os wireplumber[3243]: <WpSiAudioAdapter:0x56094ab490b0> failed to activate item: Object activation aborted: proxy destroyed

I've triggered the issue today twice around 1-2 hours after the latest timestamps in the logs. It seems relatively consistent, I have not had it working continuously for more than maybe 10 minutes.

dimtpap commented 1 year ago

I've had it happen with native programs like Firefox and Discord so Proton/Wine is not related. Whenever you can, run OBS through a terminal using this command PIPEWIRE_DEBUG=5 PIPEWIRE_LOG=pwlog.txt obs --verbose. When the sound stops, post the pwlog.txt file, it will be in the directory you ran the command in

VladimirMrzv commented 1 year ago

my files pw-dump.log pwlog1.txt pwlog2.txt

I run game from steam in proton. Reproducing in Dying Light 2.

dimtpap commented 1 year ago

This isn't guaranteed to fix the problem since it's so annoyingly random, but see if this build fixes it. Install it like you would install a regular release, replacing the installed version you have

Edit: If you want to manually build it here is the patch

VladimirMrzv commented 1 year ago

sad, but not helped

New logs pw-dump2.log pwlog6.txt pwlog5.txt

in file 5, after start no sound and plugin not work

Heliozoa commented 1 year ago

Hard to say for sure if something's fixed for sure with a random issue like this, but I had the plugin running using the build above without issues for 4 hours, compared to before where it would consistently stop working within 10 minutes.

edit: Nevermind, it broke again with a different game. It almost feels like it works for hours with some applications and breaks in minutes with others. Here's my pwlog.txt

VladimirMrzv commented 1 year ago

Try on another game and it works 3-4 hours. Maybe something go wrong with Dying Light 2.

aeris commented 1 year ago

Hello here! I'm facing the same trouble too. Also using wine but other sounds sources vanish after some time too (firefox & discord already experienced). Will try to generate log on a future session.

dimtpap commented 1 year ago

Playing around with the properties and taking a look at PipeWire's source code I could get the stream to not process when ALWAYS_PROCESS was set to true. From some quick and dirty searches on their GitLab it looked like these options just affected which driver the stream was set to follow. Setting both this and WANT_DRIVER to false hopefully prevents this behavior.

Try this build from commit 0b895f5

aeris commented 1 year ago

Nice, i will try that soon!

VladimirMrzv commented 1 year ago

After update pipewire and today plugin it works better, but sound continue disappearing in DayingLight2. Now disappear after 1 hour and 25 minutes, it happened two times - 5 days ago and today.

dimtpap commented 1 year ago

Let me know if this is happening with PipeWire 0.3.59

aeris commented 1 year ago

No trouble here since last release and during 4-5h session. Will try it soon with 0.3.59.

DonKatsu commented 1 year ago

OBS 28.1.2, obs-pipewire-audio-capture 1.0.5, Pipewire 0.3.60 from the Fedora repos Application Audio Capture with Monster Hunter Rise (wine64-preloader selected) is consistently losing audio. Haven't tried anything else yet. Here's a log but I likely didn't catch it exactly after it happened. pwlog.txt

dimtpap commented 1 year ago

Great news, after narrowing down the issue and reporting it to PipeWire it got resolved rather fast. I'll test it and I will close this if it's fixed. Thanks everybody for your help!

dimtpap commented 1 year ago

All good! I'm expecting the fix to be included in the next PipeWire release, 0.3.62

luni3359 commented 1 year ago

Thank you so much! I'm very glad it got solved