alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* snd_pcm_hw_params_current() always returning zero for periods and buffer_time
       [not found] <1660214714498842955-webhooks-bot@alsa-project.org>
@ 2022-08-11 10:45 ` GitHub issues - opened
  0 siblings, 0 replies; only message in thread
From: GitHub issues - opened @ 2022-08-11 10:45 UTC (permalink / raw)
  To: alsa-devel

alsa-project/alsa-lib issue #258 was opened from ossilator:

as can be reproduced rather easily using pyalsaaudio's pcm.dumpinfo(), snd_pcm_hw_params_current() seems to always return zero for periods and buffer_time, at least for playback streams (i didn't test capture).

the sequence is basically this:
```
snd_pcm_hw_params_any(...);
...
unsigned periods = 4;
snd_pcm_hw_params_set_periods_near(..., &periods, ...);
// periods is still fine here
snd_pcm_hw_params(...);

snd_pcm_hw_params_current(...);
snd_pcm_hw_params_get_periods(..., &periods, ...);
// nope, zero periods
```

i tested this with two completely different setups on two different machines (one a raw driver, another one with pipewire), so it doesn't appear related to the driver.

from the other returned parameters it can be inferred that the period count is actually fine.

one thing i noticed is that snd_pcm_hw_params_current() uses snd_interval_copy() instead of snd_interval_set_value() for exactly these two parameters. but min & max are both zero. i wasn't able to trace it down so far; both the library and the kernel code look fine.

Issue URL     : https://github.com/alsa-project/alsa-lib/issues/258
Repository URL: https://github.com/alsa-project/alsa-lib

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-11 10:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1660214714498842955-webhooks-bot@alsa-project.org>
2022-08-11 10:45 ` snd_pcm_hw_params_current() always returning zero for periods and buffer_time 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;
as well as URLs for NNTP newsgroup(s).