obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
60.68k stars 8.02k forks source link

Audio issues when using BlackMagic Recorder 3G with OBS - little to no audio #3511

Closed hertz42 closed 4 years ago

hertz42 commented 4 years ago

Platform

Operating system and version: Ubuntu 20.04.1 LTS OBS Studio version: 25.0.8 and 26.0.0-rc3 Blackmagicdesign UltraStudio Recorder 3G using HDMI, and TB3 Blackmagic Design Desktop Video 11.6

Also tried OBS 25.0.8 from Ubuntu ppa repository before upgrading to 26.0 rc3. Same issue.

Some people report the same issue when using MacOS, so it's probably not related to Linux.

Expected Behavior

Audio output from BlackMagic Recorder 3G should be synced, and not buggy. OBS should provide the same audio quality as MediaExpress tool from BMD.

Current Behavior

Audio is stopping, and restarting; there is large delay from start, and quality is terrible.

When looking at OBS Audio Mixer, audio from Blackmagic device is in sync. It's the output when monitoring, or when streaming that is unusable because of quality issues.

Also, BMD MediaExpress 3.6.1 is able to capture video, and audio perfectly!

Steps to Reproduce

  1. Install Blackmagic Design Desktop Video 11.6
  2. Install OBS from Ubuntu PPA
  3. Connect Recorder 3G to computer using TB3 cable.
  4. Connect Camera to Recorder 3G using HDMI
  5. Launch OBS
  6. Add "Blackmagic Device" as source.
  7. Select Device "UltraStudio Recorder 3G", Video connection: HDMI, Audio Connection: Embedded, Mode: Auto, Color Space/Range: Default, Channel: 2ch.
  8. Go to Advanced Audio Properties, and choose "Monitor Only" in Blackmagic Device line.
  9. Plug your Headphones, and listen.

In less than 5 seconds after that, you'll hear audio issue like delays, crackles, and stops.

Screenshot from 2020-09-28 17-41-32

Additional information

Bug also reported here:

Sometimes there a many lines like this one. Sometimes not. But the audio issue is always there. info: adding 21 milliseconds of audio buffering, total audio buffering is now 170 milliseconds (source: Blackmagic Device)

$ 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: 3093.467MHz info: Physical Cores: 4, Logical Cores: 8 info: Physical Memory: 23948MB Total, 14151MB 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: Switched to scene 'Scene' info: ------------------------------------------------ info: Loaded scenes: info: - scene 'Scene': 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: User added source 'Blackmagic Device' (decklink-input) to scene 'Scene' info: decklink: Starting capture... info: adding 21 milliseconds of audio buffering, total audio buffering is now 64 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 85 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 106 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 128 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 149 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 170 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 192 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 213 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 234 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 256 milliseconds (source: Blackmagic Device)

info: decklink: Stopping capture of 'UltraStudio Recorder 3G'... info: decklink: Starting capture... info: adding 21 milliseconds of audio buffering, total audio buffering is now 277 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 298 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 320 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 341 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 362 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 384 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 405 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 426 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 448 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 469 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 490 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 512 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 533 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 554 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 576 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 597 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 618 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 640 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 661 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 682 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 704 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 725 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 746 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 768 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 789 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 810 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 832 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 853 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 874 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 896 milliseconds (source: Blackmagic Device)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 917 milliseconds (source: Blackmagic Device)

QObject::connect: No such slot OBSBasicAdvAudio::ShowContextMenu(const QPoint &) info: adding 21 milliseconds of audio buffering, total audio buffering is now 938 milliseconds (source: Blackmagic Device)

