All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: kartik natarajan <kartik8n8@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Arecord issue
Date: Thu, 11 Oct 2012 15:06:54 +0200	[thread overview]
Message-ID: <5076C46E.5070009@gmail.com> (raw)
In-Reply-To: <CAAe3XR3rDQb4U8EUq5COCHH5oAtXR2tVcFROBVTN0rsZvJdt+Q@mail.gmail.com>

On 11.10.2012 14:54, kartik natarajan wrote:
>     I am working on a 2.6.37 kernel and on a DM365 davinci board with a
> tlv320aic3254 audio codec (i2c control lines, i2s data transfer)
> I wanted to get the audio up on my board so got the alsa-lib and alsa-utils
> 1.0.25 compiled them and got the aplay to work fine.
> When I got to working on the arecord things haven't worked fine. I have
> traced all the calls and have reached so far;
> codec gets set properly
> davinci_pcm_trigger executes with success
> snd_pcm_sw_params() executes successfully.
> aplay calls begin_wave()
> aplay calls pcm_read() that invokes  snd_pcm_readi()
> Finally my app seems to not go beyond the snd_pcm_start()

I've been working on a custom AM33xx boards lately which features the
same digital audio interface than the Davincis do.

I've been running into similar issues when I tested the recording
channels, and hooking up a logic analyzer showed that the clocks were
not driven by the CPU. That causes the DMA engine not receive any
samples (as the frame and bit clocks are missing), which will eventually
lead to a timeout.

This issue was worked around for now by starting the playback first and
then the record. Unfortunately though, a simply "arecord | aplay" does
not suffice, as aplay won't start before it received any samples from
its input side, so you have a deadlock here.

So I wrote a very simple test tool in order to prove that the overall
system is working and published it here:

  https://github.com/zonque/simple-alsa-loop

For the application of this board I'm working on, there's no case where
we would record anything but not use the output, so this workaround will
do for me. If you have other requirements, you might need to dig deeper.
Note that the driver has seem quite some refactorization in 3.7.


Daniel

  reply	other threads:[~2012-10-11 13:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11 12:54 Arecord issue kartik natarajan
2012-10-11 13:06 ` Daniel Mack [this message]
2012-10-11 14:44   ` kartik natarajan
2012-10-11 14:49     ` Daniel Mack

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5076C46E.5070009@gmail.com \
    --to=zonque@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kartik8n8@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.