mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-20 08:56:56 -05:00
alsa-util: Perform format and rate detection before setting HW params
Perform detection of supported sample format and rates just after device is
opened, before `snd_pcm_hw_params()` is called for the first time. This fixes a
problem where device restricts available sample rates after HW params are set
preventing sample rate detection (seen with UAC2 devices and kernel 6.1.9)
Bug: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1414
Bug: https://github.com/alsa-project/alsa-lib/issues/119
Link: aed52c507f
[Wim: Apply to acp add_pro_profile(), enable pa_alsa_supported_*()]
This commit is contained in:
parent
79ee2fac73
commit
082680d8a2
5 changed files with 37 additions and 5 deletions
|
|
@ -64,6 +64,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
|
|||
snd_pcm_uframes_t tsched_size,
|
||||
bool *use_mmap, /* modified at return */
|
||||
bool *use_tsched, /* modified at return */
|
||||
pa_sample_format_t **query_supported_formats, /* modified at return */
|
||||
unsigned int **query_supported_rates, /* modified at return */
|
||||
pa_alsa_profile_set *ps,
|
||||
pa_alsa_mapping **mapping); /* modified at return */
|
||||
#endif
|
||||
|
|
@ -80,6 +82,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_mapping(
|
|||
snd_pcm_uframes_t tsched_size,
|
||||
bool *use_mmap, /* modified at return */
|
||||
bool *use_tsched, /* modified at return */
|
||||
pa_sample_format_t **query_supported_formats, /* modified at return */
|
||||
unsigned int **query_supported_rates, /* modified at return */
|
||||
pa_alsa_mapping *mapping);
|
||||
|
||||
/* Opens the explicit ALSA device */
|
||||
|
|
@ -94,6 +98,8 @@ snd_pcm_t *pa_alsa_open_by_device_string(
|
|||
snd_pcm_uframes_t tsched_size,
|
||||
bool *use_mmap, /* modified at return */
|
||||
bool *use_tsched, /* modified at return */
|
||||
pa_sample_format_t **query_supported_formats, /* modified at return */
|
||||
unsigned int **query_supported_rates, /* modified at return */
|
||||
bool require_exact_channel_number);
|
||||
|
||||
/* Opens the explicit ALSA device with a fallback list */
|
||||
|
|
@ -109,6 +115,8 @@ snd_pcm_t *pa_alsa_open_by_template(
|
|||
snd_pcm_uframes_t tsched_size,
|
||||
bool *use_mmap, /* modified at return */
|
||||
bool *use_tsched, /* modified at return */
|
||||
pa_sample_format_t **query_supported_formats, /* modified at return */
|
||||
unsigned int **query_supported_rates, /* modified at return */
|
||||
bool require_exact_channel_number);
|
||||
|
||||
#if 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue