obs-studio
obs-studio copied to clipboard
[Application Audio Capture (beta)] Sound becomes noisy after a long time
Operating System Info
Windows 10
Other OS
No response
OBS Studio Version
29.0.0
OBS Studio Version (Other)
No response
OBS Studio Log URL
https://obsproject.com/logs/oF4ofzG6VIEKsq24 and https://obsproject.com/logs/Rfepmf1mNnWVYiE9
OBS Studio Crash Log URL
No response
Expected Behavior
Application audio capture should not send noisy audio
Current Behavior
When using application audio capture (beta) to record the Discord audio and send it through NDI, the audio capture works fine with a clean and perfect audio quality, but after a certain amount of time (like around 30 minutes) the audio is getting noisy.
Here is a clip where you can hear my friend's voice being noisy: https://clips.twitch.tv/ProudImpartialHyenaOpieOP-G7_zZ-l1EyINMDSD
Editing the application audio capture settings, like chosing another application to capture and then chosing back Discord fixes the issue until it starts to be noisy again (~30 min later)
Steps to Reproduce
- Create two "Application audio capture (beta)", one for Discord and one for the game
- Stream for around 30 min or more
- The Discord audio will start to get noisy
Anything else we should know?
I'm currently using two Application Audio Capture (beta):
- one for Discord (which is getting noisy after 30 min)
- one for the game (Ready Or Not) that is working perfectly fine (no noise for the entire streaming session)
I don't thing it could be an NDI issue, all the other audio sources are working perfecly. Also didn't had the issue in OBS 28
To diagnose this, we would likely need someone affected to follow these steps: https://github.com/obsproject/obs-studio/pull/5218#issuecomment-1071522440
I'm having the Noisy after 30-ish minutes issue with this audio capture method. Are you still looking for logs? I can capture you some if so.
I'm experiencing this exact same issue, also with Discord. Applying the suggested solution (change the audio source to other application and then back to Discord) only fixes it for a few minutes, I had to do it multiple times in my last streaming.
Is this issue being investigated?
I have the same problem. Only with me it is also partially with the game audio (Tarkov), Spotify and Discord.
I use OBS 29.
Is there anything I can do to help solve the problem?
The same bug, but only at the beginning of the stream.
Sound becomes normal after a while.
Windows 10, OBS 29.0.2
Same issue here. Sorry for the lack of information, but I would like to share the situations when I tested it.
- Pattern 1:
- Using OBS
v29.0.2,
capturing Chrome's audio usingApplication Audio Capture (Beta)
. - Recorded (not a live stream) for about 40 minutes, audio became noisy around 29-minute.
- Using OBS
- Pattern 2:
- Using OBS
v29.0.2
, did not useApplication Audio Capture (Beta)
, and captured Chrome's audio with win-capture-audio v2.2.3-beta. - Recorded for about 40 minutes, audio became noisy around 28-minute.
- (Honestly, this result is unexpected. I apologize if I made a mistake in the settings.)
- Using OBS
- Pattern 3:
- Downgraded to OBS
v28.1.2
and captured Chrome's audio usingApplication Audio Capture (Beta)
. - Recorded for about 40 minutes, and not confirm any particular noisy audio.
- Downgraded to OBS
My environment is Windows 11 Pro 22H2 22621.1555
.
For those able to reliably reproduce this, please provide a regular OBS log and a link to a video that exhibits this issue. If you are able to do so, please also follow these additional troubleshooting steps:
- Download obs.wprp.zip and extract
obs.wprp
. Do not use the obs.wprp/obs.wprp.zip file linked in #5218 as it is now outdated. - From an admin command prompt at the location of
obs.wprp
, enter:wpr -start obs.wprp
- Start the scenario (start OBS and start streaming/recording). Keep capturing until the problem occurs.
- After the problem has occurred, in the admin command prompt, enter:
wpr -stop repro.etl
- Provide repro.etl to us privately since it may contain personal information. You can find us in Discord: https://discord.com/invite/obsproject
- Optional: Provide extracted audio from the recording.
@S64 That you were unable to reproduce this on OBS Studio 28.1.2 is probably just by chance. This issue has been reported since before the #5218 was merged (see this comment), and the third-party win-capture-audio plugin also exhibits this issue.
Is there a known fix to this, or anything to combat it?
4. After the problem has occurred, in the admin command prompt, enter:
wpr -stop repro.etl
Is this step should be done in the middle of the "crackling"? Because crackling may gone by itself.
Is there a known fix to this, or anything to combat it?
Not at this time.
- After the problem has occurred, in the admin command prompt, enter:
wpr -stop repro.etl
Is this step should be done in the middle of the "crackling"? Because crackling may gone by itself.
The important part is that the issue must have occurred. As far as I know, it is not important if you execute wpr -stop repro.etl
during or after the issue, just so long as the issue has started.
Recorded inside VirtualBox environment.
obs_Issue8064_rec_etl_log_7z_file_LZMA.zip
obs_Issue8064_rec_etl_log_7z_file_LZMA.zip, 7-zip archive, about 14.9 MB to download, MD5:AEEE3F36C5C89AB195C3CAEE826DF11F (file extension is .zip instead of .7z to be able to upload it here)
Inside:
-
OBS log "2023-05-28 00-23-14.txt";
-
Windows Performance Recorder "repro.etl";
-
Record "2023-05-28 00-23-29.mp4" (fragmented, software x264, two AAC tracks, both tracks configured to record same sound (that playbacks by the system), 1kHz tone);
- 1st track is Application Audio Capture (BETA) (process capture, crackling starts at 53 sec);
- 2nd track Desktop Audio (device capture).
OS: Default Format in shared mode 44.1kHz
OBS: Audio 48kHz
OBS setup (test files): https://obsproject.com/forum/threads/audio-crackling-at-ranom-interval-with-application-audio-capture.166472/post-613393
I sent my repro.etl and links to my log and VOD to Mitchell (Yolo#0420) on the Discord server (EDIT: on May 18th), but I figured I'd post my log and VOD here as well for visibility:
Log: https://obsproject.com/logs/STVOABsm4rIFhiLd
VOD: https://www.twitch.tv/videos/1823568935 (issue starts around 1:03:00)
5. Provide repro.etl to us privately since it may contain personal information.
If for some reason the other people in this thread haven't seen my repro.etl
yet, please reach out to me at aelius
on the OBS Discord server.
I exactly have the same problem, but because it's random, and because in my setup I have the source muted to my monition (I listen directly form the font) then I just have to rely on my viewers that will tell me if the sound is not good, but this is very annoying because I do have a lot of work to have the perfect sound... here's my example:
This is when the audio problem starts (it can start rendomly at any time, or simply not happen): https://www.twitch.tv/peeempeegee/clip/EncouragingAntediluvianGoldfishKappaWealth-qvsaQ0sxwwdMcNRb?filter=clips&range=7d&sort=time
And this is when someone from my viewers tells me, and i just select randomly another Scene Collection,, turn back, and voila: https://www.twitch.tv/peeempeegee/clip/SmoothAttractiveWoodpeckerResidentSleeper-mFrOH5m33-qkkpMw?filter=clips&range=7d&sort=time
Few additional tests and results. Recorded inside VirtualBox environment.
Results (total size is about 2 GB of uncompressed data - lossless .avi recording + .etl + OBS config folder): 16.7 MB, MD5:D08027B0CE4CB0C6356BF9082C95EF03 16.8 MB, MD5:8B1189C2DBECE0B09B376F1F8685B681 17.8 MB, MD5:3154A30E960529072E489ACA86F3B49A 17.1 MB, MD5:8FA125EA1E633DA3A1E3F9A36B54791B obs44100_win44100_file44100.zip obs44100_win44100_file48000.zip obs48000_win44100_file44100.zip obs48000_win44100_file48000.zip
Description of results
- "2023-06-19 12-13-58.avi" - OBS 44100Hz, OS 44100Hz, test file 44100Hz - no issues(?!)
- "2023-06-19 12-31-33.avi" - OBS 44100Hz, OS 44100Hz, test file 48000Hz - moderate "crackling" starts from 11:21.56
- "2023-06-19 12-31-33.avi" - OBS 48000Hz, OS 44100Hz, test file 44100Hz - moderate "crackling" starts from 00:53.127; from 06:57.094; the track2 (reference desktop audio) from 11:42.107 has disstortion (reason unknown, don't forget this is virtual machine), so this part in both tracks cannot be taken into account
- "2023-06-19 13-05-18.avi" - OBS 48000Hz, OS 44100Hz, test file 48000Hz - moderate "crackling" starts from 01:05.094; from 05:57.391; from 10:25.287
In each case "crackling" lasts for about 30 seconds.
OS: Audio - Default Format in shared mode 44100 Hz, 16-bit in all tests
Test files (1 kHz on left channel, 0.6 amplitude, sinus; 250 Hz on right channel, 0.6 amplitude, sinus, sound played back from OBS .lua script, via "ffi" module by loading "Winmm", PlaySound function): 93.8 KB, MD5:FB5DCDC55A1FC759EEB74FD61BB54493 Issue #8064 (test files 44100-48000).zip
(all archives has .zip file extension instead of .7z just to be able to upload it here)
Steps for the Test files:
- Download the
Issue #8064 (test files 44100-48000).zip
archive, ~93.8 KB, MD5:FB5DCDC55A1FC759EEB74FD61BB54493 (see above). Change file extension form ".zip" to ".7z" and unpack its contents to the "C:\Temp" folder (make the one if it doesn't exist). If all done OK you will find:C:\Temp\Issue #8064 (test files 44100-48000)\testApplicationAudioCaptureBeta48000.lua
and other files) - Reduce volume of the PC and run OBS (test script includes sound files at 1000Hz and 250Hz that are awful for ears)
- Import Profile from folder named "test_Application_Audio_Capture_BETA_NNNNN_8064" (here NNNNN is 48000 or 44100)
- Import Scene Collection file named "test_Application_Audio_Capture_BETA_NNNNN_8064.json" (here NNNNN is 48000 or 44100)
- Switch to Profile named
test Application Audio Capture (BETA) NNNNN #8064
(here NNNNN is 48000 or 44100 from p.3) - Switch to Scene Collection named
test Application Audio Capture (BETA) NNNNN #8064
(here NNNNN is 48000 or 44100 from p.4) - Click Start Recording button (default destination for files is "C:\Temp", you may change it in OBS Settings > Output, but don't touch other settings!). Your PC will start to play looped sound of 1000Hz L + 250Hz R.
- Open main menu Tools > Scripts and select the "testApplicationAudioCaptureBetaNNNNN.lua" script (here NNNNN is 48000 or 44100 from p.4)
- In the properties of the script click the "Start disturb timer" button
- In 5 sec the Preview of OBS will be disabled and enabled again in 200 ms, again and again. Then in 5 sec process will repeat (infinity loop)
- Wait until crackling appear in the recording (about 2-120 minutes)
- Click Stop Recording button
- Exit OBS
- Add recorded .mp4 file to your favorite audio editor (or playback the file) to check if 1000Hz recorded signal has any anomalies (first stereo track is Application Audio capture (BETA), second is reference Desktop Audio)
Notes:
- p.9-10 are optional steps.
- you have to test 4 combinations of Profile + Scene Collection (44100-41000; 44100-48000; 48000-41000; 48000-48000), better if you have "Default Format" in shared mode for the OS set to 44100Hz ("bitness" doesn't matter).
- OBS will make "lossless" recording, so final files may be huge.
My own thoughts VirtualBox is not ideal place for the tests, OS is not up to date, but at least it shows difference between Desktop Audio track2 (wasapi_output_capture) and Application Audio Capture (BETA) track1 (wasapi_process_output_capture, top on the screenshots). Users who experience the issue usually says that they can't detect the sound corruption until they play back the recording or stream, so theirs desktop audio is normal, same as in my results. I decided to make lossless recording to exclude AAC encoder's compression and to be able to see what is really going on with the samples.
Screenshots of the results
It's all I can do right now.
Test results inside VMs are unusable, unfortunately. This needs to be replicated on a native Windows install, not a VM.
@Fenrirthviti Still, the problem is real on windows environment. Happens to me using the last obs version in windows 10 updated. @SuslikV we cannot detect in real time because we are capturing in OBS but playing sound from the application, so in OBS the audio monitor is muted (if not we would listen the source 2 times, and even with almost no latency, it would be a mess). That’s why normally I have someone on chat saying to me that the sound is weird… the only thing I know to stop the weird sound is if I change “scene collection” in obs and return to the same almost immediately, the problem is gone. But we really need this to be fixed… or at least understand what is going on so we have measures to fight against the problem until it’s not corrected. Feel free to ask me for help, I’ll do anything to have this corrected.
@nunowonder @charlesphil I looked at your twitch media files and I see increased amplitude of samples and multiplication to 0 of some of them - that sounds for me like "crackles". It is not like data was substituted by some random numbers. But of course, this can be my imagination. What happen if you playback test sounds on your PC for hour-two? Does OBS glitch them as well? Or this should be exclusively heavy task like game or browser? Just wonder.
@SuslikV it's random. For example, playing trackmania for 1 hour (it can be more, it can be less, you never know), and sound is perfect, the CPU Load is the same, everything is just perfect, and suddenly, crackling sound! Because I'm live streaming, and hearing from the game and not from the monition of OBS, I just know if the problem is happening if someone on my chat tells me. If not, the sound continues crackling... but for example, I play a lot GTAV RP, and that's much more intensive than trackmania, and I think it NEVER happened on GTAV capture... I don't know if there is something about the scene collection of GTAV have more audio sources... Somehow maybe the plugin don't crackle if the scene in OBS have more audio sources (?). It´s really something very strange because we don't know the cause... and it might not happen...
@Fenrirthviti if people will be able to reproduce the issue with my synthetic tests but in real PC - will it be fair or only real use case needed (audio grabbing from the game)?
@SuslikV and @Fenrirthviti I have it here: https://github.com/obsproject/obs-studio/issues/8064#issuecomment-1575497371
@nunowonder As far as I understand, due to special nature of the bug, developers want to gather more evidence to get some pattern. So, highly likely your result already taken into account. But seems it is not enough to resolve the issue. As far as I remember, on the forum there were thoughts that this can be bug from the Microsoft. Probably, you can help more by completing all these steps (in case you didn't do it yet ): https://github.com/obsproject/obs-studio/issues/8064#issuecomment-1519111627
And again, the developers were aware of the issue when feature was introduced in OBS: https://github.com/obsproject/obs-studio/pull/5218/commits/769a29bd1a561ae705091ad3c6fcb481850bc80c comment to this commit says that the Application Audio Capture source:
...Marked as "(BETA)" until we figure out the crackling at 60 minutes.
the issue was reported by user in: https://github.com/obsproject/obs-studio/pull/5218#issuecomment-927004947 and it was confirmed by developer in: https://github.com/obsproject/obs-studio/pull/5218#issuecomment-928904936 So, it is not like your system unique (where you can do something strange what developers can't reproduce on theirs end), but more high quality data about issue origin may help here.
Per the contacts at Microsoft that we are working with, data collected from a virtual machine is not usable for them.
We are not denying there is a problem, we know full well that there is something going on here. This is likely a bug on Microsoft's side, but we are trying to collect data that they require to investigate.
Due to the complexity of the data collection, it has proven extremely difficult to get everything we need. Without all the pieces of data, they are individually not very useful. We need all the steps in https://github.com/obsproject/obs-studio/issues/8064#issuecomment-1519111627 completed, as well as the audio sample (which is no longer optional, and is required to move forward with troubleshooting).
@Fenrirthviti if people will be able to reproduce the issue with my synthetic tests but in real PC - will it be fair or only real use case needed (audio grabbing from the game)?
Results from a synthetic test on a normal (not in a virtual machine) Windows installation might be fine.
recently started doing pc games via obs (usually its console games) and started a game called tell me why (chapter 2 is here https://www.youtube.com/watch?v=4iTvD-NV7SI&t=771s ) now my viewer(s) have been saying its been static about every thirty minutes (seems to be happening more frequently the longer the stream, goes on), i am recording a game from xbox game pass on pc, dont know if thats a thing that could also play into the factor of application audio capture, dont know if the fact i have two different application audio captures for 2 different scenes plays a factor as well, but the static is happening and hopefully this stream can help (first chapter https://www.youtube.com/watch?v=fDCVNTqN8S0 ) i found the loud music and ambiance from the game in intense and loud scenes seems to playing into the static being caused when streaming
Can someone confirm the current steps for gathering and providing the relevant data in reproducible scenarios?
Just did a dry run to make sure the instructions from https://github.com/obsproject/obs-studio/issues/8064#issuecomment-1519111627 still work.
I have the issue occur pretty often and quickly recently, so I thought it would be a good time to gather the requested data.
I am on OBS 29.1.3, Win 10 Version 10.0.19045 Build 19045.
After running wpr -start obs.wprp
from an admin prompt I opened OBS, started a recording, then tried to run wpr -stop repro.etl
but got this error:
wpr -stop repro.etl
Cannot change thread mode after it is set.
Profile Id: RunningProfile
Error code: 0x80010106
It also doesn't create any file in the folder.
Edit: moved question to top of comment.
It seems other software like e.g. the Elgato Wave Link experience similar issues. In their case, the software allows the adjustment of the buffer size. Increasing that is typically the suggested solution to solve crackling audio.
It also seems that windows reduced the audio buffer size severely with Windows 10, which might play into this: https://learn.microsoft.com/en-us/windows-hardware/drivers/audio/low-latency-audio
I am unfamiliar with the obs-studio code and C++, but from a naive search through it, I couldn't find any code adjusting the buffer size or safety buffer size of the WASAPI devices at all. Only the code clearing the buffer.
Maybe this is an angle to approach the topic from? I am sorry if I missed something and this is just useless conjecture.
We already dynamically increase buffers as necessary, and reset it by restarting the audio if it gets too large. This is unlikely to be related to something on our end, which is why we need the traces to send to Microsoft for investigation alongside the audio samples. Without everything together, they can't properly debug it.
As for the error, I'm unsure on that. The steps in the comment you referenced are still correct, and haven't changed. We'll check with MS and see what we can find, but if you are able to reboot your PC and try again from a clean start, that would be a good next step.
If soneone could give me accurate steps on using the wprp I will next session. But After approx 45 minutes or so of obs running, i captured the application audio capture running behind the source. It's not a crazy amount behind, but earlier in session, it was identical. You can see in the waveform of resolve track 2(app audio capture) is delayed.
https://obsproject.com/logs/0cojBetIG2LLzsOx In the video(if it actually uploads), I even cropped a capture of obs to see the audio mixer show it as well. audio delay-disc.webm
Update, this happened very shortly into session. The desync isnt as drastic as a longer session, but the waveform again clearly shows it falling behind
https://obsproject.com/logs/h8Oag4XlwQM8TWGo
If soneone could give me accurate steps on using the wprp I will next session.
The steps that I previously listed in April are still accurate.
We already dynamically increase buffers as necessary, and reset it by restarting the audio if it gets too large. This is unlikely to be related to something on our end, which is why we need the traces to send to Microsoft for investigation alongside the audio samples. Without everything together, they can't properly debug it.
As for the error, I'm unsure on that. The steps in the comment you referenced are still correct, and haven't changed. We'll check with MS and see what we can find, but if you are able to reboot your PC and try again from a clean start, that would be a good next step.
I don't wanna derail this discussion, but for anyone trying to gather the data and running into the same issue:
The only two search results Google spits out for "Cannot change thread mode after it is set." wprp
point at using the latest wpr
version for Windows11 from the Windows11 ADK to get around it.
I haven't gotten around to test this yet (also not sure if I can on Windows10), but I got the same error still and tried to figure out why it might occur. I am also still trying to reproduce the error in a way I can catch it myself, instead of relying on viewers to call it out live or accidentally finding it later in recordings.