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.2k stars 7.97k forks source link

Audio stutters every 30-40 minutes using USB sound cards. #6022

Closed cattywampus04 closed 2 years ago

cattywampus04 commented 2 years ago

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

27.2.1

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/hhNUvv1_KPwbeQpb

OBS Studio Crash Log URL

No response

Expected Behavior

Flawless audio.

Current Behavior

I have 2 computers. Each of the computer has it's own GOXLR Mini attached. Computer 1 is a Ryzen 3700X, ASUS ROG Crosshair VII Hero X470 Motherboard, 32GB RAM, 2080ti. Computer 2 is a Ryzen 2700X, Gigabyte AORUS Gaming Ultra X470 Motherboard, 16GB RAM, GTX 1650Super.

I record DJ sets using my Pioneer DJ gear. I connect the master out on the mixer to the line-in port on one of the GOXLRs. On the recordings, there are small, 1/4 of a second stutters that occur on average around every 30-40 minutes. This ruins the recording. I have the same issue on both computers and on both GOXLRs.

I tried recording using the motheboards audio. I disconnected and uninstalled the GOXLR software and drivers and I connected the DJ mixer to the line-in port on the motherboard and recorded that, twice...and both 90minute mixes had ZERO stutters. Every recording I make with the GOXLRs has stutters.

I then found a Sound Blaster OMNI USB sound card that I forgot I had. I unplugged the GOXLR from one of the computers and plugged that in and again, connected the DJ mixer to the line in port on that and recorded that in OBS. The first recording I have done just now and I just finished listening to it - there is 1 stutter. I will do another recording to confirm that there are stutters with the OMNI...but the 1 stutter on tonight's recording is consistent with the stutters I've been getting.

When recording using the GOXLR's, at the same time I recorded the same audio device that was recording in OBS (the Windows audio device name is "broadcast stream mix") inside of Audacity. I actually sent the same audio from the DJ mixer into the second GOXLR+Computer at the same time, and on that computer recorded in OBS and Audacity simultaneously. So, when finished, I had 2 OBS recordings and 2 Audacity recordings. Listening to all of them all the way through...OBS recordings had stutters, the Audacity recordings were stutter free (one of the Audacity recordings I set to use MME and the other I used WASAPI). I actually also always record audio on the laptop that the DJ mixer is connected to through USB - which controls how decks themselves work - that recording is taken from inside the Rekordbox software - and them recordings are always stutter-free.

I have updated the BIOSes and drivers of both computers. I have uninstalled the GOXLR software and drivers and reinstalled. I close everything down that is running in the background of the computers. All of the audio devices are all set to the same sample rate and bit depth (48khz 24bit). I have tried different USB cables. I actually had the GOXLRs connected to USB 3.0/3.1 ports too - I hoped it had been that, but even after moving them to USB 2.0 ports the problem persists.

I have a few other things to test to try and rule things in and out:

  1. Try the GOXLR on an older PC (an Intel 3770K) to rule out it being an X470/AMD problem
  2. Try setting all audio devices to 44.1khz 16bit

They are the main 2 that I can try...and as a drastic last resort, a completely fresh installation of Windows with nothing but device drivers and OBS installed.

Other than that I am seriously not sure how to proceed. It's clearly something to do with OBS and USB sound cards? At least that's what it feels like right now. The mixes I record in OBS, i have it all set up so that I can record everything with my camera connected etc, and I record everything in one take and the idea was the file could just be uploaded straight to Youtube with no need to edit in Adobe Premiere. As it stands now, with the audio stutters, I have to take the OBS recording and replace the audio with a stutter free recording.

I also used to stream my DJ sets a few months back. I went back and listened to some of my old recordings that I made when i was streaming. There are stutters on them too. I didn't know though cause I didn't go back and listen to them until I realised the recordings I was making for YT had the stutters. So this problem has survived multiple versions of OBS and multiple versions of the GOXLR app + drivers.

I'd really appreciate help on this one. I will report back in the next day or two with confirmation that using the Sound blaster OMNI USB sound card definitely has stutters like the GOXLR does.

Attached is a small MP3 with an example of the stutter (at around 5-6 seconds in). audio blip.zip

Any advice would be welcomed.

NB: I tried asking on the OBS forums but nobody answered. I bumped the thread like 4 times with new info but no bites, hence why I'm here.

Steps to Reproduce

Just record using OBS and then listen to the recording afterwards.

Anything else we should know?

No response

norihiro commented 2 years ago

Isn’t this a duplicated issue of #4600?

WizardCM commented 2 years ago

Duplicate of #4600

cattywampus04 commented 2 years ago

Hello,

Is this really the same issue? I don't get "drop outs"...the audio stutters, but there is no silence?

norihiro commented 2 years ago

Then, could you define "stutters"? I thought you are claiming there were unexpected silences. Are you experiencing ~1/4 second aoudio missing in the recording?

Either way, I think it's worth to try #5993. Please go to a section "All checks have passed", folllow a link for "CI Multiplatform Build", click "Summary", then you will find a package with the draft change. I don't think it completely resolve your issue but will behave differently. My guess is the audio will gradually lagged to the video

