Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Uli Franke <uli.franke@weiss.ch>
To: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: Dummy module and sample rates
Date: Thu, 24 Sep 2015 12:49:22 +0200	[thread overview]
Message-ID: <5603D532.9080201@weiss.ch> (raw)
In-Reply-To: <56039FF3.3030203@ladisch.de>

>> I fiddled around with the Dummy module and it seems to be the thing
>> we're looking for. I observed a rather strange behavior though:
>>
>> I set the hw params sample rate to 44k1 without error, but a subsequent
>> call of snd_pcm_start returns EPIPE. When setting hw params sample rate
>> to 4k this does not happen.
> 
> In theory, this error code is returned if you didn't write any samples
> into the buffer before starting.
> 
> An underrun is possible too, but should be reported later AFAIK.
> Could you check if a larger buffer size helps?

I checked if this is actually an XRun, as this is the official error
code. But even recover didn't have any effect.

When I write samples before starting the stream, snd_pcm_start returns

   File descriptor in bad state (-77)

which is obvious as the state of the stream changes from PREPARED to
RUNNING.

I tried to increase the buffer but with no effect.

No error occurs when I just write samples and omit the snd_pcm_start. I
just read some examples and got the impression that this seems to be
common practice anyhow. But up to now all my ALSA interfacing programs
actively started the stream and I never had any similar effect.

You can find a small test program here:

http://460c9235de50fe3b.paste.se/

Regards,
Uli

  reply	other threads:[~2015-09-24 10:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-23 11:43 Dummy module and sample rates Uli Franke
2015-09-24  7:02 ` Clemens Ladisch
2015-09-24 10:49   ` Uli Franke [this message]
2015-09-24 18:40     ` Clemens Ladisch
2015-10-10  7:59     ` 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=5603D532.9080201@weiss.ch \
    --to=uli.franke@weiss.ch \
    --cc=alsa-devel@alsa-project.org \
    /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