From: Eric Peters <epeters@graphics.cs.uni-sb.de>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Starting the device manually
Date: Mon, 24 Jul 2006 13:40:41 +0200 [thread overview]
Message-ID: <44C4B1B9.6060705@graphics.cs.uni-sb.de> (raw)
In-Reply-To: <20060724110516.GA12899@turing.informatik.uni-halle.de>
Clemens Ladisch wrote:
> Eric Peters wrote:
>>I'm a bit confused by the alsa documentation. I want to fill up a buffer
>>of a alsa device with snd_pcm_writei and then if the buffer is full, I
>>want to be able to start the playback manually. By looking to the
>>documentation, I found the method snd_pcm_sw_params_set_start_threshold.
>>In some other messages on this list there was the hint to set this
>>threshhold larger than the max_buffer_size and then the device shouldn't
>>start automatically. So I've done. But unfortunately the playback starts
>>again automatically.
>
> What are the contents of /proc/asound/card?/pcm0p/sub0/sw_params during
> playback?
tstamp_mode: NONE
period_step: 1
sleep_min: 0
avail_min: 1
xfer_align: 4096
start_threshold: 2703204728
stop_threshold: 16384
silence_threshold: 0
silence_size: 0
boundary: 1073741824
Can you explain me these values and what they're for? I think, I know
the sense of start and stop threshold. But the other values...
>
>>/* calculating the number of frames of a buffer and a period */
>>buffer_frames = buffer_time * sample_rate;
>>period_frames = period_time * sample_rate;
>
> Is this correct? Aren't the xxx_time variables in microseconds?
I don't know. ;-)
How is a frame defined?
>
>>snd_pcm_sw_params_set_start_threshold(..., 2*buffer_frames)
>
> This is OK, but it is common to use just the boundary value instead of
> some explicitly calculated value.
The boundary value in the output above? How can I determine this value
in my application?
>
>>- I think, if I don't call snd_pcm_start there should be no output if
>>the start threshold is larger than the max_buffer_size. Is this correct?
>
> ... if the start threshold is larger than the current buffer size, in
> frames. Yes.
>
>>- Is it possible that the starting behaviour depends on the hardware I'm
>>using?
>
> No, the software parameters are hardware independent.
>
>
> Regards,
> Clemens
Thanks Clemens for your fast answer.
Best regards,
Eric
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
next prev parent reply other threads:[~2006-07-24 11:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-24 9:37 Starting the device manually Eric Peters
2006-07-24 11:05 ` Clemens Ladisch
2006-07-24 11:40 ` Eric Peters [this message]
2006-08-04 16:44 ` Clemens Ladisch
2006-07-24 15:35 ` James Courtier-Dutton
2006-07-25 6:20 ` Eric Peters
2006-07-24 15:37 ` James Courtier-Dutton
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=44C4B1B9.6060705@graphics.cs.uni-sb.de \
--to=epeters@graphics.cs.uni-sb.de \
--cc=alsa-devel@lists.sourceforge.net \
--cc=clemens@ladisch.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 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.