warning: Max audio buffering reached! info: adding 21 milliseconds of audio buffering, total audio buffering is now 960 milliseconds (source: Blackmagic Device)

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: User changed audio monitoring for source 'Blackmagic Device' to: monitor only info: User changed audio monitoring for source 'Blackmagic Device' to: monitor and output info: User changed audio monitoring for source 'Blackmagic Device' to: monitor only 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 7089 packets with 9397777 frames info: pulse-input: Stopped recording from 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor' info: pulse-input: Got 97295 packets with 23165754 frames info: pulse-input: Stopped recording from 'alsa_input.pci-0000_00_1f.3.analog-stereo' info: pulse-input: Got 54417 packets with 23165800 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: 496.935 ms info: ┣OBSApp::AppInit: 1.891 ms info: ┃ ┗OBSApp::InitLocale: 0.773 ms info: ┗OBSApp::OBSInit: 352.024 ms info: ┣obs_startup: 21.81 ms info: ┗OBSBasic::OBSInit: 228.94 ms info: ┣OBSBasic::InitBasicConfig: 0.088 ms info: ┣OBSBasic::ResetAudio: 0.111 ms info: ┣OBSBasic::ResetVideo: 66.728 ms info: ┣OBSBasic::InitOBSCallbacks: 0.004 ms info: ┣OBSBasic::InitHotkeys: 0.039 ms info: ┣obs_load_all_modules: 116.486 ms info: ┃ ┣obs_init_module(decklink-ouput-ui.so): 0.601 ms info: ┃ ┣obs_init_module(frontend-tools.so): 66.77 ms info: ┃ ┣obs_init_module(image-source.so): 0.006 ms info: ┃ ┣obs_init_module(linux-alsa.so): 0.001 ms info: ┃ ┣obs_init_module(linux-capture.so): 0.838 ms info: ┃ ┣obs_init_module(linux-decklink.so): 5.077 ms info: ┃ ┣obs_init_module(linux-jack.so): 0.001 ms info: ┃ ┣obs_init_module(linux-pulseaudio.so): 0.002 ms info: ┃ ┣obs_init_module(linux-v4l2.so): 0.001 ms info: ┃ ┣obs_init_module(obs-ffmpeg.so): 0.244 ms info: ┃ ┃ ┗nvenc_check: 0.211 ms info: ┃ ┣obs_init_module(obs-filters.so): 0.013 ms info: ┃ ┣obs_init_module(obs-libfdk.so): 0.001 ms info: ┃ ┣obs_init_module(obs-outputs.so): 0.002 ms info: ┃ ┣obs_init_module(obs-transitions.so): 0.006 ms info: ┃ ┣obs_init_module(obs-x264.so): 0.002 ms info: ┃ ┣obs_init_module(rtmp-services.so): 0.461 ms info: ┃ ┣obs_init_module(text-freetype2.so): 0.048 ms info: ┃ ┗obs_init_module(vlc-video.so): 1.201 ms info: ┣OBSBasic::ResetOutputs: 0.121 ms info: ┣OBSBasic::CreateHotkeys: 0.034 ms info: ┣OBSBasic::InitService: 1.118 ms info: ┣OBSBasic::InitPrimitives: 0.145 ms info: ┗OBSBasic::Load: 7.558 ms info: obs_hotkey_thread(25 ms): min=0.069 ms, median=0.689 ms, max=11.589 ms, 99th percentile=1.971 ms, 100% below 25 ms info: audio_thread(Audio): min=0 ms, median=0.187 ms, max=1.984 ms, 99th percentile=0.883 ms info: obs_graphics_thread(16.6667 ms): min=0.052 ms, median=3.175 ms, max=491.298 ms, 99th percentile=13.044 ms, 99.5345% below 16.667 ms info: ┣tick_sources: min=0 ms, median=0.017 ms, max=474.634 ms, 99th percentile=0.034 ms info: ┣output_frame: min=0.025 ms, median=0.805 ms, max=7.343 ms, 99th percentile=2.152 ms info: ┃ ┗gs_context(video->graphics): min=0.024 ms, median=0.804 ms, max=7.343 ms, 99th percentile=2.151 ms info: ┃ ┣render_video: min=0.02 ms, median=0.289 ms, max=5.502 ms, 99th percentile=1.482 ms info: ┃ ┃ ┗render_main_texture: min=0.016 ms, median=0.278 ms, max=5.493 ms, 99th percentile=1.469 ms info: ┃ ┗gs_flush: min=0.001 ms, median=0.13 ms, max=4.322 ms, 99th percentile=0.743 ms info: ┗render_displays: min=0.002 ms, median=1.863 ms, max=68.886 ms, 99th percentile=11.754 ms info: ================================================= info: == Profiler Time Between Calls ================== info: obs_hotkey_thread(25 ms): min=25.14 ms, median=25.825 ms, max=36.7 ms, 17.1599% within ±2% of 25 ms (0% lower, 82.8401% higher) info: obs_graphics_thread(16.6667 ms): min=4.142 ms, median=16.666 ms, max=491.319 ms, 98.9415% within ±2% of 16.667 ms (0.573906% lower, 0.484632% higher) info: ================================================= info: Number of memory leaks: 0

hertz42 commented 4 years ago

Same issue after installing OBS Studio - 26.0.0

thebookfreak58 commented 4 years ago

I have a similar issue with the 3G recorder which has to use the 11.6 drivers.

Try this: https://youtu.be/pC1uX4Ik1cU

hertz42 commented 4 years ago

Hey @thebookfreak58

Your menu is different from the one I got on Linux, and I can't find how to reproduce :+1: Screenshot from 2020-10-05 16-15-13

thebookfreak58 commented 4 years ago

Hey @thebookfreak58

Your menu is different from the one I got on Linux, and I can't find how to reproduce 👍 Screenshot from 2020-10-05 16-15-13

The issue is the Blackmagic Device type you have selected in the source. You need to use Video/Audio Input Capture. Watch video again closely :)

vixns commented 4 years ago

I also have audio issues using another Blackmagic card ( Intensity pro 4k ). I was able to fix it by updating the declink sdk to version 11.6 and patch a couple of files. I cannot PR it yet because since the sdk update, auto format is broken, ask for a diff if needed.