Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Timur Tabi <timur@freescale.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: How to report error in _pointer function?
Date: Wed, 30 Jul 2008 18:12:43 +0200	[thread overview]
Message-ID: <s5hhca7s64k.wl%tiwai@suse.de> (raw)
In-Reply-To: <ed82fe3e0807300856q6c6daf99n224df8ae4bfe6954@mail.gmail.com>

At Wed, 30 Jul 2008 10:56:31 -0500,
Timur Tabi wrote:
> 
> In my driver, I can detect in the _pointer callback function whether
> or not the DMA engine has actually started.  Sometimes, when I have a
> programming error, the DMA will not start, so my _pointer function
> calculates a crazy value for the current position.  The number it
> returns causes ALSA to go haywire (see my post titled, "underrun!!!
> (at least 1786051083.613 ms long)".
> 
> What is the best way to handle this?  Is there a way I can tell ALSA,
> "hey, this is really screwed up, just abort playback and return an
> error to the app"?

You can return SNDRV_PCM_POS_XRUN from the pointer callback (with
kernel messages if you like).  Then the PCM stream is stopped and the
status is changed to SND_PCM_STATUS_XRUN.  Further access will result
in -EPIPE.

I guess this doesn't fully satisfy your demand, but maybe better than
now :)  We'd need a mechanism to pass a proper error code if other
critical error code must be passed.


Takashi

  reply	other threads:[~2008-07-30 16:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-30 15:56 How to report error in _pointer function? Timur Tabi
2008-07-30 16:12 ` Takashi Iwai [this message]
2008-08-06 21:54   ` Timur Tabi
2008-08-07 16:29     ` Takashi Iwai
2008-08-07 18:59       ` Timur Tabi
2008-08-08 12:03         ` Takashi Iwai
2008-08-08 15:55           ` Timur Tabi
2008-08-08 22:26           ` Timur Tabi
2008-08-11  7:19             ` Takashi Iwai
2008-08-11 15:37               ` Timur Tabi

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=s5hhca7s64k.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=timur@freescale.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox