Hi Andy,

I tried your solution by uncommenting following lines and it did work for me:

#if 0
       DMA_START(s, SPIN_ADDR, SPIN_SIZE);
       DMA_START(s, SPIN_ADDR, SPIN_SIZE);
#endif

Now it doesn't stall while playing the movie file (usually it will
stall soon after few seconds when i write audio dev with 4k buffer
each time).
However i also experienced apparent noises with above solution, and
the sound becomes slowly. I think it's because the spin_idle writes
zeros into dma channel. I'll keep on trying and, anyway, your solution
points a good way out.

Thanks.
Hongjun


----- Original Message ----
>
> Re: Re: Re: RE: Buggy Audio Driver
>
> Andy Ngo
> Wed, 25 Jun 2008 19:25:49 -0700
>
>
> JP,
>
> I tried your fix and the write stall still occurs under heavy system
> load (I forced the CPU to be utilized heavily as a test case to induce the
> write stall).  Hence the
> fix you suggested didn't work for us since our system can be under
> heaving load during usage.  How did you come to the solution you suggested?
> Why does switching the order of AUDIO_INCREMENT_HEAD(s) and audio_stop_dma(s)
> help?  Actually, when trying your suggestion, we actually got more write 
> stalls
> in a fixed period.
>
> Anyways, I think I may be coming up to something with this write stall issue.
> The change below is what I tried and it looks promising (I ran my heaving
> system stress test for 3 hours and not a write stall has occurred yet, usually
> I would get 3-5 stalls already); I'll let it run overnight to see if I no 
> write
> stall occurs (I have an infinite audio loopback test that reads from the 
> device
> and plays it back to the device, while other heaving processing is going on).
> Just by trial and error, I uncommented the code to the 2 DMA_START calls in
> audio_stop_dma (davinci-audio-dma-intfc.c):
>
> Change
>
> void audio_stop_dma(audio_stream_t * s)
> {
>   ...
>    if (s->spin_idle) {
> #if 0
>        DMA_START(s, SPIN_ADDR, SPIN_SIZE);
>        DMA_START(s, SPIN_ADDR, SPIN_SIZE);
> #endif
>        s->dma_spinref = 2;
>    } else
>   ...
> }
>
> to
>
> void audio_stop_dma(audio_stream_t * s)
> {
>   ...
>    if (s->spin_idle) {
> #if 1
>        davinci_start_sound_dma(s, SPIN_ADDR, SPIN_SIZE);
>        davinci_start_sound_dma(s, SPIN_ADDR, SPIN_SIZE);
> #endif
>        s->dma_spinref = 2;
>    } else
>   ...
> }
>
> I looked at the other drivers in the oss directory and some have these
> commented DMA_START calls enabled so I wonder why it was commented out for 
> this
> board.  It's good so far (usually I would have 3-5 stalls in the 3-hour period
> I have run the test).  I'm keeping my fingers crossed.
>
> JP, when you switch to McASP as the master, you need to adjust the J-value,
> D-values 8-MSBs and 6-MSBs based on the clock to your AIC33 codec you're 
> using.
>  For the DVEVM, the clock is 22Mhz (#define MCLK 22), so the J-value, D-values
> 8-MSBs and 6-MSBs values you see in davinci_set_samplerate
> (davinci-audio-aic33.c) is based on this clock.  For our system, the MCLK is
> actually 22.588 Mhz so I adjusted the J-value, D-values 8-MSBs and 6-MSBs for
> the sample rate I'm using (8Khz) and it works fine; I had weird sounds like 
> you
> did until I adjusted the J-value, D-values 8-MSBs and 6-MSBs; took me a while
> to figure it out.
>
> For those willing to try out what I did, please let the forum know if it fixes
> your write stall problems.  Thanks.
>
> Regards,
> Andy
>

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to