Page MenuHomeFreeBSD

sound: Fix min/max rate for SNDCTL_AUDIOINFO and SNDCTL_ENGINEINFO
ClosedPublic

Authored by christos on Jul 3 2024, 7:10 PM.
Tags
None
Referenced Files
F163270639: D45862.id140535.diff
Tue, Jul 21, 3:09 PM
Unknown Object (File)
Mon, Jul 20, 12:19 PM
Unknown Object (File)
Mon, Jul 20, 6:25 AM
Unknown Object (File)
Sun, Jul 19, 8:30 PM
Unknown Object (File)
Sun, Jul 19, 5:47 PM
Unknown Object (File)
Sat, Jul 18, 7:15 PM
Unknown Object (File)
Sat, Jul 18, 5:31 AM
Unknown Object (File)
Sun, Jul 5, 4:01 AM
Subscribers

Details

Summary

Since we allow feeding of any rate within the [feeder_rate_min,
feeder_rate_max] range, report this as the min/max rate as well. Only
exceptions are when we the device is opened in exclusive or bitperfect
mode.

Sponsored by: The FreeBSD Foundation
MFC after: 2 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 58487
Build 55375: arc lint + arc unit

Event Timeline

christos added inline comments.
sys/dev/sound/pcm/dsp.c
2124

I did this for AUDIOINFO since we can feed arbitrary rates to physical channels as well.

sys/dev/sound/pcm/dsp.c
2124

Didn't get the EXCL and BITPERFECT cases into account. Uploading fixed diff in a sec.

Handle EXCLUSIVE and BITPERFECT cases.

sndstat_get_caps() probably also needs fixing, but I will do this in a separate patch.

Looks good to me, in my tests with ossinfo this returns the expected sample rate values.

sys/dev/sound/pcm/dsp.c
2210–2212

I think this comment should be adapted on occasion.

This revision is now accepted and ready to land.Jul 4 2024, 3:23 PM
sys/dev/sound/pcm/dsp.c
2210–2212

I think we could even get rid of it. It also exists in AUDIOINFO.

sndstat_get_caps() probably also needs fixing, but I will do this in a separate patch.

D45872