speaker-test: inconsistent behaviour of --buffer option.
alsa-project/alsa-utils issue #224 was edited from AndrewAmmerlaan:
Without specifying the `--buffer` option `speaker-test` returns this:
``` andrew@andrew-gentoo-pc ~ % speaker-test -c2 -twav -Dplughw:CARD=PCH,DEV=3
speaker-test 1.2.9
Playback device is plughw:CARD=PCH,DEV=3 Stream parameters are 48000Hz, S16_LE, 2 channels WAV file(s) Rate set to 48000Hz (requested 48000Hz) Buffer size range from 64 to 1048576 Period size range from 32 to 524288 Using max buffer size 1048576 Periods = 4 was set period_size = 262144 was set buffer_size = 1048576 0 - Front Left 1 - Front Right Write error: -77,File descriptor in bad state xrun_recovery failed: -77,File descriptor in bad state Transfer failed: File descriptor in bad state ```
Note that it says `Using max buffer size 1048576`. But now if we try to explicitly specify this maximum buffer size:
``` andrew@andrew-gentoo-pc ~ % speaker-test -c2 -twav -Dplughw:CARD=PCH,DEV=3 --buffer 1048576
speaker-test 1.2.9
Playback device is plughw:CARD=PCH,DEV=3 Stream parameters are 48000Hz, S16_LE, 2 channels WAV file(s) Rate set to 48000Hz (requested 48000Hz) Buffer size range from 64 to 1048576 Period size range from 32 to 524288 Requested buffer time 1000000 us Periods = 4 was set period_size = 12000 was set buffer_size = 48000 0 - Front Left 1 - Front Right Time per period = 2.251287 ```
Note that now we get `Requested buffer time 1000000 us` which is less then what we actually specified. In fact this will happen with any `--buffer` parameter larger then `1000000`:
``` andrew@andrew-gentoo-pc ~ % speaker-test -c2 -twav -Dplughw:CARD=PCH,DEV=3 --buffer 1000001
speaker-test 1.2.9
Playback device is plughw:CARD=PCH,DEV=3 Stream parameters are 48000Hz, S16_LE, 2 channels WAV file(s) Rate set to 48000Hz (requested 48000Hz) Buffer size range from 64 to 1048576 Period size range from 32 to 524288 Requested buffer time 1000000 us Periods = 4 was set period_size = 12000 was set buffer_size = 48000 0 - Front Left 1 - Front Right Time per period = 2.251042 ```
Leading me to believe that despite what `speaker-test` claims, `1000000` is actually the maximum, not `1048576`.
Discovered while debugging https://gitlab.freedesktop.org/drm/intel/-/issues/8462 This behaviour of `speaker-test` is confusing though and feels to me like a separate issue.
Issue URL : https://github.com/alsa-project/alsa-utils/issues/224 Repository URL: https://github.com/alsa-project/alsa-utils
participants (1)
-
GitHub issues - edited