FAQ: AD73322 driver status in newer kernels ? (2010-09-10)

Document created by Aaronwu Employee on Aug 28, 2013Last modified by sonic on Sep 8, 2013
Version 2Show Document
  • View in full screen mode

2010-09-10 09:03:30     AD73322 driver status in newer kernels ?

Olivier STOCK (FRANCE)

Message: 93333   

 

Hi,

 

We have started a design with the AD73322 ALSA driver of the kernel using uClinux-dist-2009R1.1-RC4. We use it in chained-device configuration.

 

Yesterday we have downloaded SVN version of uClinux in order to have newer version of the softwares (Linphone, Speex, ...)

 

The problem is that the snd-ad73322 driver has disappeared in the last kernels (2.6.34). (The newer kernels use ASOC architecture ...).

 

 

Questions :

-> Are you going to port snd-ad73322 driver to the newer ALSA SOC architecture ?

 

-> If no, can you give us some clues/templates about creating a multi-device chained sound card (like it was in snd-ad73322 driver which enable us to have up to 8 in/out _separate_ pcm)

 

(note : we looked at the 73311 ASOC driver for reference but it seems difficult to enhance it to support device chaining)

 

Many thanks,

Xavier

QuoteReplyEditDelete

 

 

2010-09-10 12:55:04     Re: AD73322 driver status in newer kernels ?

Mike Frysinger (UNITED STATES)

Message: 93341   

 

the old driver still exists.  it is now a separate patch you have to apply yourself:

uclinux-dist/bfin_patch/ad73322_patch/

QuoteReplyEditDelete

 

 

2010-09-12 23:57:05     Re: AD73322 driver status in newer kernels ?

Sonic Zhang (CHINA)

Message: 93371   

 

We won't switch the ad73322 driver to ASOC framework untill the multi sound ASOC enhancement is merged into mainline.

 

So, just apply the external ad73322 patch in uClinux-dist/bfin_patch/.

QuoteReplyEditDelete

 

 

2010-09-13 13:03:20     Re: AD73322 driver status in newer kernels ?

Olivier STOCK (FRANCE)

Message: 93385   

 

Thants for your answer.

 

 

 

We have applied the patch (unmodified) and tried the driver, but it seems to have a channel attribution problem  :

 

 

 

-> when we try to play a file while recording, it plays the sound on a random output.

 

(looking with a scope show us the 8 frame sync pulse burst at 8kHz rate on one trace. On the other trace, we see the SPORT out audio data randomly dispatched over the 8 frame sync (eg : it plays on channel 0, next play on channel 3, and so on ...))

 

 

 

-> how to reproduce :

 

start arecord : arecord -D plughw:0,6 -d 30 -f S16_LE -c 1 -r 8000 -t wav /root/test.wav

 

then try to play a short sound several times : aplay -D plughw:0,0 ringback.wav

 

 

 

Our current configuration :

 

one AD73322 connected on SPORT0, (CS on PF10 & RESET on PF14)

 

kernel rev 9120 (2010BETA1) / uclinux rev 9806 (2010BETA1)

 

 

 

Note : there is no such problem with the 2009R1.1 AD73322 driver (just tested once again with the same hardware)

 

 

 

Regards,

 

Xavier

QuoteReplyEditDelete

 

 

2010-09-13 23:04:48     Re: AD73322 driver status in newer kernels ?

Bob Liu (CHINA)

Message: 93392   

 

Hi, Xavier

 

Could you please test this patch? Thanks.

 

diff linux-2.6.x/sound/blackfin/ad73322.c

 

--     sport_set_multichannel(sport, 1, 0x1F,1);

++     sport_set_multichannel(sport, 1, 0x1,1);

QuoteReplyEditDelete

 

 

2010-09-14 04:43:54     Re: AD73322 driver status in newer kernels ?

Olivier STOCK (FRANCE)

Message: 93414   

 

Hi Bob,

 

 

 

We have just tested your patch ; however it doesn't work : the behaviour is the same as before.

 

 

 

Regards,

 

Xavier

QuoteReplyEditDelete

 

 

2010-09-14 10:45:55     Re: AD73322 driver status in newer kernels ?

Olivier STOCK (FRANCE)

Message: 93431   

 

Hi again,

 

 

 

We have noticed something strange though if it may help :

 

the sport_set_multichannel( , int tdm_count, , ) function (bf5xx-sport.c), always return with the error EINVAL because the "if (tdm_count & 0x7)" test is true, tdm_count value is 1.

 

As this test is done at the beginning of the function, there is nothing done regarding the multi-channel initialisation (ie, the parameter you suggested to change in your patch is never used)

 

Regards,

 

Xavier

QuoteReplyEditDelete

 

 

2010-09-15 06:40:47     Re: AD73322 driver status in newer kernels ?

Bob Liu (CHINA)

Message: 93464   

 

I looked at the code, the sport_set_multichannel() function have no effect the same as the old patch.

 

I try to reproduce your problem using:

 

arecord : arecord -D plughw:0,6 -d 30 -f S16_LE -c 1 -r 8000 -t wav /root/test.wav

 

and play a short sound several times : aplay -D plughw:0,0 ringback.wav

 

But I have no way to look at the frame sync now, is the sound heared correctly?

 

Thanks.

QuoteReplyEditDelete

 

 

2010-09-15 08:11:47     Re: AD73322 driver status in newer kernels ?

Olivier STOCK (FRANCE)

Message: 93466   

 

Hi Bob,

 

Yes, sound heared is correct when it is (by chance) played on the channel wired onto speaker. As we have only one

 

