To support userspace audio deamons like Virtual OSS, /dev/sndstat is made writeable to facilitate more smooth integration.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
I have no serious objections. The idea of writing this device info just in textual form looks somewhat simplistic to me, but I can live with that, if you think it is fine.
sys/dev/sound/pcm/sndstat.c | ||
---|---|---|
67 | Does this really help, or just obfuscate the code? | |
230 | What's the idea of these dummy acquire/release now? | |
367 | I worry that some software may incorrectly parse this. |
sys/dev/sound/pcm/sndstat.c | ||
---|---|---|
67 | It is quite common to define macros when locking. I think it makes it more readable. | |
230 | It's kind of like Read/Copy/Update lock. If you look where sndstat_acquire is used: pcm_unregister(): ... PCM_LOCK(d); d->flags |= SD_F_DYING; d->flags &= ~SD_F_REGISTERED; PCM_UNLOCK(d); ... sndstat_release(); The dummy lock/unlock ensures that next time someone reads the sound status it sees that the device is gone. Or if it was currently iterating that it waits for that. I'll look into it a bit and see if there are any races left. | |
367 | Yes, it's a risk. I checked some tools like pulseaudio() and they mostly look for pcm%d . I can check a bit more. |
Improve patch as per mav's suggestions.
Remove now superfluous sndstat_acquire() and sndstat_release() functions.