Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F139391117
D50488.id155932.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D50488.id155932.diff
View Options
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -289,19 +289,25 @@
if (sg_ids != 0)
free_unr(pcmsg_unrhdr, sg_ids);
+ /*
+ * Go through the channel abort/flush path for both
+ * primary and virtual channels to ensure that, in the
+ * case of vchans, the stream is always properly
+ * stopped, and the primary channels do not keep being
+ * interrupted even if all vchans are gone.
+ */
+ CHN_LOCK(rdch);
+ chn_abort(rdch); /* won't sleep */
+ rdch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP |
+ CHN_F_DEAD | CHN_F_EXCLUSIVE);
+ chn_reset(rdch, 0, 0);
+ chn_release(rdch);
if (rdch->flags & CHN_F_VIRTUAL) {
parent = rdch->parentchannel;
CHN_LOCK(parent);
CHN_LOCK(rdch);
vchan_destroy(rdch);
CHN_UNLOCK(parent);
- } else {
- CHN_LOCK(rdch);
- chn_abort(rdch); /* won't sleep */
- rdch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP |
- CHN_F_DEAD | CHN_F_EXCLUSIVE);
- chn_reset(rdch, 0, 0);
- chn_release(rdch);
}
}
if (wrch != NULL) {
@@ -314,19 +320,18 @@
if (sg_ids != 0)
free_unr(pcmsg_unrhdr, sg_ids);
+ CHN_LOCK(wrch);
+ chn_flush(wrch); /* may sleep */
+ wrch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP |
+ CHN_F_DEAD | CHN_F_EXCLUSIVE);
+ chn_reset(wrch, 0, 0);
+ chn_release(wrch);
if (wrch->flags & CHN_F_VIRTUAL) {
parent = wrch->parentchannel;
CHN_LOCK(parent);
CHN_LOCK(wrch);
vchan_destroy(wrch);
CHN_UNLOCK(parent);
- } else {
- CHN_LOCK(wrch);
- chn_flush(wrch); /* may sleep */
- wrch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP |
- CHN_F_DEAD | CHN_F_EXCLUSIVE);
- chn_reset(wrch, 0, 0);
- chn_release(wrch);
}
}
PCM_LOCK(d);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 12, 2:56 PM (10 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26899324
Default Alt Text
D50488.id155932.diff (1 KB)
Attached To
Mode
D50488: sound: Terminate stream properly when closing vchans
Attached
Detach File
Event Timeline
Log In to Comment