Page MenuHomeFreeBSD

sound: Report actual vchanrate and vchanformat in sysctl
Needs ReviewPublic

Authored by christos on Sun, Jan 12, 12:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 19, 12:42 AM
Unknown Object (File)
Sat, Jan 18, 11:42 AM
Unknown Object (File)
Fri, Jan 17, 7:57 PM
Unknown Object (File)
Fri, Jan 17, 9:56 AM
Unknown Object (File)
Fri, Jan 17, 9:08 AM
Unknown Object (File)
Fri, Jan 17, 6:48 AM
Unknown Object (File)
Thu, Jan 16, 10:42 AM
Unknown Object (File)
Tue, Jan 14, 9:30 PM
Subscribers

Details

Summary

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61857
Build 58741: arc lint + arc unit

Event Timeline

sys/dev/sound/pcm/vchan.c
531–532

Since *vchanrate and c->speed can have different values, we should update *vchanrate even when c->speed is unchanged. Otherwise this results in confusing behavior if the user wants to set the sample rate that the channel already is setup with.

635–636

Same as above, regarding *vchanformat instead of *vchanrate.

christos marked 2 inline comments as done.

Address comments.

Aren't vchanrate and vchanformat now completely disconnected from the actual parameters of the primary channel, until a vchan is opened? This would mean there's no useful feedback for the user until a channel is opened, at which point the parameters could suddenly change to something different?

Aren't vchanrate and vchanformat now completely disconnected from the actual parameters of the primary channel, until a vchan is opened?

Until a vchan is opened not really, because this code is executed only through the sysctl interface. I do agree however, that it's better to assign these values to the primary channel parameters instead, since the chn_reset() might assign something different than what we requested, in which case vchanrate/vchanformat are inconsistent with what has actually been applied. I will modify the code to set vchanrate to c->speed and vchanformat to c->format at the end, before we unlock the channel.

Assign to primary channel parameters.