[nas] [PATCH] consistent gain setting in voxware server
Jon Trulson
jon at radscan.com
Fri Jul 21 21:16:43 MDT 2006
On Fri, 21 Jul 2006, Erik Auerswald wrote:
> Hi,
>
> On Thu, Jul 20, 2006 at 06:06:41PM -0600, Jon Trulson wrote:
>> On Thu, 20 Jul 2006, Erik Auerswald wrote:
>>> On Wed, Jul 19, 2006 at 11:08:11PM -0600, Jon Trulson wrote:
>>>> On Thu, 20 Jul 2006, Erik Auerswald wrote:
>>>>> - On my system the wrong mixer parts are affected, i.e. the value of
>>>>> patching the line or mic input to output, but not the value used for
>>>>> recording (called 'IGain' by aumix). Selecting the input in aupanel
>>>>> (or audemo or ...) works insofar as the line resp. mic level is
>>>>> controlled, but the recording input selection is not done.
>>>>
>>>> Looking at setPhysicalInputGainAndLineMode(), it does appear
>>>> we try to set the hw gains. What also interesting is that line
>>>> and mic are mutually exclusive with respect to their gain
>>>> settings.
>>>
>>> These gain settings work on the wrong mixer parts for my hardware.
>>
>> hmm. so setting the mic with Igain, adjusts line in instead?
>
> No, the NAS server sets the Line and Mic values correctly. It does not
> set the IGain value at all. It does not choose the recording device. The
> Line and Mic values are not used for recording.
>
Right, I *think* I see your issue now (hard without trying it
myself :). I think we should first look at
igain/reclev... Then worry about device selection afterward.
Apparently when this code was first written (for GUS hw?) this
was not the case (ie, setting the MIXER_LINE/MIC was all that
was necc.). As mentioned earlier, I do not think many people
have dealt with NAS recording, so it's possible this code has
not been really used in many years.
> Using a local mixer application (aumix) I can change the IGain setting
> and select the recording source.
>
Using strace, what ioctl's is it using (or maybe the src code
itself will tell :) ? Pehaps auvoxware's mixer code needs some
serious updating?
[...]
>> Yes, looking at this, it seems that you have 2 possible hw
>> input devices, line and mic. One one can active at a time.
>
> Right.
>
Yeah, I do not understand why this limitation/assumption is
there, except maybe this was all that worked at the time this
was originally written.
>> Whatever input gain you've set is applied to the respective
>> device (via OSS ioctl). See setPhysicalInputGainAndLineMode()
>> in auvoxware to see where this is done.
>
> And this does not work the way it is intended with my hw/drivers.
> Presumably it did work back when it was implemented on that hw/drivers
> combination.
I wonder...
[...]
>> ioctl(mixerfd, MIXER_WRITE(SOUND_MIXER_MIC), &inputAttenuation);
>>
>> is not the right way on your hardware so set the MIC's input
>> gain?
>
> Indeed, that does not change the input gain (IGain) on my hardware.
>
See if your device supports MIXER_IGAIN or MIXER_RECLEV as in
my prev post... Maybe that is the key...
[...]
> I used aumix (http://jpj.net/~trevor/aumix.html) to do this...
>
> The above ioctl changes the Mic level on my hw. This level is used when
> amplifying the microphone input to the speakers. This is not used when
> recording from the mic input. MIXER_WRITE(SOUND_MIXER_LINE) works the
> same way with the Line value.
Yeah, and I would think with that mode, feedback would be an issue
with a mic... So you want to actually *decrease* the SOUND_MIXER_MIC
and increase IGAIN/RECLEV if you were recording from a mic for
instance... ?
(maybe I should go mic hunting, and see for myself :)
--
Jon Trulson
mailto:jon at radscan.com http://radscan.com/~jon
#include <std/disclaimer.h>
"No Kill I" -Horta
More information about the Nas
mailing list