ssr icon indicating copy to clipboard operation
ssr copied to clipboard

Record only mono audio (with ability for stereo downmix, left only, or right only) [feature-request]

Open ceefour opened this issue 10 years ago • 15 comments

Thank you for SimpleScreenRecorder, awesome software! :)

My notebook's internal sound card has "Stereo Input", however when connecting a mic, only the left channel has sound. This generates a video with audio panned to the left.

Please make an option to choose audio/sound recording mode:

  1. Stereo (default)
  2. Mono: downmix from stereo
  3. Mono: Left only
  4. Mono: Right only

A bit related to #310.

ceefour avatar Mar 27 '15 10:03 ceefour

AFAIK there is no option for 'left only mono' in ALSA - mono just means mono. What I can do is record in stereo and throw away one of the channels. Or I can record in mono and let ALSA do the downmixing automatically (but then I can't pick a channel).

This sounds like a strange setup, are you sure that your microphone is working properly? I know there are mono microphones that use one of the channels to provide a supply voltage and send a signal on the other channel, but if your laptop isn't providing a supply voltage then this wouldn't work anyway. And if your laptop is providing the supply, then it must somehow realize that the microphone is mono and shouldn't be recording both channels in the first place ...

This sounds like a very niche problem, I don't want to clutter the GUI with options that 99% of all users won't need. But I could add some kind of custom option for this once the new GUI is ready.

Anyway, here's a temporary workaround. Create a file named '.asoundrc' in your home folder with this content:

pcm.monomic {
    type plug
    slave {
        pcm "sysdefault:0"
        channels 1
    }
    hint {
        description "Mono microphone"
    }
}

Now restart SSR and select 'Mono microphone'. ALSA will downmix (i.e. average left and right) which is not what you want, but it's probably better than stereo.

MaartenBaert avatar Mar 28 '15 00:03 MaartenBaert

or you could follow the arch pulseaudio wiki for getting pulseaudio to correctly map audio to both left and right or what have you. a lot of higher end mics do the same to people in skype in linux so there's a workaround to get pulseaudio or alsa (i forget) so that it maps the audio to both left and right. good luck

ubuntuaddicted avatar Mar 28 '15 07:03 ubuntuaddicted

Thank you.. this is an awesome workaround ^_^

I dont know the external mic works this way. Internal mic is fine. Line input is also fine... it's stereo.

But when I connect my mic it's just the left signal. same when in Audacity. But in Audacity I can just set input to mono and leave it at that (it's probably downmixing, but it's okay for me)

ceefour avatar Mar 28 '15 09:03 ceefour

I have a mono external mic and have the same results. I would suggest the GUI option is required for mic users. The work around works fine. Thanks for this app! :)

gwald avatar Feb 23 '16 23:02 gwald

That is normal behavior for mono mic. The pulse audio and jack do the same for mono mics: all sound is on the left channel, the right channel is empty. Therefore the program option to record mono mic is very needed. Many programs even do autodetection for mono mics.

romikforest avatar May 06 '16 11:05 romikforest

+1...really needed

quantverse avatar Dec 20 '16 11:12 quantverse

OK, I've found a workaround to record left channel only as mono just using PulseAudio. It took me about two hours just to find this information and apply it correctly. So let's hope it will save you some time guys. First, find out your input source name using:

pacmd list-sources

My source name is alsa_input.usb-M-Audio_FastTrack_Pro-00-Pro.analog-stereo-a-input Then edit file /etc/pulse/default.pa, and add these lines (replace the PUT_YOUR_SOURCE_NAME_HERE with your real source name!!!):

### Remap microphone to mono
load-module module-remap-source master=PUT_YOUR_SOURCE_NAME_HERE master_channel_map=front-left channel_map=mono

Restart the daemon:

pulseaudio -k

It will create a new virtual source called in my case Remapped M-Audio Fast Track Pro Analog Stereo Channel A, use this one for recording...

quantverse avatar Dec 20 '16 12:12 quantverse

