Question / Help Slowed Audio with OBS (linux)

ShadWolf

New Member
Okay so I've been searching around to see if anyone else has had this issue that I'm having where the audio playback is all slowed down and not playing at the normal rate when a video has been recorded, the proper original source of the audio at normal rate.

Log: http://pastebin.com/qxQXE0H4

Video example: https://www.dropbox.com/s/2me081t7g1z4hxg/obs_rec_002.mp4?dl=0

I've tried playing around with the CPU User Presets to see if it makes any difference, but doesn't matter which I set it to, because it doesn't seem to make any difference to the audio's rate. I do have a feeling that this is what's causing the audio to be recorded slowly, because when I change it, it changes the tempo at which it's heard on playback. Pulseaudio checks out OK' but OBS doesn't capture the audio the way it should be captured when I initially hear it, and it's only until after I finish recording something and playback the video file it shows it never recorded the audio properly.

the only Encoder available for use is x264, and OBS only uses OpenGL as the renderer. I usually like to record my things at highest possible quality settings 1080p @ 60FPS if just recording offline, and 720p @ 60FPS for streaming.
 

ShadWolf

New Member
Seems you are affected by the same issue as here: https://obsproject.com/forum/threads/audio-output-is-low-pitched.26434/

The tell-tale sign is that at the start of your logfile you have "audio settings reset, samples per sec: 48000" and "10:09:19 AM: pulse-input: Audio format: s16le, 44100 Hz, 2 channels" (note mismatch: 48000 != 44100)

derp… can't believe I overlooked that.

Another thing… I have to change my system audio settings before I start OBS because OBS doesn't support Analog Surround 4.0 Output, only Analog Stereo, if I don't change it I get garbled crackled noise. I'll have to see how I can get OBS to play nice with 48000 KHz because I have that selected in OBS's settings, and its default setting. I dunno… I'll probably have to play around with the settings more.
 

leonhard

Developer
Just to clarify: The mismatch of sample rates in the log is actually fine. If a source has a different input format/sample rate/speaker layout than specified in in the obs settings, the data will automatically be converted.

The bug with pulseaudio happens because pulse can be configured to switch between sample rates as convenient (the default/alternate sample rate parameters in the config). In versions older than 4.0 of pulseaudio there was a bug where the following would happen:
  1. You have either no sound output or music playing at 44.1kHz (default sample rate)
  2. You start obs, and the pulse plugin starts recording with 44.1kHz (it will use whatever pulse is using at that moment)
  3. Now another program outputs at 48kHz (e.g. Teamspeak) and pulse switches to 48kHz (alternate sample rate)
  4. pulseaudio now will send 48kHz data to obs (while it should continue to send (44.1kHz)
This might happen both ways resulting in a higher/lower pitched sound.

With newer versions of pulseaudio than 4.0 this is fixed, and pulse will internally resample to keep the sample rate for the recorded data the same.

If you experience problems when pulse is set at a fixed sample rate different from obs, or if you have a speaker layout different from stereo, that might actually be a bug in obs/pulse plugin. In both cases obs should resample/convert the data correctly.
 
Top