Audio Forwarding stops after launching OBS
Environment
- OS: macOS
- scrcpy version: 2.3.1
- installation method: via homebrew
- device model: OnePlus 11
- Android version: 14
Describe the bug scrcpy works, with audio forwarding with both wireless & usb cable, however, as soon as I launch OBS the audio is lost. I enabled 'Monitor and Output' in OBS advanced properties but that did not have any effect.
Would appreciate any help in troubleshooting.
I notice these debug logs when OBS is running which may hint at something odd. Without OBS, it's typically Buffer underflow.
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 240 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 942 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 461 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 941 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 461 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 941 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 127 samples
I did another test on Linux and this does not seem to be a problem on linux so is macOS specific.
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
Technically, the audio output SDL callback is not called often enough (so there is more data received than data played).
You might try to increase the audio output buffer, at the cost of latency (and indirectly more buffer underflows):
scrcpy --audio-output-buffer=10 # in milliseconds, default is 5
@rom1v Thanks for your response. Will give that a shot.