easyeffects icon indicating copy to clipboard operation
easyeffects copied to clipboard

[Feature request] mono input devices

Open brndd opened this issue 2 years ago • 13 comments

My microphone input is mono, but EasyEffects appears to treat it as stereo where only the left channel has audio on it. I use the Stereo Tools plugin to turn it into "mono" (with the LR > LL channel mapping), but I think it would be nice if I did not have to do this and the whole thing was mono from start to finish.

brndd avatar Jan 04 '22 11:01 brndd

but I think it would be nice if I did not have to do this and the whole thing was mono from start to finish.

It is not possible to use mono. Almost all of the plugins available in EasyEffects require 2 channels to work. Nothing more nothing less. So in your case upmixing to stereo has to be done. And inserting the Stereo Tools plugin in the pipeline is the easiest and more flexible way of doing that.

wwmm avatar Jan 04 '22 16:01 wwmm

I see. What about a plugin that could be placed at the end of the filter chain to downmix to mono (real mono, instead of stereo with both channels having the same signal)? Or perhaps a setting that accomplishes the same thing? Or perhaps upmixing mono to stereo could be a little smarter than it currently is so the LR > LL mapping would be automatically done, because I don't see many situations where you wouldn't want to do that.

Currently without the Stereo Tools plugin mono microphone inputs will turn into a stereo input with audio on only one channel. This will typically result in VoIP applications and other things expecting a mono input to downmix the signal to mono, and because the right channel is silent the volume of the signal ends up being about 6 dB quieter due to an application of pan law. This used to confuse me a lot before I figured out what's going on!

brndd avatar Jan 05 '22 09:01 brndd

What about a plugin that could be placed at the end of the filter chain to downmix to mono (real mono, instead of stereo with both channels having the same signal)? Or perhaps a setting that accomplishes the same thing? Or perhaps upmixing mono to stereo could be a little smarter than it currently is so the LR > LL mapping would be automatically done, because I don't see many situations where you wouldn't want to do that.

Unfortunately it is not easy to handle that in a generic way without complicating even more our pipeline

  • There are microphones that are exposed by the driver as a stereo device even if in reality they have hardware capable of capturing only one channel. I have 2 like this. Putting by default an downmixing to mono does not make sense. So we would need to insert or remove such a plugin depending on the situation. But the weirder case is the one below.
  • In one of my computers the onboard card jack for the microphone is exposed as a stereo device. But for some reason only one of the channels has audio. So this is a case where we have a device with 2 channels in its output but audio only in one of them. It is not doable to automate a case like this. User intervention is necessary.
  • There are microphones that are actually capable of capturing stereo audio
  • And then there are cases like yours. I would not be surprised if there are more

I still see manual user intervention through the Stereo Tools plugin as the more consistent solution. There is no guarantee at all that LR > LL is the mapping that has to be done.

wwmm avatar Jan 05 '22 14:01 wwmm

real mono, instead of stereo with both channels having the same signal

That is also not doable without a lot of complications. It is not possible to change the number of channels of a virtual source on the fly. So we have to create it with 2 channels for the cases where 2 channels are needed.

wwmm avatar Jan 05 '22 14:01 wwmm

I think automatic upmixing of a mono input into a stereo device where both channels have the same audio should be possible at least, no? It's not hugely important because using the Stereo Tools plugin for this is quite easy, but it might still be a nice-to-have.

As for the other cases you mention, those indeed aren't something EasyEffects should have to deal with. Cases like a physical mono input showing up as a stereo device would ideally be fixed with eg. ALSA UCM profiles for the device. There are quite a lot of devices like this around, including my USB interface which I've manually configured (using a UCM profile, and before that with PipeWire virtual devices) so that the input is actually mono as it should be.

brndd avatar Jan 05 '22 15:01 brndd

I think automatic upmixing of a mono input into a stereo device where both channels have the same audio should be possible at least, no?

It is doable. Probably better to write a filter only for this instead of trying to use the Stereo Tools plugin in this task because I would like to avoid messing with plugins settings in the place where the pipeline is being handled. What I am not sure is if the LR > LL should be the mode.

wwmm avatar Jan 05 '22 16:01 wwmm

Many players convert mono to two channels

servimo avatar Jan 05 '22 17:01 servimo

What I am not sure is if the LR > LL should be the mode.

Well, since it's mono to stereo it would be M > MM, right? Currently it's M > M0 or something like that.

I don't know if it even needs a filter or if it could be done in virtual device configuration; I don't know how the virtual device is created, but in PipeWire configuration files one would do this by specifying audio.position = [FL, FL] or something along those lines.

brndd avatar Jan 06 '22 04:01 brndd

Well, since it's mono to stereo it would be M > MM, right? Currently it's M > M0 or something like that.

In this particular case it can be just that. In other situations where the intention is creating a stereo signal that "looks like a real stereo" the mono signal processing may be more elaborated than just replicating one of the channels.

I don't know if it even needs a filter or if it could be done in virtual device configuration; I don't know how the virtual device is created, but in PipeWire configuration files one would do this by specifying audio.position = [FL, FL] or something along those lines.

This virtual device in PipeWire's wiki is different. It is a loopback device. Our devices are a null sink and they are created in a very different way. And do not have upmix or downmix built-in. Loopback devices are not a good fit for us because they are based on audio streams.

wwmm avatar Jan 06 '22 04:01 wwmm

I made the adjustment and increased the sound by 6.5db to compensate for the loss of sound, it worked fine image

JumperLuko avatar Jan 09 '22 15:01 JumperLuko

@JumperLuko instead of increasing the volume, click on the "Stereo Matrix" tab in the plugin and set it to LR > LL (Mono Left Channel).

brndd avatar Jan 09 '22 20:01 brndd

I also had to add a Stereo Tools plugin to get my mono mic to output on both channels. What I don't understand is, how is KDE able to see that my Unitek Y-247A device is actually mono, but EasyEffects is not? Compare with the "C920 HD" device which is stereo:

Screenshot_20230511_140547

I am a complete Linux audio noob so I have no clue if this has to do with PulseAudio, PipeWire or anything else. I'm mostly curious about how this seemingly works well in some apps but not others.

rolodato avatar May 11 '23 17:05 rolodato

What I don't understand is, how is KDE able to see that my Unitek Y-247A device is actually mono, but EasyEffects is not?

It is not that it "can not see that is mono". At this moment the function that links the microphone to the plugins is the same that does all the other links required by the plugins. And as our plugins are all stereo and it does not make sense to link an input channel to more than one output channel the mic channel is linked only to the left channel of the plugin located after it.

Our function has to be extended to handle mics in a way that does not break the other links it has to do. It is not a problem in PipeWire.

wwmm avatar May 11 '23 18:05 wwmm