AD73322 (for now) in the chain we can not hear sound when it is played on other channels, but on scope it seems to be OK.

 

Attached picture show what's happening when the audio is played on wrong channel ( expected on channel 0 as aplay command state it )

 

We are not sure to understand wether you are able to reproduce the problem or no with you tests ?

 

Regards,

 

Xavier

 

 

scan_sport_TDM.JPG

QuoteReplyEditDelete

 

 

2010-09-16 04:54:55     Re: AD73322 driver status in newer kernels ?

Bob Liu (CHINA)

Message: 93502   

 

I can reproduce your problem by just using aplay serveral times no matter about arecord.

 

Thanks for your information. I think is the new sport's driver 's problem.

 

I will debug it these days.

QuoteReplyEditDelete

 

 

2010-09-18 23:57:24     Re: AD73322 driver status in newer kernels ?

Bob Liu (CHINA)

Message: 93614   

 

Hi, Xavier

 

Would you please check whether just using aplay can repeat this issue? (don't use arecord).

 

And I think the the old patch have the problem also could you double check it ?

 

Thanks a lot.

QuoteReplyEditDelete

 

 

2010-09-20 12:31:28     Re: AD73322 driver status in newer kernels ?

Olivier STOCK (FRANCE)

Message: 93635   

 

Hi,

 

1) We will double check with aplay alone, but we are quite sure you are right.

 

2) What do you exactly mean by "old patch" (the standard driver of 2009R1.1-RC4 or something related to 2010Beta (if so, tell us where to find it)).

 

Note: we have never seen the problem with 2009R1.1-RC4.

 

Regards, Xavier.

QuoteReplyEditDelete

 

 

2010-09-24 12:14:17     Re: AD73322 driver status in newer kernels ?

Olivier STOCK (FRANCE)

Message: 93825   

 

Hi, Xavier

 

Would you please check whether just using aplay can repeat this issue? (don't use arecord).

 

And I think the the old patch have the problem also could you double check it ?

 

Thanks a lot.

 

---

 

Hi Bob,

 

 

 

I have just checked again: I am unable to repeat the issue without launching arecord (tested a lot of time, both with 2009R1.1 and 2010Beta)

 

(The problem still occurs with 2010Beta _only_ when launching arecord + aplay)

 

 

 

Thanks for your help,

 

Xavier

QuoteReplyEditDelete

 

 

2010-09-27 03:21:33     Re: AD73322 driver status in newer kernels ?

Bob Liu (CHINA)

Message: 93879   

 

Hi,

 

What about the attached patch?

 

And I still can't repeat your issue. Can you explain your trigger steps using Oscilloscope more detail ?

 

Since the clk is ad73322 supply to blackfin sport, how do your know the expect frame sync position?

 

Thanks

 

ad73322.c

QuoteReplyEditDelete

 

 

2010-09-29 04:42:59     Re: AD73322 driver status in newer kernels ?

Olivier STOCK (FRANCE)

Message: 93963   

 

Hi Bob,

 

 

 

The attached patch doesn't change anything for our problem.

 

 

 

As for the oscilloscode diagram, let's start with a short sumary of the AD73322 principle of communication:

 

-> AD73322 is a cascadable device and at startup, its control register A is set with DC0-2 = 0x07 (means that 4 AD73322 are cascaded, thus providing 8 audio channels).

 

-> Then AD73322 will output 8 frame sync pulse per audio sample as shown in second trace of the oscilloscode diagram.

 

-> The AD73322 has an internal counter that count frame sync pulses to know which frame it should use. This frame counter is only reseted when the SE pin (PF10 on our board) is toggled (ie before each startup of aplay / arecord).

 

-> So if the audio data from the DSP are not positioned on the expected frame sync (as shown in the first trace of our diagram), the audio don't go to the right output of the AD73322 chain.

 

 

 

It sounds strange that you are unable to reproduce the problem with arecord + aplay. Can you tell us which hardware (board + audio card) you are using ?

 

Can you provide your whole "uImage" file if it can fit into a BF537 STAMP board ?

 

Would you like to test our uImage file it we send it to you ?

 

 

 

Regards,

 

Xavier

QuoteReplyEditDelete

 

 

2010-10-28 03:20:03     Re: AD73322 driver status in newer kernels ?

Bob Liu (CHINA)

Message: 95357   

 

Hi, Xavier

 

Sorry for late reply, I was busy with other bugs and goback this one now.

 

I tested it like this but can't reproduce this problem.

 

1. arecord for a long time

 

root:/> arecord -D plughw:0,6 -d 600 -f S16_LE -c 1 -r 8000 -t wav test.wav

Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

 

2. then I telnet to the board and aplay a short file several times, but every time the output

 

channel showed on the scope is the same.

 

root:/> aplay 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay -Dhw:0,5 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay -Dhw:0,5 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay -Dhw:0,5 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay -Dhw:0,5 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay -Dhw:0,5 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay -Dhw:0,3 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay -Dhw:0,3 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay -Dhw:0,3 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay -Dhw:0,3 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay -Dhw:0,3 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay -Dhw:0,3 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

root:/> aplay -Dhw:0,2 73322.wav

Playing WAVE '73322.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

 

 

Attached my uImage for bf537-stmap, if you can please attach yours also.

 

Thanks a lot.

QuoteReplyEditDelete

 

 

2010-10-28 03:30:54     Re: AD73322 driver status in newer kernels ?

Bob Liu (CHINA)

Message: 95358   

 

Sorry, forgot to attach my uImage

 

uImage

Attachments

Outcomes