Audio output with delays, crackles, and stops

jluc

New Member
My desktop audio output from my camera is out of sync, and has crackles, and stops/restart.

When I check Audio Mixer from Blackmagic device it seems to be in sync.
It's the output when monitoring, or when streaming that has an issue.

1601311359034.png


I tried installing default Ubuntu OBS, and after that I've even installed obs-studio-26.0.0-rc3. Same issue.

Using :
Thinkpad T480
Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz Physical Cores: 4, Logical Cores: 8
Physical Memory: 23948MB Total, 19265MB Free
Kernel Version: Linux 5.4.0-48-gener
Ubuntu 20.04
Blackmagic UltraStudio Recorder 3G

I can see messages like this one sometimes, but this doesn't seem to be related:
info: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Mic/Aux)


12:40:25 PM.358: pulse-am: Server name: 'pulseaudio 13.99.1'
12:40:25 PM.359: pulse-am: Audio format: s16le, 44100 Hz, 2 channels
12:40:25 PM.360: pulse-am: Started Monitoring in 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor'
12:40:25 PM.360: User changed audio monitoring for source 'Blackmagic Device' to: monitor only

Any idea?
 

jluc

New Member
Logs:


$ obs
Attempted path: share/obs/obs-studio/locale/en-US.ini
Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
Attempted path: share/obs/obs-studio/locale.ini
Attempted path: /usr/share/obs/obs-studio/locale.ini
Attempted path: share/obs/obs-studio/themes/Dark.qss
Attempted path: /usr/share/obs/obs-studio/themes/Dark.qss
info: CPU Name: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
info: CPU Speed: 2816.333MHz
info: Physical Cores: 4, Logical Cores: 8
info: Physical Memory: 23948MB Total, 18547MB Free
info: Kernel Version: Linux 5.4.0-48-generic
info: Distribution: "Ubuntu" "20.04"
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.8
info: Portable mode: false
Attempted path: share/obs/obs-studio/themes/Dark/no_sources.svg
Attempted path: /usr/share/obs/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_clicked()
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_destroyed()
QMetaObject::connectSlotsByName: No matching signal for on_actionGridMode_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_program_customContextMenuRequested(QPoint)
QMetaObject::connectSlotsByName: No matching signal for on_transitionRemove_clicked()
info: OBS 0.0.1 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
samples per sec: 48000
speakers: 2
info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter Intel Mesa Intel(R) UHD Graphics 620 (KBL GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 20.0.8, shading language 4.60
info: ---------------------------------
info: video settings reset:
base resolution: 1280x720
output resolution: 1280x720
downscale filter: Bicubic
fps: 60/1
format: NV12
YUV mode: 709/Partial
info: NV12 texture support not available
info: Audio monitoring device:
name: Default
id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
info: Decklink API Compiled version 10.11.4
info: Decklink API Installed version 11.6
error: os_dlopen(libnvidia-encode.so.1->libnvidia-encode.so.1): libnvidia-encode.so.1: cannot open shared object file: No such file or directory

info: FFMPEG VAAPI supported
info: VLC found, VLC video source enabled
info: ---------------------------------
info: Loaded Modules:
info: vlc-video.so
info: text-freetype2.so
info: rtmp-services.so
info: obs-x264.so
info: obs-transitions.so
info: obs-outputs.so
info: obs-libfdk.so
info: obs-filters.so
info: obs-ffmpeg.so
info: linux-v4l2.so
info: linux-pulseaudio.so
info: linux-jack.so
info: linux-decklink.so
info: linux-capture.so
info: linux-alsa.so
info: image-source.so
info: frontend-tools.so
info: decklink-ouput-ui.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'pulseaudio 13.99.1'
info: pulse-input: Audio format: s16le, 44100 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor'
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'pulseaudio 13.99.1'
info: pulse-input: Audio format: s16le, 44100 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1f.3.analog-stereo'
info: [Loaded global audio device]: 'Mic/Aux'
info: pulse-am: Server name: 'pulseaudio 13.99.1'
info: pulse-am: Audio format: s16le, 44100 Hz, 2 channels
info: pulse-am: Started Monitoring in 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor'
info: decklink: Starting capture...
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info: - source: 'Blackmagic Device' (decklink-input)
info: - monitoring: monitor only
info: ------------------------------------------------
Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /usr/share/obs/obs-studio/images/overflow.png
info: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Mic/Aux)



