The rate of Recording and Playing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you, nanaing. The problem can be solved by adding --stereo param.

For the people who want to use pjsip on Davinci, you should add
following param in your config file for better audio quality.
 --stereo
--ec-tail=0
--add-codec pcmu
--dis-codec speex
--dis-codec ilbc
--dis-codec GSM
--dis-codec G722
--clock-rate=8000
--snd-clock-rate=8000

Here is the remaining results of the tests you mentioned.
- In Davinci, 'short' is 16 bits
- sndtest output the duration is 11s
- playing a 8kHz file on Davinci is centain faster than x86

Best Regards,
Fan-Cheng Wu



2008/10/10 Nanang Izzuddin <nanang at pjsip.org>:
> Hi,
>
> Just an opinion, those tests show that PJSUA on Davinci records more
> samples than it is supposed to, and also plays more samples than it is
> supposed to (test #1 - #4 involved only Davinci where record & play
> are sync'd, thus they are fine, while test #5 & #6 involved other
> machine). Or it is just an impression caused by inaccurate pjlib data
> types definitions for Davinci (e.g: 'pj_int16_t' is defined as
> 'short', while 'short' in Davinci may be 32 bit length instead of 16
> bit).
>
> So, I think more tests are needed before conclude something here, e.g:
> - sndtest (in pjsip-apps/src/samples directory), check if the duration
> printed by sndtest is about twice longer (e.g by default sndtest
> duration is 10s, the output duration should be around 10s too).
> - play a correct 8KHz wav file on Davinci's PJSUA, check if it is played faster.
> - run pjsua in stereo mode 8KHz, do a recording, it will result a
> stereo 8KHz file, play that recorded file as mono 8KHz.
>
> Regards,
> nanang
>
>
> 2008/10/10 Fan-Cheng Wu ?????\ <fcwu.cs95g at nctu.edu.tw>:
>> Hi,
>>
>> I upload two wav files to explain my problem.
>> The file recorded by this
>> way(http://trac.pjsip.org/repos/wiki/audio-how-to-record) could be
>> found here http://moon.cse.yzu.edu.tw/~s912356/output_people_8000.wav.
>> It sound slow and low pitch. The correct one should sound like this
>> http://moon.cse.yzu.edu.tw/~s912356/output_people_16000.wav.
>>
>> I made following testings to clarify my problem.
>> 1. "cat /dev/dsp > file", and then "cat file > /dev/dsp" => Correct
>> 2. Record and Play audio by portaudio(testing src is
>> third_party/portaudio/test/patest_record.c) => Correct
>> 3. PJSUA Looping-back
>> testing(http://trac.pjsip.org/repos/wiki/audio-check-loopback) =>
>> Correct
>> 4. Record any audio either from file or mic by PJSUA, and Play them on
>> Davinci by PJSUA and sample/playfile => Correct
>> 5. Record any audio either from file or mic by PJSUA, and Play them on
>> my PC by mplayer => Slow and low pitch. It would be correct if playing
>> it with double rate, saying 16000Hz.
>> 6. VoIP between PJSUA on Davinci and PJSUA on Linux. => Slow and low pitch.
>>
>> So I infer the problem is triggered by pjsip. How can I dig out them in pjsip?
>>
>>
>>
>> FCWu
>>
>>
>>
>> 2008/10/10 Nanang Izzuddin <nanang at pjsip.org>:
>>> Hi,
>>>
>>> Not sure what's going on, but I agree it seems to be a sound device
>>> issue, e.g: it may be actually opened in either stereo or 16KHz. I
>>> found this old post that may be related to this issue:
>>> http://mlblog.osdir.com/linux.davinci/2006-10/msg00283.shtml, as it
>>> says "Davinci OSS driver don't work correctly in mono mode and driver
>>> still return two samples per tick". Perhaps you can check this by
>>> running pjsua in stereo mode (with param '--stereo') and see the mic
>>> recording result. Then you can also check pjsua with clock rate 16KHz.
>>>
>>> In case it *is* sound device issue, you can also search/post a
>>> question in the PortAudio forum (PJSIP uses PortAudio on linux
>>> platform). Moreover, you can implement your own sound device wrapper,
>>> please see http://trac.pjsip.org/repos/wiki/External_Sound_Device for
>>> the build config.
>>>
>>> Regards,
>>> nanang
>>>
>>>
>>> On Thu, Oct 9, 2008 at 1:25 PM, Fan-Cheng Wu ?????\ <fcwu.cs95g at nctu.edu.tw> wrote:
>>>> Hi All,
>>>>
>>>> I experienced pjsua on TI Davinci, which configured ./aconfigure
>>>> --host=armv5tl-montavista-linuxeabi CFLAGS='-O2 -msoft-float -DNDEBUG
>>>> -mcpu=arm926ej-s' --disable-floating-point and defined "#define
>>>> PJSUA_DEFAULT_CLOCK_RATE   (8000)" on config_site.h.
>>>> When I run pjsua to record sound of 10 second from mic to a file, the
>>>> file would be extended to 20 second long and sound lower pitch than
>>>> original one. (Play it with double rate, it sound fine.) I suppose
>>>> it's because recording device has wrong recording rate. Anybody knows
>>>> how can I adjust it?
>>>>
>>>> p.s. If I recorded a default ring sound from port 02 (Port #02[
>>>> 8KHz/20ms/1] ring transmitting to: ), it's also correct. So the
>>>> problem come from recording device (?).
>>>>
>>>> The following are the steps I recorded sound from mic.
>>>> ./pjsua-armv5tl-montavista-linux-gnueabi --rec-file=output.wav
>>>> --clock-rate=8000 --snd-clock-rate=8000
>>>> ...
>>>>>>> cc 0 1
>>>>  07:49:01.566  pjsua_media.c  pjsua_set_snd_dev(): attempting to open
>>>> devices @8000 Hz
>>>>  07:49:01.758     ec0x150df8  AEC created, clock_rate=8000, channel=1,
>>>> samples per frame=160, tail length=200 ms, latency=96 ms
>>>>  07:49:01.759   conference.c  Port 3 (ring) transmitting to port 1 (output.wav)
>>>>
>>>>
>>>>
>>>> Best Regards,
>>>> FCWu
>>>>
>>>> _______________________________________________
>>>> Visit our blog: http://blog.pjsip.org
>>>>
>>>> pjsip mailing list
>>>> pjsip at lists.pjsip.org
>>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>>>
>>>
>>> _______________________________________________
>>> Visit our blog: http://blog.pjsip.org
>>>
>>> pjsip mailing list
>>> pjsip at lists.pjsip.org
>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>>
>>>
>>
>> _______________________________________________
>> Visit our blog: http://blog.pjsip.org
>>
>> pjsip mailing list
>> pjsip at lists.pjsip.org
>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>
>>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux