From: James Courtier-Dutton <James@superbug.demon.co.uk>
To: "alsa-devel@lists.sourceforge.net" <alsa-devel@lists.sourceforge.net>
Subject: Problems with snd_pcm_hw_params_can_pause (). etc.
Date: Sat, 12 Oct 2002 23:15:12 +1000 [thread overview]
Message-ID: <3DA82060.9090409@superbug.demon.co.uk> (raw)
Currently, the state of play is that "snd_pcm_hw_params_can_pause ()"
should not be called until one has first done the first
"snd_pcm_hw_params()"
I start with
snd_pcm_hw_params_any(this->audio_fd, params);
then go about setting params, e.g.
snd_pcm_hw_params_set_access()
snd_pcm_hw_params_set_format()
etc.
Then
snd_pcm_hw_params()
then
snd_pcm_hw_params_can_pause (params)
If the "snd_pcm_hw_params_can_pause (params)" goes before the
"snd_pcm_hw_params()" an invalid result is returned. I.E. the result is
always 1 even for cards which don't support it.
I think the documentation should make it clear when one should use
"snd_pcm_hw_params_can_pause ()".
or maybe "snd_pcm_hw_params_any()" should be modified to correctly fill
the "can_pause" bit.
Maybe I have missunderstood the API, but I would prefer the approach of
first retrieving the current hw params, then go about modifying it, then
writting it back. If one has not set any hw params yet, it would fill
the structure with the most general case, then allow the application to
set params to further restrict the config.
I had assumed that "snd_pcm_hw_params_any()" did the retrieving of the
current hw params, but reset to the least restrictive settings. I don't
think "can_pause" is anything an application can set, the hardware on
the card decides that, so the "snd_pcm_hw_params_any()" should cause
"can_pause" to return a valid setting that matches the hardware, instead
of having to wait for the params to be written to the card with
"snd_pcm_hw_params()" before "can_pause" is set accurately.
Cheers
James
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
next reply other threads:[~2002-10-12 13:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-12 13:15 James Courtier-Dutton [this message]
2002-10-12 13:37 ` Problems with snd_pcm_hw_params_can_pause (). etc Jaroslav Kysela
2002-10-12 14:08 ` James Courtier-Dutton
2002-10-12 14:30 ` Jaroslav Kysela
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=3DA82060.9090409@superbug.demon.co.uk \
--to=james@superbug.demon.co.uk \
--cc=alsa-devel@lists.sourceforge.net \
/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.