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)
Fri, Nov 22, 1:17 AM
Unknown Object (File)
Thu, Nov 14, 4:43 PM
Unknown Object (File)
Thu, Nov 7, 2:10 PM
Unknown Object (File)
Sep 26 2024, 1:28 AM
Unknown Object (File)
Sep 15 2024, 1:30 AM
Unknown Object (File)
Sep 2 2024, 7:13 PM
Unknown Object (File)
Sep 2 2024, 11:25 AM
Unknown Object (File)
Sep 1 2024, 12:13 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 58356
Build 55244: 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