alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: Clemens Ladisch <cladisch@fastmail.net>
Cc: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: Re: Any OSS changes from kernel 2.6.21 to 2.6.23? Something broke.
Date: Thu, 08 Nov 2007 13:33:17 -0600	[thread overview]
Message-ID: <4733647D.9040601@freescale.com> (raw)
In-Reply-To: <1194507244.16131.1220189539@webmail.messagingengine.com>

Clemens Ladisch wrote:
> Timur Tabi wrote:
>> It turns out that ALSA (when using mplayer to play a divx video file via OSS 
>> emulation) is rapidly sending back-to-back SNDRV_PCM_TRIGGER_STOP and 
>> SNDRV_PCM_TRIGGER_START commands.  Why would it do that?
> 
> To recover from underruns.

I've added some function traces to ALSA, and apparently ALSA is telling the 
driver to STOP when the driver calls snd_pcm_period_elapsed().  Here's a log:

snd_pcm_period_elapsed
snd_pcm_update_hw_ptr_interrupt:232  <- last line of this function
PERIOD	<- printk in the driver's ISR
snd_pcm_period_elapsed
snd_pcm_update_hw_ptr_interrupt:232
snd_pcm_update_hw_ptr_post
xrun
snd_pcm_stop
snd_pcm_action
snd_pcm_action_single
snd_pcm_do_stop
STOP 279 <- command to stop after sub-buffer #279, which is at the end of the period

Unfortunately, very little of the code in sound/core/pcm???.c is documented, so 
I'm having a hard time figuring out what's going on.  Why is ALSA telling the 
driver to stop during a period interrupt?

-- 
Timur Tabi
Linux kernel developer at Freescale

  parent reply	other threads:[~2007-11-08 19:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-02 15:36 Any OSS changes from kernel 2.6.21 to 2.6.23? Something broke Timur Tabi
2007-11-02 17:11 ` Clemens Ladisch
2007-11-02 18:22   ` Timur Tabi
2007-11-03 16:51     ` James Courtier-Dutton
2007-11-04 15:15       ` Timur Tabi
2007-11-05 14:27 ` Takashi Iwai
2007-11-08  0:15   ` Timur Tabi
2007-11-08  7:34     ` Clemens Ladisch
2007-11-08 17:35       ` Timur Tabi
2007-11-08 19:33       ` Timur Tabi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-01-31  3:09 Raymond Yau

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=4733647D.9040601@freescale.com \
    --to=timur@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=cladisch@fastmail.net \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).