Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* speaker-test: inconsistent behaviour of --buffer option.
       [not found] <1689510816799805164-webhooks-bot@alsa-project.org>
@ 2023-07-16 12:33 ` GitHub issues - opened
  0 siblings, 0 replies; 2+ messages in thread
From: GitHub issues - opened @ 2023-07-16 12:33 UTC (permalink / raw)
  To: alsa-devel

alsa-project/alsa-utils issue #224 was opened 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

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

* speaker-test: inconsistent behaviour of --buffer option.
       [not found] <1689510822921379566-webhooks-bot@alsa-project.org>
@ 2023-07-16 12:33 ` GitHub issues - edited
  0 siblings, 0 replies; 2+ messages in thread
From: GitHub issues - edited @ 2023-07-16 12:33 UTC (permalink / raw)
  To: alsa-devel

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

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

end of thread, other threads:[~2023-07-16 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1689510822921379566-webhooks-bot@alsa-project.org>
2023-07-16 12:33 ` speaker-test: inconsistent behaviour of --buffer option GitHub issues - edited
     [not found] <1689510816799805164-webhooks-bot@alsa-project.org>
2023-07-16 12:33 ` GitHub issues - opened

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox