Karsten Schubotz wrote: > Hi all, > > Does someone have experience with microfone gain in sipXtapi? > I’ve made a sipXtapi compilation for Linux and made a connection between two > PC’s. > I used the sample programs PlaceCall and ReceiveCall. My microphone input has > two > channels, left and right. When I’m using the right channel the communication > is > acceptable, but by using the left channel the communication is too quiet. It > seams, > that sipXtapi amplify the right channel more than the left channel. So I > searched in > the source code and the only proper file I found for microphone gain was > “MpCodec.cpp”, but I couldn’t find that left and right inputs are intensified > differently. > By making voice recording outside of sipXtapi (using the Alsa program > “arecord”) > there was no different between left and right channel. > What could be the reason, why the two Mic channels are amplified differently? > Perhaps there is something I didn't consider so far. > Thank you very much for your help! > > Regards > Karsten > >
The place the microphone is read is in dmaTaskPosix.cpp. Also there, the input device is opened as a single channel using OSS at 8 Khz. It would appear that the OSS driver is selecting the left channel only when it opens the device in single channel mode. The reason the right channel works - but quietly - is probably because of audio leakage between channels either in the air or in the analogue section of the sound device. Opening at 8 Khz can be a problem as I just discovered. On my target system 8 Khz can be used but it only captures in 8 bit linear format. This is very low quality. I have had to intercept the opening, reading and writing code and replace it with code to work at 48 kHz 16 bit and then rate convert back to 8 Khz. Luckily the library is designed to do this by providing (undocumented) hooks sMpAudioDeviceInitFuncPtr, sMpAudioMicReadFuncPtr, sMpAudioSpeakerWriteFuncPtr which can be used to place your own functions in place of the default ones. Perhaps you can do a similar thing to work with both channels? I suggest to use ALSA as It has more control over latency. Jeremy _______________________________________________ sipxtapi-dev mailing list [email protected] List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/