I'm suspecting the issue is caused by unsynchronized clock in the audio interface. My guess is that the audio interface might have slightly faster or slower clock than specified 44100 Hz, 48000 Hz, or what ever you specified. For your case, For example, actually running 44101 Hz where you specified 44100 Hz. If faster, OBS receives extra audio frame and finally drops audio when the extra audio frames are accumulated. In contrast, OBS will cause silence if slower.

I'm thinking another idea to address the issue but not ready for PR. https://github.com/norihiro/obs-studio/tree/sync-to-audio

cattywampus04 commented 2 years ago

Hello, I shall look at what you have suggested, but no, it's not silences I am experiencing, it's short stutters with no actual break in output, but you can clearly hear it skip a beat.

I included an MP3 in my original posted as an example of one of the stutters.

On Fri, 25 Feb 2022, 00:32 Norihiro Kamae, @.***> wrote:

Then, could you define "stutters"? I thought you are claiming there were unexpected silences. Are you experiencing ~1/4 second aoudio missing in the recording?

Either way, I think it's worth to try #5993 https://github.com/obsproject/obs-studio/pull/5993. Please go to a section "All checks have passed", folllow a link for "CI Multiplatform Build", click "Summary", then you will find a package with the draft change. I don't think it completely resolve your issue but will behave differently. My guess is the audio will gradually lagged to the video

I'm suspecting the issue is caused by unsynchronized clock in the audio interface. My guess is that the audio interface might have slightly faster or slower clock than specified 44100 Hz, 48000 Hz, or what ever you specified. For your case, For example, actually running 44101 Hz where you specified 44100 Hz. If faster, OBS receives extra audio frame and finally drops audio when the extra audio frames are accumulated. In contrast, OBS will cause silence if slower.

I'm thinking another idea to address the issue but not ready for PR. https://github.com/norihiro/obs-studio/tree/sync-to-audio

— Reply to this email directly, view it on GitHub https://github.com/obsproject/obs-studio/issues/6022#issuecomment-1050395082, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACLTDMWJ4RFKFWKWQV2BSWLU43EYBANCNFSM5PGKEIJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

norihiro commented 2 years ago

it's short stutters with no actual break in output, but you can clearly hear it skip a beat. I included an MP3 in my original posted as an example of one of the stutters.

I listened to your audio but could not identify what was wrong. I'm afraid I don't have enough sense of music. It would be appreciated if you attach both original and stuttering audio files.

cattywampus04 commented 2 years ago

Hi again,

Ok I have put together another zip file with an mp3 inside. There are three more examples of the stutters. They are small. I'd be surprised if you couldn't hear them but then maybe I it's only something people with a "sense of music" as you put it has?

There are 3 clips - first the stutter version plays, then the non-stutter version plays straight afterwards for each one.

Just a note though, while putting this together in Audacity, I did noticed that on the third clip, the stutter does actually have an small gap in the audio where the stutter is. On the waveform of the others, there is no gap, but there is still a stutter. The only setting that I can think of that might be different between the no-gap and gap-less stutters are that I unchecked "use device time stamps" during my testing.

There are loads more stutters in the various recordings - but they all follow the same pattern.

Seeing that waveform with the gap though does look exactly like what others have reported.

Hope this is of some use. Thanks.

image Audio Stutter Compilation Audacity.zip

floele commented 2 years ago

Hi @Stuwot, I noticed your issue linked to the one I'm working on. I assume what you are talking about is the hiccup at 0:18 in your file? If so, this is a very typical symptom for the issue I'm currently trying to fix. So you can try the build of OBS provided at #5993 and check if that fixes your issue.

cattywampus04 commented 2 years ago

Hello @floele

Yes that's right, the drop at 0:18 is what I have been experiencing. That particular stutter you pointed out is one that, when zooming in on the waveform in Audacity, you get a drop/gap. Some of the stutters I get, there is no gap, it just stutters. I've always thought that the stutter was something to do with the audio being slightly out of sync and drifting slightly over time, then OBS is doing something periodically that puts things back in sync for a temporary period - and it just repeats that over and over. I read through post #5993 - so you may have said something exactly like that, but I'm not going to pretend I understand any of your description and fix 😂

I absolutely will test though for you. You'll have to excuse me though, I am not GitHub savvy and I'm not exactly sure where I download your test build from? Could you point me in the direction and I'll aim to do a test over the next couple of days.

Just one more thing, when recording with the onboard motherboard audio, this problem is not present...only when using USB audio interfaces...does that tally up with your what you've found and your fixes?

Thanks

floele commented 2 years ago

Hi @Stuwot , you can see how to access the build in one of the comments of that PR. Currently, the most recent build is available here: https://github.com/obsproject/obs-studio/actions/runs/1888691307

This issue may occur both with internal and external devices. Thanks!

orange11orange commented 1 year ago

to rule out it being an X470/AMD problem - this. I don’t think it's worth discussing why AMD almost never produces chipsets for its CPUs and orders them from just anyone, unlike Intel, and what comes of it. But is it worth it? If you have built a PC to work with sound, then you are on the wrong platform.