Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Details
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. |
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?
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.
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.