| Summary: | Two possible PCM problems and patch | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | ak03 <ak03> | ||||
| Component: | kern | Assignee: | cg | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | CC: | cg | ||||
| Priority: | Normal | ||||||
| Version: | 5.0-CURRENT | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
Responsible Changed From-To: freebsd-bugs->cg Cameron is the boss of sound. Cameron - is there any way we can assign sound PRs to all the sound guys instead of you in particular? State Changed From-To: open->closed Committed (by cg), thanks! |
There are three possible promlems in the -CURRENT PCM code a) pcm_chn_add deletes channel passed to it as a parameter, even though all pcm_chn_add callers call pcm_chn_destroy themselves when pcm_chn_add fails. pcm_chn_destroy then attempts to delete pcm_channel struct which already has been deleted b) dynamic sysctl handler for the number of virtual channels does not resize d->arec and d->aplay arrays. The code like d->aplay[chan] is used all over the place in PCM, and in presence of dynamically allocated vchannels channel number can be bigger than d->maxchan which is statically computed in pcm_register based of the number of actual hardware channels. c) When creating additional vchannels, the code sets CHN_F_BUSY flag _before_ calling vchan_create and fails to clean that flag when vchan_create returns error and no other vchannels weres created, thus leaving the parent channel permanently busy. Fix: Attached patch patch tries to address the above problems. With patch applied I was able to run my sbc16 sound card with 4 vchannels all playing simultaneously :) How-To-Repeat: N/A