Audio distortion on SAM9263 (was 'Sound device access causing kernel crash on SAM9263')

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

 



Hi John,

sorry to hear you're still having problem with this, and thanks for
the detailed report. Though you said you've tried to make the test as
simple as possible to localize the problem, actually they're still too
far ahead for the area that we want to test. At this point I think we
can agree that the problematic area is the sound device, especially
recording, so lets concentrate our efforts there. Forget pjsua at this
stage, since it contains too many advanced stuffs. Lets use the
simpler tests/samples.

You said while ALSA is picked up, only /dev/dsp can be used. To
simplify things, can you just disable ALSA from the build?
Unfortunately we don't have the option in the configure script to
disable ALSA (someone sent a patch for this but I haven't included it
in the source, you can search list archive if you want), so the way to
disable it is to hide "alsa/version.h" from the include path so that
it can't be found by configure.

Sorry to hear that you resorted to use native build, that must be
painful (I can understand that, I used native build before when things
got desperate:). I may be wrong, but I don't think it makes any
difference especially since turned out you had the same result anyway,
so perhaps it's better to revert back to use cross build, to make the
experience less painful.

Now for the simpler tests that I mentioned above.

You said that playback with aplay works fine, but recording was not.
Did you record with pjsua, or recfile sample? I would prefer to test
recording with recfile sample since it's much simpler. Note that our
recfile sample by defaults opens the sound device @44.1Khz (hardcoded
in recfile.c), which is unnecessarily high, so you'll need to change
this down to a 8Khz.

Have you had any chance to use other recording utilities, to get
different opinion on this?

And last but definitely not least. Have you tried with our "premiere"
audio device testing tool, namely pjsystest? pjsystest is a good tool
to troubleshoot this (I was about to say it is the perfect tool, but
it wouldn't have been correct in this case, since it's using PJSUA-LIB
API so it's similar to pjsua. pjsystest is more for fine tuning the
audio device rather than for troubleshooting why it doesn't work), so
you MUST try it if you haven't. Instructions are in
http://trac.pjsip.org/repos/wiki/Testing_Audio_Device_with_pjsystest.
Once you run it several times with different parameters, just attach
the result file here on your next posts.

But I feel that the key to all of these is in the recording capability
of your device. Spend more time to experiment on this area to find
which recording parameters work (if it works at all!), and once we go
past that things should begin to work smoothly, fingers crossed!

Cheers
 Benny


On Mon, Dec 7, 2009 at 4:36 PM, John Martindale <jm at practicalcontrol.com> wrote:
> Hello again,
>
> Sorry to keep hassling the message board (thanks Benny and Nanang for your
> help so far), but I'm stumped and don't know how to proceed. I'm trying to
> get pjsip working on an AT91SAM9263-EK board (200MHz ARM core). I have the
> code compiled and running now, but the sound is quite distorted. Maybe some
> of this information will enable someone to give me the key insight that will
> make everything work... I hope so!!
>
> I'm using the Angstrom linux distribution obtained through OpenEmbedded
> (unstable branch) and am currently using kernel 2.6.30. The Pjsip I am using
> is the 1.5 release as seen on the pjsip home page. Things I know so far:
> 1) According to this thread
> (http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2007-December/000966.html)
> the target architecture can work!!! (I've tried the SCHED_RR trick, but to
> no avail)
> 2) The test results returned by mips-test indicate that I should be able to
> run on this architecture quite comfortably with the right parameters
> 3) According to configure log, it's picked up the alsa drivers OK (have
> installed alsa-dev package) but only /dev/dsp works in practice (seg-fault
> if I try to use any other devices)
> 4) aplay is only happy with stereo, 16KHz, S16_LE .wav files
> 5) .wav files play back nicely in pjsip
> 6) Tones get generated nicely in pjsip (samples/playsine works fine)
> 7) Connecting simplua to an Asterix pbx gives good one-way audio, but won't
> give 2-way audio - connecting to a single bi-directional port instead of one
> receive and one playback caused a seg fault.
>
>
> I've tried to distil down to the simplest test, so all I'm doing is opening
> pjsua, then doing 'cc 0 0'. If I understand right, this should be purely a
> test of media and conference bridge stuff and shouldn't care about any
> network considerations. I am also using native compilation at the moment to
> ensure there aren't any problems introduced by cross compilation settings.
> Unfortunately, whenever I try to record from pjsua I end up with an empty
> wav file - the sound distortion I'm hearing is a rapid clicking (5-10Hz, I'd
> say) which plays continuously over any other audio which is present.
>
> All tests done with 'pjsua --ec-tail 0 --playback-dev 3 --capture-dev 3
> --add-codec pcma --quality 3'
>
> + '' ?=> Distorted
> + '-- stereo' => Distorted
> + '--clock-rate 8000' => No audio
> + '--clock-rate 8000 --stereo' ?=> Distorted
> + '--clock-rate 16000' ?=> Distorted
> + '--clock-rate 16000 --stereo' => Distorted
> + '--clock-rate 8000 --snd-clock-rate 8000' => No audio
> + '--clock-rate 8000 --snd-clock-rate 8000 --stereo' => Distorted
> + '--clock-rate 16000 --snd-clock-rate 16000' => Distorted
> + '--clock-rate 16000 --snd-clock-rate 16000 --stereo' => Distorted
> + '--clock-rate 8000 --snd-clock-rate 16000' => Distorted
> + '--clock-rate 8000 --snd-clock-rate 16000 -- stereo' => Distorted
> + '--clock-rate 16000 --snd-clock-rate 8000' => No audio
> + '--clock-rate 16000 --snd-clock-rate 8000 --stereo' => Distorted
>
> I've attached a copy of my config_site.h file. Any help gratefully
> appreciated.
>
> Best Regards,
> John Martindale
>
> www.practicalcontrol.com
>
>
>
> _______________________________________________
> 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
>
>



-- 
Best regards,

 Benny



[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