All of lore.kernel.org
 help / color / mirror / Atom feed
* snd_pcm_sw_params_set_xfer_align replacement?
@ 2008-07-18 19:23 Aaron J. Grier
  2008-07-21  8:37 ` Clemens Ladisch
  0 siblings, 1 reply; 7+ messages in thread
From: Aaron J. Grier @ 2008-07-18 19:23 UTC (permalink / raw)
  To: alsa-devel

snd_pcm_sw_params_set_xfer_align() has been deprecated but the docs
don't mention what it was replaced with.

I don't ever want or need partial reads and writes -- my app would
actually be happiest being completely synchronous to the hardware with
fixed-size buffers.  any suggestions how to get ALSA to do this?

-- 
  Aaron J. Grier | "Not your ordinary poofy goof." | agrier@poofygoof.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: snd_pcm_sw_params_set_xfer_align replacement?
  2008-07-18 19:23 snd_pcm_sw_params_set_xfer_align replacement? Aaron J. Grier
@ 2008-07-21  8:37 ` Clemens Ladisch
  2008-07-21 18:31   ` Aaron J. Grier
  0 siblings, 1 reply; 7+ messages in thread
From: Clemens Ladisch @ 2008-07-21  8:37 UTC (permalink / raw)
  To: Aaron J. Grier; +Cc: alsa-devel

Aaron J. Grier wrote:
> snd_pcm_sw_params_set_xfer_align() has been deprecated but the docs
> don't mention what it was replaced with.

There is no replacement; the transfer alignment always is one frame,
i.e., there is none.

> I don't ever want or need partial reads and writes

You get partial reads/writes only when you ask for it (by using non-
blocking mode) or when an error occurs.


HTH
Clemens

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: snd_pcm_sw_params_set_xfer_align replacement?
  2008-07-21  8:37 ` Clemens Ladisch
@ 2008-07-21 18:31   ` Aaron J. Grier
  2008-07-22  7:01     ` Clemens Ladisch
  2008-07-27  8:00     ` Takashi Iwai
  0 siblings, 2 replies; 7+ messages in thread
From: Aaron J. Grier @ 2008-07-21 18:31 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel

On Mon, Jul 21, 2008 at 10:37:09AM +0200, Clemens Ladisch wrote:
> Aaron J. Grier wrote:
> > snd_pcm_sw_params_set_xfer_align() has been deprecated but the docs
> > don't mention what it was replaced with.
> 
> There is no replacement; the transfer alignment always is one frame,
> i.e., there is none.

would it be possible for a note to be added to the documentation
explaining this?

> > I don't ever want or need partial reads and writes
> 
> You get partial reads/writes only when you ask for it (by using non-
> blocking mode) or when an error occurs.

I want non-blocking behavior (return immediately if there is no data
available), but I don't want to have to deal with partial reads.  I
figured out a workaround using snd_pcm_avail_update(), but I'm wondering
if there isn't a better way.

if I switched to using callbacks, how would I control the amount of data
passed to the callbacks now that set_xfer_align() is gone?

-- 
  Aaron J. Grier | "Not your ordinary poofy goof." | agrier@poofygoof.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: snd_pcm_sw_params_set_xfer_align replacement?
  2008-07-21 18:31   ` Aaron J. Grier
@ 2008-07-22  7:01     ` Clemens Ladisch
  2008-07-27  8:00     ` Takashi Iwai
  1 sibling, 0 replies; 7+ messages in thread
From: Clemens Ladisch @ 2008-07-22  7:01 UTC (permalink / raw)
  To: Aaron J. Grier; +Cc: alsa-devel

Aaron J. Grier wrote:
> On Mon, Jul 21, 2008 at 10:37:09AM +0200, Clemens Ladisch wrote:
> > You get partial reads/writes only when you ask for it (by using non-
> > blocking mode) or when an error occurs.
>
> I want non-blocking behavior (return immediately if there is no data
> available), but I don't want to have to deal with partial reads.  I
> figured out a workaround using snd_pcm_avail_update(), but I'm wondering
> if there isn't a better way.

You could write your own read function that calls snd_pcm_read*()
repeatedly until you have as much data as you want, but this is probably
more complex than just checking for data before doing a blocking read.


Regards,
Clemens

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: snd_pcm_sw_params_set_xfer_align replacement?
  2008-07-21 18:31   ` Aaron J. Grier
  2008-07-22  7:01     ` Clemens Ladisch
