Page MenuHomeFreeBSD

sound: SNDCTL_AUDIOINFO: Do not skip physical channels if VCHANs are disabled
ClosedPublic

Authored by christos on Jun 24 2024, 8:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Aug 16, 8:43 AM
Unknown Object (File)
Fri, Aug 15, 10:32 AM
Unknown Object (File)
Sun, Aug 3, 6:10 PM
Unknown Object (File)
Thu, Jul 31, 9:01 AM
Unknown Object (File)
Wed, Jul 30, 2:09 PM
Unknown Object (File)
Wed, Jul 30, 1:47 PM
Unknown Object (File)
Tue, Jul 29, 3:49 AM
Unknown Object (File)
Sun, Jul 27, 10:55 AM
Subscribers

Details

Summary

Currently, we are skipping physical channels when servicing
SNDCTL_AUDIOINFO, and VCHANs when servicing SNDCTL_AUDIOINFO_EX.
However, if we call SNDCTL_AUDIOINFO with VCHANs disabled, we'll
eventually skip all channels, resulting in some of oss_audioinfo's
fields containing wrong information (e.g min/max_channels).

Fix this by adding an exception to SNDCTL_AUDIOINFO not to skip physical
channels when VCHANs are disabled.

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 58355
Build 55243: arc lint + arc unit

Event Timeline

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

Not really sure if we want && or || here.

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

I suspect ||, if we have a device that is playback-only rvchancount will be 0 right?

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

Yes.

christos marked an inline comment as done.

s/&&/||/

Add missing parentheses around check, my bad.

Seems reasonable to me, we might want to revisit this in the future but I think this is at least incrementally better.

This revision is now accepted and ready to land.Jun 26 2024, 1:50 PM