* [PATCH 2/2] Improve hw_params documentation @ 2011-11-16 19:56 Andrew Eikum 2011-11-16 21:20 ` Clemens Ladisch 0 siblings, 1 reply; 11+ messages in thread From: Andrew Eikum @ 2011-11-16 19:56 UTC (permalink / raw) To: alsa-devel [-- Attachment #1: Type: text/plain, Size: 126 bytes --] --- include/pcm.h | 14 +++++++++++++- src/pcm/pcm.c | 10 +++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) [-- Attachment #2: 0002-Improve-hw_params-documentation.patch --] [-- Type: text/x-patch, Size: 2696 bytes --] diff --git a/include/pcm.h b/include/pcm.h index be355a9..961c6a0 100644 --- a/include/pcm.h +++ b/include/pcm.h @@ -44,8 +44,20 @@ extern "C" { /** PCM generic info container */ typedef struct _snd_pcm_info snd_pcm_info_t; -/** PCM hardware configuration space container */ + +/** PCM hardware configuration space container + * + * snd_pcm_hw_params_t is an opaque structure which contains a set of possible + * PCM hardware configurations. For example, a given instance might include a + * range of buffer sizes, a range of period sizes, and a set of several sample + * formats. Some subset of all possible combinations these sets may be valid, + * but not necessarily any combination will be valid. + * + * No validation is done by the various snd_pcm_hw_params_set* functions. + * Instead, #snd_pcm_hw_params will return an error code if the requested + * set of parameters can't be resolved to a single valid configuration. */ typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t; + /** PCM software configuration container */ typedef struct _snd_pcm_sw_params snd_pcm_sw_params_t; /** PCM status container */ diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c index dc91f79..ea1afdc 100644 --- a/src/pcm/pcm.c +++ b/src/pcm/pcm.c @@ -809,7 +809,9 @@ int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) * * The configuration is chosen fixing single parameters in this order: * first access, first format, first subformat, min channels, min rate, - * min period time, max buffer size, min tick time + * min period time, max buffer size, min tick time. If no mutually + * compatible set of parameters can be chosen, a negative error code + * will be returned. * * After this call, #snd_pcm_prepare() is called automatically and * the stream is brought to \c #SND_PCM_STATE_PREPARED state. @@ -817,6 +819,9 @@ int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) * The hardware parameters cannot be changed when the stream is * running (active). The software parameters can be changed * at any time. + * + * The configuration space will be updated to reflect the chosen + * parameters. */ int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) { @@ -3183,6 +3188,9 @@ int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params) * \brief Fill params with a full configuration space for a PCM * \param pcm PCM handle * \param params Configuration space + * + * The configuration space will be filled with all possible ranges + * for the PCM device. */ int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) { [-- Attachment #3: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] Improve hw_params documentation 2011-11-16 19:56 [PATCH 2/2] Improve hw_params documentation Andrew Eikum @ 2011-11-16 21:20 ` Clemens Ladisch 2011-11-16 21:31 ` Andrew Eikum 0 siblings, 1 reply; 11+ messages in thread From: Clemens Ladisch @ 2011-11-16 21:20 UTC (permalink / raw) To: alsa-devel, Andrew Eikum Andrew Eikum wrote: > +++ b/include/pcm.h > @@ -44,8 +44,20 @@ extern "C" { > > /** PCM generic info container */ > typedef struct _snd_pcm_info snd_pcm_info_t; > -/** PCM hardware configuration space container */ > + > +/** PCM hardware configuration space container > + * > + * snd_pcm_hw_params_t is an opaque structure which contains a set of possible > + * PCM hardware configurations. For example, a given instance might include a > + * range of buffer sizes, a range of period sizes, and a set of several sample > + * formats. Some subset of all possible combinations these sets may be valid, > + * but not necessarily any combination will be valid. > + * > + * No validation is done by the various snd_pcm_hw_params_set* functions. These functions do validate the value that the application is trying to set and adjust all other dependent limits. Regards, Clemens ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] Improve hw_params documentation 2011-11-16 21:20 ` Clemens Ladisch @ 2011-11-16 21:31 ` Andrew Eikum 2011-11-16 22:08 ` Clemens Ladisch 2011-11-17 0:45 ` Raymond Yau 0 siblings, 2 replies; 11+ messages in thread From: Andrew Eikum @ 2011-11-16 21:31 UTC (permalink / raw) To: Clemens Ladisch; +Cc: Andrew Eikum, alsa-devel [-- Attachment #1: Type: text/plain, Size: 1556 bytes --] On Wed, Nov 16, 2011 at 10:20:07PM +0100, Clemens Ladisch wrote: > Andrew Eikum wrote: > > +++ b/include/pcm.h > > @@ -44,8 +44,20 @@ extern "C" { > > > > /** PCM generic info container */ > > typedef struct _snd_pcm_info snd_pcm_info_t; > > -/** PCM hardware configuration space container */ > > + > > +/** PCM hardware configuration space container > > + * > > + * snd_pcm_hw_params_t is an opaque structure which contains a set of possible > > + * PCM hardware configurations. For example, a given instance might include a > > + * range of buffer sizes, a range of period sizes, and a set of several sample > > + * formats. Some subset of all possible combinations these sets may be valid, > > + * but not necessarily any combination will be valid. > > + * > > + * No validation is done by the various snd_pcm_hw_params_set* functions. > > These functions do validate the value that the application is trying to set > and adjust all other dependent limits. > I didn't find that to be the case in my testing, at least between periods, period_size, and buffer_size. I've attached a test program here. It sets periods to 10, period_size to 1024, and buffer_size_max to be the same as the return from get_buffer_size_min (in my case, 80). The first call to fail is snd_pcm_hw_params(). If what you said is true, I would expect the set_buffer_size_max() call to fail. $ gcc -I /usr/include/alsa -lasound -o alsa_period_count alsa_period_count.c $ ./alsa_period_count min_buffer_frames: 80 set max buffer size: 80 snd_pcm_hw_params: -12 $ Andrew [-- Attachment #2: alsa_period_count.c --] [-- Type: text/x-csrc, Size: 3306 bytes --] #include <asoundlib.h> int main(int argc, char **argv) { snd_pcm_t *pcm; snd_pcm_hw_params_t *hw_params; snd_pcm_uframes_t buffer_frames, period_frames; unsigned int periods, min_periods, max_periods; int period_dir, periods_dir, min_periods_dir, max_periods_dir; int err; err = snd_pcm_open(&pcm, "default", SND_PCM_STREAM_PLAYBACK, 0); if(err < 0){ printf("snd_pcm_open: %d\n", err); return 1; } hw_params = malloc(snd_pcm_hw_params_sizeof()); if(!hw_params){ perror("malloc"); return 1; } err = snd_pcm_hw_params_any(pcm, hw_params); if(err < 0){ printf("snd_pcm_hw_params_current: %d\n", err); return 1; } min_periods = 0xdeadbeef; min_periods_dir = 0xdeadbeef; err = snd_pcm_hw_params_get_periods_min(hw_params, &min_periods, &min_periods_dir); if(err < 0){ printf("snd_pcm_hw_params_get_periods_min: %d\n", err); return 1; } max_periods = 0xdeadbeef; max_periods_dir = 0xdeadbeef; err = snd_pcm_hw_params_get_periods_max(hw_params, &max_periods, &max_periods_dir); if(err < 0){ printf("snd_pcm_hw_params_get_periods_max: %d\n", err); return 1; } err = snd_pcm_hw_params_set_periods(pcm, hw_params, 10, 0); if(err < 0){ printf("snd_pcm_hw_params_set_periods: %d\n", err); return 1; } err = snd_pcm_hw_params_set_period_size(pcm, hw_params, 1024, 0); if(err < 0){ printf("snd_pcm_hw_params_set_period_size: %d\n", err); return 1; } err = snd_pcm_hw_params_get_buffer_size_max(hw_params, &buffer_frames); if(err < 0){ printf("snd_pcm_hw_params_get_buffer_size: %d\n", err); return 1; } err = snd_pcm_hw_params_get_buffer_size_min(hw_params, &buffer_frames); if(err < 0){ printf("snd_pcm_hw_params_get_buffer_size: %d\n", err); return 1; } printf("min_buffer_frames: %u\n", buffer_frames); err = snd_pcm_hw_params_set_buffer_size_max(pcm, hw_params, &buffer_frames); if(err < 0){ printf("snd_pcm_hw_params_get_buffer_size: %d\n", err); return 1; } printf("set max buffer size: %u\n", buffer_frames); err = snd_pcm_hw_params(pcm, hw_params); if(err < 0){ printf("snd_pcm_hw_params: %d\n", err); return 1; } err = snd_pcm_hw_params_get_buffer_size(hw_params, &buffer_frames); if(err < 0){ printf("snd_pcm_hw_params_get_buffer_size: %d\n", err); return 1; } err = snd_pcm_hw_params_get_period_size(hw_params, &period_frames, &period_dir); if(err < 0){ printf("snd_pcm_hw_params_get_period_size: %d\n", err); return 1; } periods = 0xdeadbeef; periods_dir = 0xdeadbeef; err = snd_pcm_hw_params_get_periods(hw_params, &periods, &periods_dir); if(err < 0){ printf("snd_pcm_hw_params_get_periods: %d\n", err); return 1; } printf("min_periods: %u, max_periods: %u, buffer_frames: %lu, period_frames: %lu, buf/per: %f, periods: %u, periods_dir: %d\n", min_periods, max_periods, buffer_frames, period_frames, buffer_frames / (double)period_frames, periods, periods_dir); free(hw_params); snd_pcm_close(pcm); return 0; } [-- Attachment #3: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] Improve hw_params documentation 2011-11-16 21:31 ` Andrew Eikum @ 2011-11-16 22:08 ` Clemens Ladisch 2011-11-17 14:02 ` Andrew Eikum 2011-11-17 0:45 ` Raymond Yau 1 sibling, 1 reply; 11+ messages in thread From: Clemens Ladisch @ 2011-11-16 22:08 UTC (permalink / raw) To: Andrew Eikum; +Cc: alsa-devel On 11/16/2011 10:31 PM, Andrew Eikum wrote: > On Wed, Nov 16, 2011 at 10:20:07PM +0100, Clemens Ladisch wrote: >> Andrew Eikum wrote: >>> +++ b/include/pcm.h >>> @@ -44,8 +44,20 @@ extern "C" { >>> >>> /** PCM generic info container */ >>> typedef struct _snd_pcm_info snd_pcm_info_t; >>> -/** PCM hardware configuration space container */ >>> + >>> +/** PCM hardware configuration space container >>> + * >>> + * snd_pcm_hw_params_t is an opaque structure which contains a set of possible >>> + * PCM hardware configurations. For example, a given instance might include a >>> + * range of buffer sizes, a range of period sizes, and a set of several sample >>> + * formats. Some subset of all possible combinations these sets may be valid, >>> + * but not necessarily any combination will be valid. >>> + * >>> + * No validation is done by the various snd_pcm_hw_params_set* functions. >> >> These functions do validate the value that the application is trying to set >> and adjust all other dependent limits. > > I didn't find that to be the case in my testing, at least between > periods, period_size, and buffer_size. I've attached a test program > here. I can reproduce this. Try running the program with LIBASOUND_DEBUG=1; it appears that there is a bug in the rate plugin. (Normal programs actually set their rate ...) Regards, Clemens ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] Improve hw_params documentation 2011-11-16 22:08 ` Clemens Ladisch @ 2011-11-17 14:02 ` Andrew Eikum 2011-11-21 22:31 ` Raymond Yau 0 siblings, 1 reply; 11+ messages in thread From: Andrew Eikum @ 2011-11-17 14:02 UTC (permalink / raw) To: Clemens Ladisch; +Cc: Andrew Eikum, alsa-devel On Wed, Nov 16, 2011 at 11:08:37PM +0100, Clemens Ladisch wrote: > On 11/16/2011 10:31 PM, Andrew Eikum wrote: > > On Wed, Nov 16, 2011 at 10:20:07PM +0100, Clemens Ladisch wrote: > >> Andrew Eikum wrote: > >>> +++ b/include/pcm.h > >>> @@ -44,8 +44,20 @@ extern "C" { > >>> > >>> /** PCM generic info container */ > >>> typedef struct _snd_pcm_info snd_pcm_info_t; > >>> -/** PCM hardware configuration space container */ > >>> + > >>> +/** PCM hardware configuration space container > >>> + * > >>> + * snd_pcm_hw_params_t is an opaque structure which contains a set of possible > >>> + * PCM hardware configurations. For example, a given instance might include a > >>> + * range of buffer sizes, a range of period sizes, and a set of several sample > >>> + * formats. Some subset of all possible combinations these sets may be valid, > >>> + * but not necessarily any combination will be valid. > >>> + * > >>> + * No validation is done by the various snd_pcm_hw_params_set* functions. > >> > >> These functions do validate the value that the application is trying to set > >> and adjust all other dependent limits. > > > > I didn't find that to be the case in my testing, at least between > > periods, period_size, and buffer_size. I've attached a test program > > here. > > I can reproduce this. > > Try running the program with LIBASOUND_DEBUG=1; it appears that there is > a bug in the rate plugin. (Normal programs actually set their rate ...) This doesn't change the output in any way. I checked the Arch Linux alsa-lib build script[1] and it doesn't seem to disable debugging in any obvious way. Do I have to explicitly enable debugging output and rebuild? $ LIBASOUND_DEBUG=1 ./alsa_period_count min_buffer_frames: 80 set max buffer size: 80 snd_pcm_hw_params: -12 $ [1] http://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/alsa-lib Andrew ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] Improve hw_params documentation 2011-11-17 14:02 ` Andrew Eikum @ 2011-11-21 22:31 ` Raymond Yau 2011-11-22 13:41 ` Andrew Eikum 0 siblings, 1 reply; 11+ messages in thread From: Raymond Yau @ 2011-11-21 22:31 UTC (permalink / raw) To: ALSA Development Mailing List 2011/11/17 Andrew Eikum <aeikum@codeweavers.com>: > On Wed, Nov 16, 2011 at 11:08:37PM +0100, Clemens Ladisch wrote: >> On 11/16/2011 10:31 PM, Andrew Eikum wrote: >> > On Wed, Nov 16, 2011 at 10:20:07PM +0100, Clemens Ladisch wrote: >> >> Andrew Eikum wrote: >> >>> +++ b/include/pcm.h >> >>> @@ -44,8 +44,20 @@ extern "C" { >> >>> >> >>> /** PCM generic info container */ >> >>> typedef struct _snd_pcm_info snd_pcm_info_t; >> >>> -/** PCM hardware configuration space container */ >> >>> + >> >>> +/** PCM hardware configuration space container >> >>> + * >> >>> + * snd_pcm_hw_params_t is an opaque structure which contains a set of possible >> >>> + * PCM hardware configurations. For example, a given instance might include a >> >>> + * range of buffer sizes, a range of period sizes, and a set of several sample >> >>> + * formats. Some subset of all possible combinations these sets may be valid, >> >>> + * but not necessarily any combination will be valid. >> >>> + * >> >>> + * No validation is done by the various snd_pcm_hw_params_set* functions. >> >> >> >> These functions do validate the value that the application is trying to set >> >> and adjust all other dependent limits. >> > >> > I didn't find that to be the case in my testing, at least between >> > periods, period_size, and buffer_size. I've attached a test program >> > here. >> >> I can reproduce this. >> >> Try running the program with LIBASOUND_DEBUG=1; it appears that there is >> a bug in the rate plugin. (Normal programs actually set their rate ...) > > This doesn't change the output in any way. I checked the Arch Linux > alsa-lib build script[1] and it doesn't seem to disable debugging in > any obvious way. Do I have to explicitly enable debugging output and > rebuild? > > $ LIBASOUND_DEBUG=1 ./alsa_period_count > min_buffer_frames: 80 > set max buffer size: 80 > snd_pcm_hw_params: -12 > $ > > [1] http://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/alsa-lib > There is a bug in your program which set the buffer_size_max to buffer_size_min err = snd_pcm_hw_params_set_periods(pcm, hw_params, 10, 0); if(err < 0){ printf("snd_pcm_hw_params_set_periods: %d\n", err); return 1; } err = snd_pcm_hw_params_set_period_size(pcm, hw_params, 1024, 0); if(err < 0){ printf("snd_pcm_hw_params_set_period_size: %d\n", err); return 1; } The above already set buffer size to 10240, but you set buffer_size_max to buffer_size_min (80) err = snd_pcm_hw_params_get_buffer_size_min(hw_params, &buffer_frames); if(err < 0){ printf("snd_pcm_hw_params_get_buffer_size: %d\n", err); return 1; } printf("min_buffer_frames: %u\n", buffer_frames); err = snd_pcm_hw_params_set_buffer_size_max(pcm, hw_params, &buffer_frames); if(err < 0){ printf("snd_pcm_hw_params_get_buffer_size: %d\n", err); return 1; } printf("set max buffer size: %u\n", buffer_frames); ./alsa_period_count pulse refine_soft 'pulse' (begin) ACCESS: RW_INTERLEAVED FORMAT: U8 S16_LE S16_BE S32_LE S32_BE FLOAT_LE FLOAT_BE MU_LAW A_LAW SUBFORMAT: ALL SAMPLE_BITS: ALL FRAME_BITS: ALL CHANNELS: [1 32] RATE: [1 192000] PERIOD_TIME: ALL PERIOD_SIZE: ALL PERIOD_BYTES: ALL PERIODS: ALL BUFFER_TIME: ALL BUFFER_SIZE: ALL BUFFER_BYTES: ALL TICK_TIME: ALL Rule 0 (0x160f80): FORMAT= U8 S16_LE S16_BE S32_LE S32_BE FLOAT_LE FLOAT_BE MU_LAW A_LAW -> U8 S16_LE S16_BE S32_LE S32_BE FLOAT_LE FLOAT_BE MU_LAW A_LAW SAMPLE_BITS=[1 4294967295] Rule 1 (0x160e70): SAMPLE_BITS=[1 4294967295] -> [8 32] FORMAT= U8 S16_LE S16_BE S32_LE S32_BE FLOAT_LE FLOAT_BE MU_LAW A_LAW SAMPLE_BITS=[8 32] Rule 2 (0x160df0): SAMPLE_BITS=[8 32] -> [8 32] FRAME_BITS=[1 4294967295] CHANNELS=[1 32] Rule 3 (0x160d70): FRAME_BITS=[1 4294967295] -> [8 1024] SAMPLE_BITS=[8 32] CHANNELS=[1 32] Rule 4 (0x160cf0): FRAME_BITS=[8 1024] -> [8 1024] PERIOD_BYTES=ALL PERIOD_SIZE=ALL Rule 5 (0x160cf0): FRAME_BITS=[8 1024] -> [8 1024] BUFFER_BYTES=[1 4294967295] BUFFER_SIZE=[1 4294967295] Rule 6 (0x160df0): CHANNELS=[1 32] -> [1 32] FRAME_BITS=[8 1024] SAMPLE_BITS=[8 32] Rule 7 (0x160cf0): RATE=[1 192000] -> [1 192000] PERIOD_SIZE=ALL PERIOD_TIME=ALL Rule 8 (0x160cf0): RATE=[1 192000] -> [1 192000] BUFFER_SIZE=[1 4294967295] BUFFER_TIME=[1 4294967295] Rule 9 (0x160df0): PERIODS=ALL -> (0 4294967295] BUFFER_SIZE=[1 4294967295] PERIOD_SIZE=ALL Rule 10 (0x160df0): PERIOD_SIZE=ALL -> (0 4294967295] BUFFER_SIZE=[1 4294967295] PERIODS=(0 4294967295] Rule 11 (0x160cf0): PERIOD_SIZE=(0 4294967295] -> (0 4294967295] PERIOD_BYTES=ALL FRAME_BITS=[8 1024] Rule 12 (0x160c70): PERIOD_SIZE=(0 4294967295] -> (0 824633721) PERIOD_TIME=ALL RATE=[1 192000] Rule 13 (0x160d70): BUFFER_SIZE=[1 4294967295] -> [1 4294967294] PERIOD_SIZE=(0 824633721) PERIODS=(0 4294967295] Rule 14 (0x160cf0): BUFFER_SIZE=[1 4294967294] -> [1 4294967294] BUFFER_BYTES=[1 4294967295] FRAME_BITS=[8 1024] Rule 15 (0x160c70): BUFFER_SIZE=[1 4294967294] -> [1 824633720] BUFFER_TIME=[1 4294967295] RATE=[1 192000] Rule 16 (0x160c70): PERIOD_BYTES=ALL -> (0 4294967295) PERIOD_SIZE=(0 824633721) FRAME_BITS=[8 1024] Rule 17 (0x160c70): BUFFER_BYTES=[1 4294967295] -> [1 4294967295] BUFFER_SIZE=[1 824633720] FRAME_BITS=[8 1024] Rule 18 (0x160cf0): PERIOD_TIME=ALL -> (0 4294967295) PERIOD_SIZE=(0 824633721) RATE=[1 192000] Rule 19 (0x160cf0): BUFFER_TIME=[1 4294967295] -> (5 4294967295] BUFFER_SIZE=[1 824633720] RATE=[1 192000] Rule 0 (0x160f80): FORMAT= U8 S16_LE S16_BE S32_LE S32_BE FLOAT_LE FLOAT_BE MU_LAW A_LAW -> U8 S16_LE S16_BE S32_LE S32_BE FLOAT_LE FLOAT_BE MU_LAW A_LAW SAMPLE_BITS=[8 32] Rule 2 (0x160df0): SAMPLE_BITS=[8 32] -> [8 32] FRAME_BITS=[8 1024] CHANNELS=[1 32] Rule 4 (0x160cf0): FRAME_BITS=[8 1024] -> [8 1024] PERIOD_BYTES=(0 4294967295) PERIOD_SIZE=(0 824633721) Rule 5 (0x160cf0): FRAME_BITS=[8 1024] -> [8 1024] BUFFER_BYTES=[1 4294967295] BUFFER_SIZE=[1 824633720] Rule 7 (0x160cf0): RATE=[1 192000] -> [1 192000] PERIOD_SIZE=(0 824633721) PERIOD_TIME=(0 4294967295) Rule 8 (0x160cf0): RATE=[1 192000] -> [1 192000] BUFFER_SIZE=[1 824633720] BUFFER_TIME=(5 4294967295] Rule 9 (0x160df0): PERIODS=(0 4294967295] -> (0 4294967295] BUFFER_SIZE=[1 824633720] PERIOD_SIZE=(0 824633721) Rule 10 (0x160df0): PERIOD_SIZE=(0 824633721) -> (0 824633721) BUFFER_SIZE=[1 824633720] PERIODS=(0 4294967295] Rule 11 (0x160cf0): PERIOD_SIZE=(0 824633721) -> (0 824633721) PERIOD_BYTES=(0 4294967295) FRAME_BITS=[8 1024] Rule 12 (0x160c70): PERIOD_SIZE=(0 824633721) -> (0 824633721) PERIOD_TIME=(0 4294967295) RATE=[1 192000] Rule 15 (0x160c70): BUFFER_SIZE=[1 824633720] -> [1 824633720] BUFFER_TIME=(5 4294967295] RATE=[1 192000] min periods 3 max periods 1024 min_buffer_frames: 80 set max buffer size: 80 refine_soft 'pulse' (begin) ACCESS: RW_INTERLEAVED FORMAT: U8 SUBFORMAT: STD SAMPLE_BITS: [8 32] FRAME_BITS: [8 1024] CHANNELS: [1 32] RATE: [1 192000] PERIOD_TIME: (5333 1024000000] PERIOD_SIZE: 1024 PERIOD_BYTES: 1024 PERIODS: 10 BUFFER_TIME: (416 80000000] BUFFER_SIZE: 80 BUFFER_BYTES: 10240 TICK_TIME: ALL Rule 1 (0x160e70): SAMPLE_BITS=[8 32] -> 8 FORMAT= U8 SAMPLE_BITS=8 Rule 3 (0x160d70): FRAME_BITS=[8 1024] -> [8 256] SAMPLE_BITS=8 CHANNELS=[1 32] Rule 4 (0x160cf0): FRAME_BITS=[8 256] -> 8 PERIOD_BYTES=1024 PERIOD_SIZE=1024 Rule 5 (0x160cf0): FRAME_BITS=8 -> NONE BUFFER_BYTES=10240 BUFFER_SIZE=80 refine_soft 'pulse' (end--22) ACCESS: RW_INTERLEAVED FORMAT: U8 SUBFORMAT: STD SAMPLE_BITS: 8 FRAME_BITS: NONE CHANNELS: [1 32] RATE: [1 192000] PERIOD_TIME: (5333 1024000000] PERIOD_SIZE: 1024 PERIOD_BYTES: 1024 PERIODS: 10 BUFFER_TIME: (416 80000000] BUFFER_SIZE: 80 BUFFER_BYTES: 10240 TICK_TIME: ALL snd_pcm_hw_params: -12 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] Improve hw_params documentation 2011-11-21 22:31 ` Raymond Yau @ 2011-11-22 13:41 ` Andrew Eikum 2011-11-22 23:57 ` Raymond Yau 0 siblings, 1 reply; 11+ messages in thread From: Andrew Eikum @ 2011-11-22 13:41 UTC (permalink / raw) To: Raymond Yau; +Cc: ALSA Development Mailing List On Tue, Nov 22, 2011 at 06:31:03AM +0800, Raymond Yau wrote: > 2011/11/17 Andrew Eikum <aeikum@codeweavers.com>: > > On Wed, Nov 16, 2011 at 11:08:37PM +0100, Clemens Ladisch wrote: > >> On 11/16/2011 10:31 PM, Andrew Eikum wrote: > >> > On Wed, Nov 16, 2011 at 10:20:07PM +0100, Clemens Ladisch wrote: > >> >> Andrew Eikum wrote: > >> >>> +++ b/include/pcm.h > >> >>> @@ -44,8 +44,20 @@ extern "C" { > >> >>> > >> >>> /** PCM generic info container */ > >> >>> typedef struct _snd_pcm_info snd_pcm_info_t; > >> >>> -/** PCM hardware configuration space container */ > >> >>> + > >> >>> +/** PCM hardware configuration space container > >> >>> + * > >> >>> + * snd_pcm_hw_params_t is an opaque structure which contains a set of possible > >> >>> + * PCM hardware configurations. For example, a given instance might include a > >> >>> + * range of buffer sizes, a range of period sizes, and a set of several sample > >> >>> + * formats. Some subset of all possible combinations these sets may be valid, > >> >>> + * but not necessarily any combination will be valid. > >> >>> + * > >> >>> + * No validation is done by the various snd_pcm_hw_params_set* functions. > >> >> > >> >> These functions do validate the value that the application is trying to set > >> >> and adjust all other dependent limits. > >> > > >> > I didn't find that to be the case in my testing, at least between > >> > periods, period_size, and buffer_size. I've attached a test program > >> > here. > >> > >> I can reproduce this. > >> > >> Try running the program with LIBASOUND_DEBUG=1; it appears that there is > >> a bug in the rate plugin. (Normal programs actually set their rate ...) > > > > This doesn't change the output in any way. I checked the Arch Linux > > alsa-lib build script[1] and it doesn't seem to disable debugging in > > any obvious way. Do I have to explicitly enable debugging output and > > rebuild? > > > > $ LIBASOUND_DEBUG=1 ./alsa_period_count > > min_buffer_frames: 80 > > set max buffer size: 80 > > snd_pcm_hw_params: -12 > > $ > > > > [1] http://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/alsa-lib > > > > There is a bug in your program which set the buffer_size_max to buffer_size_min > > err = snd_pcm_hw_params_set_periods(pcm, hw_params, 10, 0); > if(err < 0){ > printf("snd_pcm_hw_params_set_periods: %d\n", err); > return 1; > } > > err = snd_pcm_hw_params_set_period_size(pcm, hw_params, 1024, 0); > if(err < 0){ > printf("snd_pcm_hw_params_set_period_size: %d\n", err); > return 1; > } > > The above already set buffer size to 10240, but you set > buffer_size_max to buffer_size_min (80) > > err = snd_pcm_hw_params_get_buffer_size_min(hw_params, &buffer_frames); > if(err < 0){ > printf("snd_pcm_hw_params_get_buffer_size: %d\n", err); > return 1; > } > printf("min_buffer_frames: %u\n", buffer_frames); > > err = snd_pcm_hw_params_set_buffer_size_max(pcm, hw_params, &buffer_frames); > if(err < 0){ > printf("snd_pcm_hw_params_get_buffer_size: %d\n", err); > return 1; > } > printf("set max buffer size: %u\n", buffer_frames); > Yes, that's exactly my point. I would expect set_buffer_size_max() to fail, since it's incompatible with the parameters set earlier. Instead, it succeeds. Andrew _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] Improve hw_params documentation 2011-11-22 13:41 ` Andrew Eikum @ 2011-11-22 23:57 ` Raymond Yau 0 siblings, 0 replies; 11+ messages in thread From: Raymond Yau @ 2011-11-22 23:57 UTC (permalink / raw) To: ALSA Development Mailing List 2011/11/22 Andrew Eikum <aeikum@codeweavers.com>: > On Tue, Nov 22, 2011 at 06:31:03AM +0800, Raymond Yau wrote: >> 2011/11/17 Andrew Eikum <aeikum@codeweavers.com>: >> > On Wed, Nov 16, 2011 at 11:08:37PM +0100, Clemens Ladisch wrote: >> >> On 11/16/2011 10:31 PM, Andrew Eikum wrote: >> >> > On Wed, Nov 16, 2011 at 10:20:07PM +0100, Clemens Ladisch wrote: >> >> >> Andrew Eikum wrote: >> >> >>> +++ b/include/pcm.h >> >> >>> @@ -44,8 +44,20 @@ extern "C" { >> >> >>> >> >> >>> /** PCM generic info container */ >> >> >>> typedef struct _snd_pcm_info snd_pcm_info_t; >> >> >>> -/** PCM hardware configuration space container */ >> >> >>> + >> >> >>> +/** PCM hardware configuration space container >> >> >>> + * >> >> >>> + * snd_pcm_hw_params_t is an opaque structure which contains a set of possible >> >> >>> + * PCM hardware configurations. For example, a given instance might include a >> >> >>> + * range of buffer sizes, a range of period sizes, and a set of several sample >> >> >>> + * formats. Some subset of all possible combinations these sets may be valid, >> >> >>> + * but not necessarily any combination will be valid. >> >> >>> + * >> >> >>> + * No validation is done by the various snd_pcm_hw_params_set* functions. >> >> >> >> >> >> These functions do validate the value that the application is trying to set >> >> >> and adjust all other dependent limits. >> >> > >> >> > I didn't find that to be the case in my testing, at least between >> >> > periods, period_size, and buffer_size. I've attached a test program >> >> > here. >> >> >> >> I can reproduce this. >> >> >> >> Try running the program with LIBASOUND_DEBUG=1; it appears that there is >> >> a bug in the rate plugin. (Normal programs actually set their rate ...) >> > >> > This doesn't change the output in any way. I checked the Arch Linux >> > alsa-lib build script[1] and it doesn't seem to disable debugging in >> > any obvious way. Do I have to explicitly enable debugging output and >> > rebuild? >> > >> > $ LIBASOUND_DEBUG=1 ./alsa_period_count >> > min_buffer_frames: 80 >> > set max buffer size: 80 >> > snd_pcm_hw_params: -12 >> > $ >> > >> > [1] http://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/alsa-lib >> > >> >> There is a bug in your program which set the buffer_size_max to buffer_size_min >> >> err = snd_pcm_hw_params_set_periods(pcm, hw_params, 10, 0); >> if(err < 0){ >> printf("snd_pcm_hw_params_set_periods: %d\n", err); >> return 1; >> } >> >> err = snd_pcm_hw_params_set_period_size(pcm, hw_params, 1024, 0); >> if(err < 0){ >> printf("snd_pcm_hw_params_set_period_size: %d\n", err); >> return 1; >> } >> >> The above already set buffer size to 10240, but you set >> buffer_size_max to buffer_size_min (80) >> >> err = snd_pcm_hw_params_get_buffer_size_min(hw_params, &buffer_frames); >> if(err < 0){ >> printf("snd_pcm_hw_params_get_buffer_size: %d\n", err); >> return 1; >> } >> printf("min_buffer_frames: %u\n", buffer_frames); >> >> err = snd_pcm_hw_params_set_buffer_size_max(pcm, hw_params, &buffer_frames); >> if(err < 0){ >> printf("snd_pcm_hw_params_get_buffer_size: %d\n", err); >> return 1; >> } >> printf("set max buffer size: %u\n", buffer_frames); >> > > Yes, that's exactly my point. I would expect set_buffer_size_max() to > fail, since it's incompatible with the parameters set earlier. > Instead, it succeeds. > snd_pcm_hw_params_get_buffer_size_min() return a wrong value (80) so far , your program still work with "hw", "dmix" and "jack" It seem the bug is only occur with "pulse" plugin. "pulse" can get the correct value 10240 after you set the format , rate and channels "dmix" has a default period size of 1024 "jack" support FLOAT only and a default rate obtained from jack server and a channel map in .asoundrc pcm.jack { type jack playback_ports { 0 alsa_pcm:playback_1 1 alsa_pcm:playback_2 } capture_ports { 0 alsa_pcm:capture_1 1 alsa_pcm:capture_2 } } ./alsa_period_count jack refine_soft 'jack' (begin) ACCESS: MMAP_INTERLEAVED MMAP_NONINTERLEAVED RW_INTERLEAVED RW_NONINTERLEAVED FORMAT: FLOAT_LE SUBFORMAT: ALL SAMPLE_BITS: ALL FRAME_BITS: ALL CHANNELS: 2 RATE: 44100 PERIOD_TIME: ALL PERIOD_SIZE: ALL PERIOD_BYTES: ALL PERIODS: ALL BUFFER_TIME: ALL BUFFER_SIZE: ALL BUFFER_BYTES: ALL TICK_TIME: ALL Rule 0 (0xea7f80): FORMAT= FLOAT_LE -> FLOAT_LE SAMPLE_BITS=[1 4294967295] Rule 1 (0xea7e70): SAMPLE_BITS=[1 4294967295] -> 32 FORMAT= FLOAT_LE SAMPLE_BITS=32 Rule 2 (0xea7df0): SAMPLE_BITS=32 -> 32 FRAME_BITS=[1 4294967295] CHANNELS=2 Rule 3 (0xea7d70): FRAME_BITS=[1 4294967295] -> 64 SAMPLE_BITS=32 CHANNELS=2 Rule 4 (0xea7cf0): FRAME_BITS=64 -> 64 PERIOD_BYTES=ALL PERIOD_SIZE=ALL Rule 5 (0xea7cf0): FRAME_BITS=64 -> 64 BUFFER_BYTES=[1 4294967295] BUFFER_SIZE=[1 4294967295] Rule 6 (0xea7df0): CHANNELS=2 -> 2 FRAME_BITS=64 SAMPLE_BITS=32 Rule 7 (0xea7cf0): RATE=44100 -> 44100 PERIOD_SIZE=ALL PERIOD_TIME=ALL Rule 8 (0xea7cf0): RATE=44100 -> 44100 BUFFER_SIZE=[1 4294967295] BUFFER_TIME=[1 4294967295] Rule 9 (0xea7df0): PERIODS=ALL -> (0 4294967295] BUFFER_SIZE=[1 4294967295] PERIOD_SIZE=ALL Rule 10 (0xea7df0): PERIOD_SIZE=ALL -> (0 4294967295] BUFFER_SIZE=[1 4294967295] PERIODS=(0 4294967295] Rule 11 (0xea7cf0): PERIOD_SIZE=(0 4294967295] -> (0 536870912) PERIOD_BYTES=ALL FRAME_BITS=64 Rule 12 (0xea7c70): PERIOD_SIZE=(0 536870912) -> (0 189408058) PERIOD_TIME=ALL RATE=44100 Rule 13 (0xea7d70): BUFFER_SIZE=[1 4294967295] -> [1 4294967294] PERIOD_SIZE=(0 189408058) PERIODS=(0 4294967295] Rule 14 (0xea7cf0): BUFFER_SIZE=[1 4294967294] -> [1 536870911] BUFFER_BYTES=[1 4294967295] FRAME_BITS=64 Rule 15 (0xea7c70): BUFFER_SIZE=[1 536870911] -> [1 189408057] BUFFER_TIME=[1 4294967295] RATE=44100 Rule 16 (0xea7c70): PERIOD_BYTES=ALL -> (0 1515264464) PERIOD_SIZE=(0 189408058) FRAME_BITS=64 Rule 17 (0xea7c70): BUFFER_BYTES=[1 4294967295] -> [8 1515264456] BUFFER_SIZE=[1 189408057] FRAME_BITS=64 Rule 18 (0xea7cf0): PERIOD_TIME=ALL -> (0 4294967295) PERIOD_SIZE=(0 189408058) RATE=44100 Rule 19 (0xea7cf0): BUFFER_TIME=[1 4294967295] -> (22 4294967279) BUFFER_SIZE=[1 189408057] RATE=44100 Rule 0 (0xea7f80): FORMAT= FLOAT_LE -> FLOAT_LE SAMPLE_BITS=32 Rule 2 (0xea7df0): SAMPLE_BITS=32 -> 32 FRAME_BITS=64 CHANNELS=2 Rule 4 (0xea7cf0): FRAME_BITS=64 -> 64 PERIOD_BYTES=(0 1515264464) PERIOD_SIZE=(0 189408058) Rule 5 (0xea7cf0): FRAME_BITS=64 -> 64 BUFFER_BYTES=[8 1515264456] BUFFER_SIZE=[1 189408057] Rule 7 (0xea7cf0): RATE=44100 -> 44100 PERIOD_SIZE=(0 189408058) PERIOD_TIME=(0 4294967295) Rule 8 (0xea7cf0): RATE=44100 -> 44100 BUFFER_SIZE=[1 189408057] BUFFER_TIME=(22 4294967279) Rule 9 (0xea7df0): PERIODS=(0 4294967295] -> (0 4294967295] BUFFER_SIZE=[1 189408057] PERIOD_SIZE=(0 189408058) Rule 10 (0xea7df0): PERIOD_SIZE=(0 189408058) -> (0 189408058) BUFFER_SIZE=[1 189408057] PERIODS=(0 4294967295] Rule 11 (0xea7cf0): PERIOD_SIZE=(0 189408058) -> (0 189408058) PERIOD_BYTES=(0 1515264464) FRAME_BITS=64 Rule 12 (0xea7c70): PERIOD_SIZE=(0 189408058) -> (0 189408058) PERIOD_TIME=(0 4294967295) RATE=44100 Rule 14 (0xea7cf0): BUFFER_SIZE=[1 189408057] -> [1 189408057] BUFFER_BYTES=[8 1515264456] FRAME_BITS=64 Rule 15 (0xea7c70): BUFFER_SIZE=[1 189408057] -> [1 189408057] BUFFER_TIME=(22 4294967279) RATE=44100 min periods 2 dir 0 max periods 64 dir 0 min_buffer_frames: 10240 set max buffer size: 10240 refine_soft 'jack' (begin) ACCESS: MMAP_INTERLEAVED FORMAT: FLOAT_LE SUBFORMAT: STD SAMPLE_BITS: 32 FRAME_BITS: 64 CHANNELS: 2 RATE: 44100 PERIOD_TIME: (23219 23220) PERIOD_SIZE: 1024 PERIOD_BYTES: 8192 PERIODS: 10 BUFFER_TIME: (232199 232200) BUFFER_SIZE: 10240 BUFFER_BYTES: 81920 TICK_TIME: ALL Rule 4 (0xea7cf0): FRAME_BITS=64 -> 64 PERIOD_BYTES=8192 PERIOD_SIZE=1024 Rule 7 (0xea7cf0): RATE=44100 -> 44100 PERIOD_SIZE=1024 PERIOD_TIME=(23219 23220) Rule 9 (0xea7df0): PERIODS=10 -> 10 BUFFER_SIZE=10240 PERIOD_SIZE=1024 Rule 10 (0xea7df0): PERIOD_SIZE=1024 -> 1024 BUFFER_SIZE=10240 PERIODS=10 Rule 13 (0xea7d70): BUFFER_SIZE=10240 -> 10240 PERIOD_SIZE=1024 PERIODS=10 Rule 16 (0xea7c70): PERIOD_BYTES=8192 -> 8192 PERIOD_SIZE=1024 FRAME_BITS=64 Rule 18 (0xea7cf0): PERIOD_TIME=(23219 23220) -> (23219 23220) PERIOD_SIZE=1024 RATE=44100 min_periods: 2, max_periods: 64, buffer_frames: 10240, period_frames: 1024, buf/per: 10.000000, periods: 10, periods_dir: 0 ALSA <-> JACK PCM I/O Plugin Its setup is: stream : PLAYBACK access : MMAP_INTERLEAVED format : FLOAT_LE subformat : STD channels : 2 rate : 44100 exact rate : 44100 (44100/1) msbits : 32 buffer_size : 10240 period_size : 1024 period_time : 23219 tstamp_mode : NONE period_step : 1 avail_min : 1024 period_event : 0 start_threshold : 1 stop_threshold : 10240 silence_threshold: 0 silence_size : 0 boundary : 1342177280 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] Improve hw_params documentation 2011-11-16 21:31 ` Andrew Eikum 2011-11-16 22:08 ` Clemens Ladisch @ 2011-11-17 0:45 ` Raymond Yau 2011-11-17 13:27 ` Clemens Ladisch 1 sibling, 1 reply; 11+ messages in thread From: Raymond Yau @ 2011-11-17 0:45 UTC (permalink / raw) To: ALSA Development Mailing List 2011/11/17 Andrew Eikum <aeikum@codeweavers.com>: > On Wed, Nov 16, 2011 at 10:20:07PM +0100, Clemens Ladisch wrote: >> Andrew Eikum wrote: >> > +++ b/include/pcm.h >> > @@ -44,8 +44,20 @@ extern "C" { >> > >> > /** PCM generic info container */ >> > typedef struct _snd_pcm_info snd_pcm_info_t; >> > -/** PCM hardware configuration space container */ >> > + >> > +/** PCM hardware configuration space container >> > + * >> > + * snd_pcm_hw_params_t is an opaque structure which contains a set of possible >> > + * PCM hardware configurations. For example, a given instance might include a >> > + * range of buffer sizes, a range of period sizes, and a set of several sample >> > + * formats. Some subset of all possible combinations these sets may be valid, >> > + * but not necessarily any combination will be valid. >> > + * >> > + * No validation is done by the various snd_pcm_hw_params_set* functions. >> >> These functions do validate the value that the application is trying to set >> and adjust all other dependent limits. >> > > I didn't find that to be the case in my testing, at least between > periods, period_size, and buffer_size. I've attached a test program > here. It sets periods to 10, period_size to 1024, and buffer_size_max > to be the same as the return from get_buffer_size_min (in my case, > 80). The first call to fail is snd_pcm_hw_params(). If what you said > is true, I would expect the set_buffer_size_max() call to fail. > > $ gcc -I /usr/include/alsa -lasound -o alsa_period_count alsa_period_count.c > $ ./alsa_period_count > min_buffer_frames: 80 > set max buffer size: 80 > snd_pcm_hw_params: -12 > $ > > Andrew > The logic of your program is wrong since your program did not set channel, rate and format There are sound cards which support S16 and U8, mono and stereo. As "default" device using "plug:dmix" , "pulse" or "hw" The buffer and period calculation is only valid after you have choose the format and channels http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html Hardware related parameters The ALSA PCM devices use the parameter refining system for hardware parameters - snd_pcm_hw_params_t. It means, that application choose the full-range of configurations at first and then application sets single parameters until all parameters are elementary (definite). ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] Improve hw_params documentation 2011-11-17 0:45 ` Raymond Yau @ 2011-11-17 13:27 ` Clemens Ladisch 2011-11-19 1:28 ` Raymond Yau 0 siblings, 1 reply; 11+ messages in thread From: Clemens Ladisch @ 2011-11-17 13:27 UTC (permalink / raw) To: alsa-devel Raymond Yau wrote: > The logic of your program is wrong since your program did not set > channel, rate and format It is allowed to not set some parameters; snd_pcm_hw_params() then chooses some random values for them. > The buffer and period calculation is only valid after you have choose > the format and channels This is wrong; parameters can be set in any order. (As long as format/channels are not yet set, the exact relationship between frames and bytes is not yet known, but this is handled by the parameters being intervals.) Regards, Clemens ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] Improve hw_params documentation 2011-11-17 13:27 ` Clemens Ladisch @ 2011-11-19 1:28 ` Raymond Yau 0 siblings, 0 replies; 11+ messages in thread From: Raymond Yau @ 2011-11-19 1:28 UTC (permalink / raw) To: ALSA Development Mailing List 2011/11/17 Clemens Ladisch <clemens@ladisch.de>: > Raymond Yau wrote: >> The logic of your program is wrong since your program did not set >> channel, rate and format > > It is allowed to not set some parameters; snd_pcm_hw_params() then > chooses some random values for them. > >> The buffer and period calculation is only valid after you have choose >> the format and channels > > This is wrong; parameters can be set in any order. > (As long as format/channels are not yet set, the exact relationship > between frames and bytes is not yet known, but this is handled by > the parameters being intervals.) > > it return error at snd_pcm_hw_params_set_periods( 10,0) after I reverted commit 6dab1a91cbbd40d2f52a0c5a1bd961a1db7bb319 pcm: recalculate all rules after changing hw_params flags params->flags |= SND_PCM_HW_PARAMS_EXPORT_BUFFER; else params->flags &= ~SND_PCM_HW_PARAMS_EXPORT_BUFFER; - params->rmask = ~0; return snd_pcm_hw_refine(pcm, params); } /alsa_period_count plug:dmix:1 min periods 0 max periods 8623621 ALSA ERROR hw_params: set (PERIODS) value = 10 : Invalid argument ACCESS: MMAP_INTERLEAVED MMAP_NONINTERLEAVED MMAP_COMPLEX RW_INTERLEAVED RW_NONINTERLEAVED FORMAT: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE MU_LAW A_LAW IMA_ADPCM S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE U18_3BE SUBFORMAT: STD SAMPLE_BITS: [4 64] FRAME_BITS: [4 640000] CHANNELS: [1 10000] RATE: [4000 4294967295) PERIOD_TIME: (21333 21334) PERIOD_SIZE: (85 91628833) PERIOD_BYTES: (42 4294967295) PERIODS: (0 8623621) BUFFER_TIME: [1 4294967295] BUFFER_SIZE: [170 733007751] BUFFER_BYTES: [85 4294967295] TICK_TIME: ALL snd_pcm_hw_params_set_periods: -22 default prealloc of snd-hda-intel is 64Kbytes, 10 periods of 1024 frame for S32_LE and 2 channels is 80Kbytes aplay -v --buffer-size=10240 --period-size=1024 -D"plug:'dmix:1'" any.wav Playing WAVE 'any.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo Plug PCM: Rate conversion PCM (48000, sformat=S32_LE) Converter: libspeex (builtin) Protocol version: 10002 Its setup is: stream : PLAYBACK access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 44100 exact rate : 44100 (44100/1) msbits : 16 buffer_size : 7526 period_size : 940 period_time : 21333 tstamp_mode : NONE period_step : 1 avail_min : 940 period_event : 0 start_threshold : 7526 stop_threshold : 7526 silence_threshold: 0 silence_size : 0 boundary : 986447872 Slave: Direct Stream Mixing PCM Its setup is: stream : PLAYBACK access : MMAP_INTERLEAVED format : S32_LE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 32 buffer_size : 8192 period_size : 1024 period_time : 21333 tstamp_mode : NONE period_step : 1 avail_min : 1024 period_event : 0 start_threshold : 8192 stop_threshold : 8192 silence_threshold: 0 silence_size : 0 boundary : 1073741824 Hardware PCM card 1 'HDA Intel' device 0 subdevice 0 Its setup is: stream : PLAYBACK access : MMAP_INTERLEAVED format : S32_LE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 32 buffer_size : 8192 period_size : 1024 period_time : 21333 tstamp_mode : ENABLE period_step : 1 avail_min : 1024 period_event : 0 start_threshold : 1 stop_threshold : 1073741824 silence_threshold: 0 silence_size : 1073741824 boundary : 1073741824 appl_ptr : 0 hw_ptr : 0 ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-11-22 23:57 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-11-16 19:56 [PATCH 2/2] Improve hw_params documentation Andrew Eikum 2011-11-16 21:20 ` Clemens Ladisch 2011-11-16 21:31 ` Andrew Eikum 2011-11-16 22:08 ` Clemens Ladisch 2011-11-17 14:02 ` Andrew Eikum 2011-11-21 22:31 ` Raymond Yau 2011-11-22 13:41 ` Andrew Eikum 2011-11-22 23:57 ` Raymond Yau 2011-11-17 0:45 ` Raymond Yau 2011-11-17 13:27 ` Clemens Ladisch 2011-11-19 1:28 ` Raymond Yau
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.