All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem with underrun on new CS42448 x2 driver
@ 2010-08-24 19:47 Adam Rosenberg
  2010-08-26 12:47 ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Adam Rosenberg @ 2010-08-24 19:47 UTC (permalink / raw)
  To: alsa-devel

I am trying to write a driver for the Blackfin BF537 processor on a custom
board that has two CS42448 CODECs connected to SPORT0.  I am using TDM and
there are 8 channels per frame on each data line (primary and secondary).
My DMA buffer must interleave the data for the two data lines (for a total
of 16 channels of data per frame).  I have completed all of this and the
driver will sometimes work properly but I am having underrun problems.  I
would like to use snd_async_add_pcm_handler as it is used in the /test/pcm.c
example but it seems as though an underrun occurs at regular intervals
causing the PCM prepare function to be called again (this results in a tone
that sounds good but only for a short time before it stops and then starts
again).

There is plenty of time for the data to be transferred.  I feel as though
the driver is not calling snd_pcm_period_elapsed fast enough.  At the
moment, I call snd_pcm_period_elapsed from within a callback function that
occurs every time a DMA period elapse occurs.  I have been working on this
for quite a while now.  Is there someone who can look at the driver code for
me or provide detailed information on when ALSA expects to have
snd_pcm_period_elapsed get called to avoid an underrun?

The other thing that is strange is that I have to explicitly set the period
size for aplay to work.  For example:
aplay --period-size=1024 test.wav
which gives me a period time of 21333 but when I use this period time with
the /test/pcm.c sample that is provided the tone still does not sound right
(although it does seem to improve)

I am about ready to bypass ALSA entirely but I hate the idea of breaking
from standards (not to mention having to rewrite an entire audio
interface).  Any help would be greatly appreciated!

You can check out the driver here:
http://www.alcorn.com/ftp/swap/ami_cs42448.zip

Thank you,
Adam

Adam Rosenberg
Software Engineer

Alcorn McBride Inc.
3300 South Hiawassee
Building 105
Orlando, FL 32835

(407) 296 - 5800 ext. 5490

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-08-27 23:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-24 19:47 Problem with underrun on new CS42448 x2 driver Adam Rosenberg
2010-08-26 12:47 ` Mark Brown
2010-08-26 18:06   ` Adam Rosenberg
2010-08-26 18:52     ` Mark Brown
2010-08-27 20:11       ` Adam Rosenberg
2010-08-27 22:04         ` Mark Brown
2010-08-27 20:37     ` Mike Frysinger
2010-08-27 21:20       ` Mark Brown
2010-08-27 23:00         ` Mike Frysinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.