HomeFreeBSD

sound: Refactor sndstat_get_caps()

Description

sound: Refactor sndstat_get_caps()

The current implementation of sndstat_get_caps() does not work properly
when VCHANs are enabled, as it skips all information about physical
channels, and also assigns the min/max rates and channels to same
values, which is usually not the case. A device either supports any
sample rate within the [feeder_rate_min, feeder_rate_max] range, or
[hw_rate_min, hw_rate_max] range when the device is opened in exclusive
or bitperfect mode. The number of channels can also vary and is not
always the same for both min and max.

Refactor the whole function to resemble the way we handle fetching of
these values in dsp_oss_audioinfo() and dsp_oss_engineinfo().

Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45872

(cherry picked from commit 9d8b93bc9ccea82b648ffa9354200c9e4d3f211b)

Details

Provenance
christosAuthored on Jul 6 2024, 6:23 PM
Reviewer
dev_submerge.ch
Differential Revision
D45872: sound: Refactor sndstat_get_caps()
Parents
rG95d3abff7375: sound: Fix min/max rate for SNDCTL_AUDIOINFO and SNDCTL_ENGINEINFO
Branches
Unknown
Tags
Unknown