Page MenuHomeFreeBSD

sound: Report actual vchanrate and vchanformat in sysctl
AcceptedPublic

Authored by christos on Sun, Jan 12, 12:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 23, 9:02 PM
Unknown Object (File)
Thu, Jan 23, 9:00 PM
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
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 61680
Build 58564: arc lint + arc unit

Event Timeline

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

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.

634

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.

Definitely better. The initial values of vchanformat and vchanrate are still off, but now they adopt the real channel parameters once set via sysctl. We can fix the initial values in a separate patch.

This revision is now accepted and ready to land.Sat, Jan 25, 1:39 AM