From: GitHub issues - edited <github@alsa-project.org>
To: alsa-devel@alsa-project.org
Subject: speaker-test: inconsistent behaviour of --buffer option.
Date: Sun, 16 Jul 2023 14:33:44 +0200 (CEST) [thread overview]
Message-ID: <20230716123344.57FD3F8047D@alsa1.perex.cz> (raw)
In-Reply-To: <1689510822921379566-webhooks-bot@alsa-project.org>
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
next parent reply other threads:[~2023-07-16 12:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1689510822921379566-webhooks-bot@alsa-project.org>
2023-07-16 12:33 ` GitHub issues - edited [this message]
[not found] <1689510816799805164-webhooks-bot@alsa-project.org>
2023-07-16 12:33 ` speaker-test: inconsistent behaviour of --buffer option GitHub issues - opened
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=20230716123344.57FD3F8047D@alsa1.perex.cz \
--to=github@alsa-project.org \
--cc=alsa-devel@alsa-project.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox