Page MenuHomeFreeBSD

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

Authored by christos on Mon, Jun 24, 8:40 PM.

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.Wed, Jun 26, 1:50 PM