[Asterisk-Users] OH323 Channel Driver buffer sizes

Niclas Gustafsson niclas.gustafsson at codesense.com
Fri May 9 06:11:32 MST 2003


Hello!

Anyone with some insight into the oh323 channel driver please shed 
some light on the code block below from wrapendpoint.cxx.

When enabling trace on the channel driver i get this, for me, strange
debug info:

WrapH323EndPoint::OpenAudioChannel: Direction => PLAYER, Buffer => 320
WrapH323EndPoint::OpenAudioChannel: FrameSize 8, FrameTime 8, TimeUnits
8
WrapH323EndPoint::OpenAudioChannel: Frame 1
WrapH323EndPoint::OpenAudioChannel: LID Codec G.711-uLaw-64k
WrapH323EndPoint::OpenAudioChannel: The sound channel is
audiosocket:out1(fd=41)
WrapH323EndPoint::OpenAudioChannel: The audio device name is
audiosocket:out1
PAsteriskSoundChannel::Open: os_handle 41, mediaFormat 0, frameTime 1
WrapH323EndPoint::OpenAudioChannel: Opened sound channel
"audiosocket:out1" for playing using 1x8 byte buffers.
WrapH323EndPoint::OnStartLogicalChannel: Started logical channel [27258]
: receiving G.711-uLaw-64k{hw}
WrapH323EndPoint::OnStartLogicalChannel: RxFrames = 20
WrapH323EndPoint::OnStartLogicalChannel: channelsOpen = 1
WrapH323EndPoint::OpenAudioChannel: Direction => RECODER, Buffer => 320
WrapH323EndPoint::OpenAudioChannel: FrameSize 8, FrameTime 8, TimeUnits
8
WrapH323EndPoint::OpenAudioChannel: Frames 20
WrapH323EndPoint::OpenAudioChannel: LID Codec G.711-uLaw-64k
WrapH323EndPoint::OpenAudioChannel: The sound channel is
audiosocket:in1(fd=43)
WrapH323EndPoint::OpenAudioChannel: The audio device name is
audiosocket:in1
PAsteriskSoundChannel::Open: os_handle 43, mediaFormat 0, frameTime 1
WrapH323EndPoint::OpenAudioChannel: Opened sound channel
"audiosocket:in1" for recording using 1x160 byte buffers.

How come the buffers are of different size? Is this a good thing?
Recording 
to 160 bytes and playing to 8 bytes buffers.... When looking into the
code, 
it looks to me as if there has been some trial and error approach? 

(WrapH323EndPoint::OpenAudioChannel)

                /************

                bufSize = GetFrames(mediaFormat) *
mediaFormat.GetFrameSize();

                **********/
                if (dir == RECORDER) {
                        bufSize = GetFrames(mediaFormat) *
mediaFormat.GetFrameSize();
                        WRAPTRACE(5, "Frames " <<
GetFrames(mediaFormat));
                } else {
                /*************

                        if ((mediaType == RTP_DataFrame::PCMU) ||
(mediaType == RTP_DataFrame::PCMA)) {

                                bufSize = bufferSize;

                        } else {

                ***********/
                                bufSize = mediaFormat.GetFrameSize();
                                WRAPTRACE(5, "Frame 1");
                /************

                        }

                ***********/

Shouldn't the buffers be of equal size?
I'm quite new to this code so please correct me if i'm wrong, 

Ah, and yes, the reason i'm digging in the code is to get my fax to
work! ;) It worked fine
with the config CiscoGW -> GnuGK -> ATA186 -> Fax, but now it does not
and I get comm error 
on the display. My config now looks like CiscoGW -> GnuGK -> Asterisk ->
ATA186 -> Fax. Any 
ideas anyone, i've disable the silence suppression and disabled the CED
tone detection as
per Cisco "Using FAX Mode" in their Administrators Guide for the ATA186.

Regards,
Niclas Gustafsson






More information about the asterisk-users mailing list