@ 2008-07-27  8:00     ` Takashi Iwai
  2008-07-31 23:09       ` [PATCH - snd_pcm_sw_params_set_xfer_align doc update 1add notes regarding snd_pcm_sw_params_set_xfer_align's deprecation and Aaron J. Grier
  2008-07-31 23:09       ` [PATCH - snd_pcm_sw_params_set_xfer_align doc update 2fix grammatical error Aaron J. Grier
  1 sibling, 2 replies; 7+ messages in thread
From: Takashi Iwai @ 2008-07-27  8:00 UTC (permalink / raw)
  To: Aaron J. Grier; +Cc: alsa-devel, Clemens Ladisch

At Mon, 21 Jul 2008 11:31:35 -0700,
Aaron J. Grier wrote:
> 
> On Mon, Jul 21, 2008 at 10:37:09AM +0200, Clemens Ladisch wrote:
> > Aaron J. Grier wrote:
> > > snd_pcm_sw_params_set_xfer_align() has been deprecated but the docs
> > > don't mention what it was replaced with.
> > 
> > There is no replacement; the transfer alignment always is one frame,
> > i.e., there is none.
> 
> would it be possible for a note to be added to the documentation
> explaining this?

Patch please :)

Note that the transfer alignment was really buggy, and didn't work at
all like what you imagined from its name.  This has nothing to do with
the period size and wake-up setting.


Takashi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH - snd_pcm_sw_params_set_xfer_align doc update 1add notes regarding snd_pcm_sw_params_set_xfer_align's deprecation and
  2008-07-27  8:00     ` Takashi Iwai
@ 2008-07-31 23:09       ` Aaron J. Grier
  2008-07-31 23:09       ` [PATCH - snd_pcm_sw_params_set_xfer_align doc update 2fix grammatical error Aaron J. Grier
  1 sibling, 0 replies; 7+ messages in thread
From: Aaron J. Grier @ 2008-07-31 23:09 UTC (permalink / raw)
  To: patch; +Cc: alsa-devel, Aaron J. Grier


Signed-off-by: Aaron J. Grier <agrier@poofygoof.com>

diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index ee2300e..a937b40 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -5694,6 +5694,17 @@ int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *v
  * \param params Software configuration container
  * \param val Chunk size (frames are attempted to be transferred in chunks)
  * \return 0 otherwise a negative error code
+ *
+ * "There is no replacement; the transfer alignment always is one
+ * frame[.]" -- Clemens Ladisch <clemens@ladisch.de>
+ *
+ * "Note that the transfer alignment was really buggy, and didn't work
+ * at all like what you imagined from its name." -- Takashi Iwai
+ * <tiwai@suse.de>
+ *
+ * If fixed-size transfers are required, use \ref snd_pcm_avail_update
+ * if to determine the number of frames available before reading or
+ * writing.
  */
 #ifndef DOXYGEN
 int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_sw_params_t *params ATTRIBUTE_UNUSED, snd_pcm_uframes_t val ATTRIBUTE_UNUSED)
-- 
1.5.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH - snd_pcm_sw_params_set_xfer_align doc update 2fix grammatical error
  2008-07-27  8:00     ` Takashi Iwai
  2008-07-31 23:09       ` [PATCH - snd_pcm_sw_params_set_xfer_align doc update 1add notes regarding snd_pcm_sw_params_set_xfer_align's deprecation and Aaron J. Grier
@ 2008-07-31 23:09       ` Aaron J. Grier
  1 sibling, 0 replies; 7+ messages in thread
From: Aaron J. Grier @ 2008-07-31 23:09 UTC (permalink / raw)
  To: patch; +Cc: alsa-devel, Aaron J. Grier


Signed-off-by: Aaron J. Grier <agrier@poofygoof.com>

diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index a937b40..ada697a 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -5703,7 +5703,7 @@ int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *v
  * <tiwai@suse.de>
  *
  * If fixed-size transfers are required, use \ref snd_pcm_avail_update
- * if to determine the number of frames available before reading or
+ * to determine the number of frames available before reading or
  * writing.
  */
 #ifndef DOXYGEN
-- 
1.5.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-07-31 23:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-18 19:23 snd_pcm_sw_params_set_xfer_align replacement? Aaron J. Grier
2008-07-21  8:37 ` Clemens Ladisch
2008-07-21 18:31   ` Aaron J. Grier
2008-07-22  7:01     ` Clemens Ladisch
2008-07-27  8:00     ` Takashi Iwai
2008-07-31 23:09       ` [PATCH - snd_pcm_sw_params_set_xfer_align doc update 1add notes regarding snd_pcm_sw_params_set_xfer_align's deprecation and Aaron J. Grier
2008-07-31 23:09       ` [PATCH - snd_pcm_sw_params_set_xfer_align doc update 2fix grammatical error Aaron J. Grier

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.