snd_pcm_sw_params_set_xfer_align replacement?
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?
Signature · 1 line
Aaron J. Grier | "Not your ordinary poofy goof." | [email protected]
Quoted 2 lines · Aaron J. Grier
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.
Quoted 1 line
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
Quoted 6 lines · Clemens Ladisch
Quoted 2 lines · Aaron J. Grier
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?
Quoted 4 lines
Quoted 1 line
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?
Signature · 1 line
Aaron J. Grier | "Not your ordinary poofy goof." | [email protected]
Quoted 8 lines · Aaron J. Grier
Quoted 2 lines · Clemens Ladisch
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
At Mon, 21 Jul 2008 11:31:35 -0700,
Quoted 11 lines · Aaron J. Grier
Quoted 6 lines · Clemens Ladisch
Quoted 2 lines · Aaron J. Grier
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
[PATCH - snd_pcm_sw_params_set_xfer_align doc update 1add notes regarding snd_pcm_sw_params_set_xfer_align's deprecation and
src/pcm/pcm.c +11 -0
@@ -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 <[email protected]> +* +* "Note that the transfer alignment was really buggy, and didn't work +* at all like what you imagined from its name." -- Takashi Iwai +* <[email protected]> +* +* 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)
Signature · 1 line
1.5.4.1
[PATCH - snd_pcm_sw_params_set_xfer_align doc update 2fix grammatical error
src/pcm/pcm.c +1 -1
@@ -5703,7 +5703,7 @@ int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *v* <[email protected]> * * 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
Signature · 1 line
1.5.4.1