I've compiled the latest version and this trick doesn't work :( Any advice?

gwald avatar Jan 06 '17 00:01 gwald

Hey everybody another workaround. Turn the video into mono video after the fact using ffmpeg

Run this command on the video to turn it into audio:

ffmpeg -i video.mp4 -map_channel 0.1.0 -c:v copy mono.mp4

More info here: https://superuser.com/a/1122114/446344

turbobuilt avatar Jun 26 '17 02:06 turbobuilt

OK, I've found a workaround to record left channel only as mono just using PulseAudio. It took me about two hours just to find this information and apply it correctly. So let's hope it will save you some time guys. First, find out your input source name using:

pacmd list-sources

My source name is alsa_input.usb-M-Audio_FastTrack_Pro-00-Pro.analog-stereo-a-input Then edit file /etc/pulse/default.pa, and add these lines (replace the PUT_YOUR_SOURCE_NAME_HERE with your real source name!!!):

### Remap microphone to mono
load-module module-remap-source master=PUT_YOUR_SOURCE_NAME_HERE master_channel_map=front-left channel_map=mono

Restart the daemon:

pulseaudio -k

It will create a new virtual source called in my case Remapped M-Audio Fast Track Pro Analog Stereo Channel A, use this one for recording...

This solution worked for me, thanks a lot

roycechua avatar Apr 24 '20 10:04 roycechua

Another solution for ALSA users is to add this to your ~/.asoundrc file:

pcm.micleft {
	type plug
	slave.pcm "hw:1"
	slave.format "unchanged"
	slave.rate "unchanged"
	slave.channels 2
	ttable.0.0 1.0
	ttable.0.1 0.0
	ttable.1.0 1.0
	ttable.1.1 0.0
	hint.description "Microphone (left only)"
}

Then select [micleft] in SSR. Rather than downmixing to mono, this will duplicate the sound of the left channel to both channels. Change hw:1 to your sound card of choice. If you need to record with multiple applications simultaneously, use sysdefault:1 instead of hw:1.

If you want the same for the right channel, use this:

pcm.micright {
	type plug
	slave.pcm "hw:1"
	slave.format "unchanged"
	slave.rate "unchanged"
	slave.channels 2
	ttable.0.0 0.0
	ttable.0.1 1.0
	ttable.1.0 0.0
	ttable.1.1 1.0
	hint.description "Microphone (right only)"
}

MaartenBaert avatar May 02 '20 00:05 MaartenBaert

WRT, how can I record stereo on a MIC? I am getting a MONO channel/sound on my LEFT earphone and a very faint sound on the right.. I want STEREO. (asked everywhere no luck) I've plugged the MIC into the pink desktop socket - i can record mono just fine - I want stereo. What should I do in pulseaudio - what module to clone my mic-source and then? Active Port: analog-input-rear-mic Volume: front-left: 65540 / 100% / 0.00 dB, front-right: 65540 / 100% / 0.00 dB balance 0.00 Base Volume: 6554 / 10% / -60.00 dB

module-remap-source master=alsa_input.pci-0000_00_1f.3.analog-stereo

Veek avatar May 29 '20 13:05 Veek

Most microphones are mono. If you want stereo you either need a special stereo microphone or you need two mono microphones that you manually set up on the left and right side.

MaartenBaert avatar May 29 '20 14:05 MaartenBaert

OK, I've found a workaround to record left channel only as mono just using PulseAudio. It took me about two hours just to find this information and apply it correctly. So let's hope it will save you some time guys. First, find out your input source name using:

pacmd list-sources

My source name is alsa_input.usb-M-Audio_FastTrack_Pro-00-Pro.analog-stereo-a-input Then edit file /etc/pulse/default.pa, and add these lines (replace the PUT_YOUR_SOURCE_NAME_HERE with your real source name!!!):

### Remap microphone to mono
load-module module-remap-source master=PUT_YOUR_SOURCE_NAME_HERE master_channel_map=front-left channel_map=mono

Restart the daemon:

pulseaudio -k

It will create a new virtual source called in my case Remapped M-Audio Fast Track Pro Analog Stereo Channel A, use this one for recording...

On mine first this didn't work, since on mine the sound only on my right speaker, then I change master_channel_map to front-right and it works. Complete line below.

load-module module-remap-source master=PUT_YOUR_SOURCE_NAME_HERE master_channel_map=front-right channel_map=mono

sonyarianto avatar Jun 10 '20 20:06 sonyarianto

Hey guys! When I try the solution I get the following message: load-module: command not found How can I solve this? I am a begginer

HeritonBacelar avatar Mar 29 '24 20:03 HeritonBacelar