summaryrefslogtreecommitdiff
path: root/src/modules/alsa/alsa-util.h
diff options
context:
space:
mode:
authorIgor V. Kovalenko <igor.v.kovalenko@gmail.com>2023-02-22 01:19:24 +0300
committerPulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org>2023-02-25 12:00:38 +0000
commitaed52c507f345d0b5c4cd2b1d2c58dae2d904b53 (patch)
tree7f7fc3891f6cb6e11837a74ee94e587959fda15c /src/modules/alsa/alsa-util.h
parentb8e2198d34da2e085b469d7e3a472cbdaec9e5b8 (diff)
downloadpulseaudio-aed52c507f345d0b5c4cd2b1d2c58dae2d904b53.tar.gz
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 Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/782>
Diffstat (limited to 'src/modules/alsa/alsa-util.h')
-rw-r--r--src/modules/alsa/alsa-util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h
index 2eed3eac3..c65801104 100644
--- a/src/modules/alsa/alsa-util.h
+++ b/src/modules/alsa/alsa-util.h
@@ -67,6 +67,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 */
@@ -82,6 +84,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 */
@@ -96,6 +100,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 */
@@ -111,6 +117,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);
void pa_alsa_dump(pa_log_level_t level, snd_pcm_t *pcm);