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
F142139329: D45722.id140630.diff
Fri, Jan 16, 10:01 AM
F142139273: D45722.id.diff
Fri, Jan 16, 10:00 AM
F142136537: D45722.id140268.diff
Fri, Jan 16, 9:16 AM
F142129074: D45722.id140268.diff
Fri, Jan 16, 7:32 AM
F142126271: D45722.id140630.diff
Fri, Jan 16, 6:47 AM
F142125271: D45722.id140267.diff
Fri, Jan 16, 6:31 AM
F142123180: D45722.id140267.diff
Fri, Jan 16, 5:58 AM
F142122583: D45722.diff
Fri, Jan 16, 5:49 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 Not Applicable
Unit
Tests Not Applicable

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