View Issue Details

IDProjectCategoryView StatusLast Update
0000960OBS-Studiolibobspublic2019-03-04 11:53
ReporterOchi Assigned Topkv  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformOBS StudioOSAll Systems 
Product Version19.0.3 
Target Version23.1.0Fixed in Version23.1.0 
Summary0000960: Audio from mono input quieter than in other recording programs
DescriptionI could reproduce the following issue under Linux and Windows. I have switched from recording my mic using [insert some audio recording software like audacity or REAPER here] to recording it with OBS directly in order to synchronize it better with other audio and video inputs.

I'm using a USB sound card with mono input. I need to boost the sound captured using OBS by about 3 db to get about the same volume as in other audio recording software. Switching to mono mode in OBS is not a solution for me (if it helps at all, haven't tested it) by the way since I also need to record other stereo audio tracks.

Is it possible that the mono input is averaged with a silent track as if it was a stereo input with sound on only one channel or something the like?
TagsHas PR

Activities

Suslik V

2017-07-25 08:58

reporter   ~0002134

All channels averaged only if "Downmix to Mono" selected (main menu Edit>Advanced Audio Properties).

Ochi

2017-07-25 15:41

reporter   ~0002135

Last edited: 2017-07-25 15:42

View 2 revisions

Thanks for the reply. Downmixing is not in use, but it doesn't seem to make a difference regarding the issue either.

I noticed something else, at least under Linux, though: If I add a "Audio Input Capture (PulseAudio)" source in OBS, selecting the USB Audio Interface directly and then recording, I'm having the issue with the volume. If I select some other (stereo?) sound source in OBS and then switch the input independently from OBS (in pavucontrol in this case) to the USB Audio Device, the volume seems similar to the sound recorded in e.g. audacity.

If you have a sound card with a mono mic input, you can try to reproduce it fairly easily by recording in OBS and audacity simultaneously and comparing the results. Maybe it is an issue with my particular USB sound card, I don't know. My guess, however, is that OBS detects the difference in the number of channels between input and output and does something.

Can you maybe give me a hint where the averaging takes place in the code, if it does?

Ochi

2017-07-25 16:16

reporter   ~0002136

Last edited: 2017-07-25 17:03

View 3 revisions

Okay, I have taken a look at the code. It seems to be a fundamental thing how ffmpeg works. The downmixing option is not involved, but the resampling that happens in obs-source.c (also in audio-io.c, but this is not relevant for the recording, I think, but maybe for other things). In both cases it uses the resampling implemented in audio-resampler-ffmpeg.c.

Bottom line is that swr_convert, which is used in audio_resampler_resample(), seems to be the culprit. Given a 1-channel input and 2-channel output, it generates two quieter stereo streams. You can easily reproduce this using ffmpeg itself. Take a mono wav and do:

ffmpeg -i mono.wav -ac 2 stereo.wav

and compare them. I'm using ffmpeg 3.3.2 here. Now the question is, is this what we would expect swr_convert to do? Is this what we expect OBS to do?

EDIT: To be clear, I think that the way ffmpeg works makes sense depending on what you expect. If a mono signal would actually be output by only one speaker, then distributing the signal over all channels to get the same total power output after the conversion makes sense. However, it might be a counterintuitive result in case of OBS (at least I think so). I'm used to the fact that a mono signal is usually output on all channels/speakers by common audio recording and editing tools. Of course, the user could increase the recording volume in OBS in this particular case of mono input and stereo output, but I'm not sure whether this could potentially decrease the audio quality by first narrowing and then widening the dynamic range again. Also, I'm not sure whether this should be something the user needs to be taught to do in the particular case of a mono input and a stereo output.

Suslik V

2017-07-26 16:39

reporter   ~0002141

Don't know about mono input (I think it happens rarely), but stereo inputs with one muted channel is common behavior for OBS - because of mono mics connected to stereo line-in of the PC (usually for mic that require +48V and PC can do only +2.5...5V https://obsproject.com/forum/threads/downmix-to-mono-50.49865/#post-223380).
Anyway, I think implementation of the option to increase volume of the audio source (by doubling channels) should be switchable option, to be able to make it ON/OFF for selected inputs only.

Ochi

2017-07-26 20:57

reporter   ~0002142

Last edited: 2017-07-26 21:03

View 3 revisions

For my use case, it would even be beneficial to be able to choose whether to record in mono or stereo separately for each audio track. I'm recording stereo game sound on one track and the mono mic on a second track. Therefore it would even be more efficient to just have the mic track be a mono track if that's possible (I'm using Matroska as the container format).

In fact, this is probably what the "Downmix to Mono" option could already be doing. If I'm not mistaken, what it actually does is "average all channels of the input and put the result on a stereo track". So maybe it would make sense to create the audio track as a 1-channel track, in case the Downmix option is selected for a particular audio track?

Suslik V

2017-07-27 05:01

reporter   ~0002143

Last edited: 2018-09-09 15:54

View 2 revisions

"Downmix to Mono" just bad wording of the option. Something like "Downmix to Planar Sound" is better, I think. It is required and should exist.

Edit:
cross-link the post here
https://obsproject.com/forum/threads/please-allow-for-mono-recording-of-microphones-ill-explain-why.84834/page-2#post-372717
(It is about FFmpeg processing and default stereo panning option, -3dB)

pkv

2019-02-24 13:03

developer   ~0004069

PR here: https://github.com/obsproject/obs-studio/pull/1686

Issue History

Date Modified Username Field Change
2017-07-24 17:30 Ochi New Issue
2017-07-25 08:58 Suslik V Note Added: 0002134
2017-07-25 15:41 Ochi Note Added: 0002135
2017-07-25 15:42 Ochi Note Edited: 0002135 View Revisions
2017-07-25 16:16 Ochi Note Added: 0002136
2017-07-25 16:17 Ochi Note Edited: 0002136 View Revisions
2017-07-25 17:03 Ochi Note Edited: 0002136 View Revisions
2017-07-26 16:39 Suslik V Note Added: 0002141
2017-07-26 20:57 Ochi Note Added: 0002142
2017-07-26 21:03 Ochi Note Edited: 0002142 View Revisions
2017-07-26 21:03 Ochi Note Edited: 0002142 View Revisions
2017-07-27 05:01 Suslik V Note Added: 0002143
2018-09-09 15:54 Suslik V Note Edited: 0002143 View Revisions
2019-02-24 02:00 Fenrir Assigned To => pkv
2019-02-24 02:00 Fenrir Status new => assigned
2019-02-24 13:03 pkv Note Added: 0004069
2019-02-24 13:03 pkv Tag Attached: Has PR
2019-03-04 11:53 pkv Status assigned => resolved
2019-03-04 11:53 pkv Resolution open => fixed
2019-03-04 11:53 pkv Fixed in Version => 23.1.0
2019-03-04 11:53 pkv Target Version => 23.1.0