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.
Tags
None
Referenced Files
F87409100: D45722.id140268.diff
Tue, Jul 2, 5:04 PM
F87408986: D45722.id140197.diff
Tue, Jul 2, 5:02 PM
Unknown Object (File)
Mon, Jul 1, 12:54 PM
Unknown Object (File)
Mon, Jul 1, 12:36 PM
Unknown Object (File)
Mon, Jul 1, 12:02 PM
Unknown Object (File)
Sun, Jun 30, 8:53 PM
Unknown Object (File)
Sun, Jun 30, 10:30 AM
Unknown Object (File)
Fri, Jun 28, 11:53 PM
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 58336
Build 55224: 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