info: ==== Shutting down ==================================================
info: decklink: Stopping capture of 'UltraStudio Recorder 3G'...
info: pulse-am: Stopped Monitoring in 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor'
info: pulse-am: Got 3982 packets with 5338640 frames
info: pulse-input: Stopped recording from 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor'
info: pulse-input: Got 309567 packets with 6534496 frames
info: pulse-input: Stopped recording from 'alsa_input.pci-0000_00_1f.3.analog-stereo'
info: pulse-input: Got 15274 packets with 6534312 frames
info: All scene data cleared
info: ------------------------------------------------
info: [Scripting] Total detached callbacks: 0
info: Freeing OBS context data
info: == Profiler Results =============================
info: run_program_init: 534.145 ms
info: ┣OBSApp::AppInit: 1.796 ms
info: ┃ ┗OBSApp::InitLocale: 0.739 ms
info: ┗OBSApp::OBSInit: 396.099 ms
info: ┣obs_startup: 19.736 ms
info: ┗OBSBasic::OBSInit: 334.96 ms
info: ┣OBSBasic::InitBasicConfig: 0.112 ms
info: ┣OBSBasic::ResetAudio: 0.161 ms
info: ┣OBSBasic::ResetVideo: 96.52 ms
info: ┣OBSBasic::InitOBSCallbacks: 0.003 ms
info: ┣OBSBasic::InitHotkeys: 0.031 ms
info: ┣obs_load_all_modules: 119.977 ms
info: ┃ ┣obs_init_module(decklink-ouput-ui.so): 0.507 ms
info: ┃ ┣obs_init_module(frontend-tools.so): 69.123 ms
info: ┃ ┣obs_init_module(image-source.so): 0.007 ms
info: ┃ ┣obs_init_module(linux-alsa.so): 0.002 ms
info: ┃ ┣obs_init_module(linux-capture.so): 0.493 ms
info: ┃ ┣obs_init_module(linux-decklink.so): 5.235 ms
info: ┃ ┣obs_init_module(linux-jack.so): 0.002 ms
info: ┃ ┣obs_init_module(linux-pulseaudio.so): 0.001 ms
info: ┃ ┣obs_init_module(linux-v4l2.so): 0.001 ms
info: ┃ ┣obs_init_module(obs-ffmpeg.so): 0.326 ms
info: ┃ ┃ ┗nvenc_check: 0.285 ms
info: ┃ ┣obs_init_module(obs-filters.so): 0.052 ms
info: ┃ ┣obs_init_module(obs-libfdk.so): 0.002 ms
info: ┃ ┣obs_init_module(obs-outputs.so): 0.002 ms
info: ┃ ┣obs_init_module(obs-transitions.so): 0.007 ms
info: ┃ ┣obs_init_module(obs-x264.so): 0.003 ms
info: ┃ ┣obs_init_module(rtmp-services.so): 0.506 ms
info: ┃ ┣obs_init_module(text-freetype2.so): 0.03 ms
info: ┃ ┗obs_init_module(vlc-video.so): 1.323 ms
info: ┣OBSBasic::ResetOutputs: 0.117 ms
info: ┣OBSBasic::CreateHotkeys: 0.034 ms
info: ┣OBSBasic::InitService: 1.147 ms
info: ┣OBSBasic::InitPrimitives: 0.173 ms
info: ┗OBSBasic::Load: 17.937 ms
info: obs_hotkey_thread(25 ms): min=0.069 ms, median=0.678 ms, max=19.919 ms, 99th percentile=2.22 ms, 100% below 25 ms
info: audio_thread(Audio): min=0 ms, median=0.15 ms, max=2.16 ms, 99th percentile=0.874 ms
info: obs_graphics_thread(16.6667 ms): min=0.056 ms, median=2.356 ms, max=21.917 ms, 99th percentile=4.153 ms, 99.9775% below 16.667 ms
info: ┣tick_sources: min=0 ms, median=0.017 ms, max=4.394 ms, 99th percentile=0.04 ms
info: ┣output_frame: min=0.024 ms, median=0.929 ms, max=5.195 ms, 99th percentile=2.153 ms
info: ┃ ┗gs_context(video->graphics): min=0.024 ms, median=0.928 ms, max=5.194 ms, 99th percentile=2.152 ms
info: ┃ ┣render_video: min=0.019 ms, median=0.317 ms, max=2.254 ms, 99th percentile=1.53 ms
info: ┃ ┃ ┗render_main_texture: min=0.015 ms, median=0.303 ms, max=2.25 ms, 99th percentile=1.513 ms
info: ┃ ┗gs_flush: min=0 ms, median=0.543 ms, max=4.181 ms, 99th percentile=0.776 ms
info: ┗render_displays: min=0.002 ms, median=1.265 ms, max=19.659 ms, 99th percentile=2.606 ms
info: =================================================
info: == Profiler Time Between Calls ==================
info: obs_hotkey_thread(25 ms): min=25.139 ms, median=25.803 ms, max=45.018 ms, 19.4715% within ±2% of 25 ms (0% lower, 80.5285% higher)
info: obs_graphics_thread(16.6667 ms): min=11.352 ms, median=16.666 ms, max=21.935 ms, 99.8876% within ±2% of 16.667 ms (0.0561798% lower, 0.0561798% higher)
info: =================================================
info: Number of memory leaks: 0
 

dsales

New Member
I'm having the same problem with OBS 27.0.0 (linux) since I moved from Fedora 32 to Fedora 34 with Pipewire.

< info: pulse-am: Server name: 'pulseaudio 14.0-rebootstrapped'
< info: pulse-am: Audio format: s16le, 44100 Hz, 2 channels
--
> info: pulse-am: Server name: 'PulseAudio (on PipeWire 0.3.30) 14.0.0'
> info: pulse-am: Audio format: s32le, 48000 Hz, 2 channels
The delay and distortion only appears while monitoring. The output in the stream is correct.

If I increase the speed of the media to more than 100% the crackles disappear (mostly), but that's not a solution since the audio will be streamed faster than intended.
 

adambkaplan

New Member
I am having a similar problem with OBS 27.0.1 on Fedora 34 (Silverblue). Do we need to file a specific bug report for f34?
 

adambkaplan

New Member
Update - so audio capture on Fedora 34 works if I set the default sound input device to be my microphone. It shows up as "Mic/Aux" in the audio mixer.

This might not be suitable for everyone's needs, but it is fine for me.
 
Top