Merge lp:~diwic/alsa-plugins/ubuntu.new into lp:ubuntu/lucid/alsa-plugins

Proposed by David Henningsson on 2010-01-30
Status: Needs review
Proposed branch: lp:~diwic/alsa-plugins/ubuntu.new
Merge into: lp:ubuntu/lucid/alsa-plugins
Diff against target: 145 lines (+126/-0)
3 files modified
debian/changelog (+6/-0)
debian/patches/pulse-ignore-underruns.patch (+119/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~diwic/alsa-plugins/ubuntu.new
Reviewer Review Type Date Requested Status
Ubuntu Audio Development Team 2010-02-06 Pending
Daniel T Chen 2010-01-30 Pending
Review via email: mp+18303@code.launchpad.net
To post a comment you must log in.
David Henningsson (diwic) wrote :

Do not report underruns to the ALSA layer.
 Reporting underruns to ALSA seems to do more bad than good, for these reasons:
 * If pulseaudio gets an underrun, the normal way to end that underrun is to
   feed it with more buffers. This is different from the ALSA way of dealing
   with underruns, which requires hardware buffer pointers to be reset.
 * In addition, underrun signals are delivered asynchronously from pulseaudio.
   This means that there might be more buffers on the way to pulseaudio when
   the underrun is reported, making the underrun obsolete. Unfortunately,
   there is currently no known way to determine whether this is the case or
   not.

lp:~diwic/alsa-plugins/ubuntu.new updated on 2010-02-07
38. By David Henningsson on 2010-02-07

pulse-ignore-plugins is now forwarded to pulseaudio-discuss.

Unmerged revisions

38. By David Henningsson on 2010-02-07

pulse-ignore-plugins is now forwarded to pulseaudio-discuss.

37. By David Henningsson on 2010-01-30

Close relevant bugs in changelog

36. By David Henningsson on 2010-01-30

Pulse: Do not report underruns.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-01-09 08:39:51 +0000
3+++ debian/changelog 2010-02-07 09:52:15 +0000
4@@ -1,3 +1,9 @@
5+alsa-plugins (1.0.22-0ubuntu4) lucid; urgency=low
6+
7+ * pulse: Do not report underruns to ALSA (LP: #464008, LP: #503174)
8+
9+ -- David Henningsson <diwic@ubuntu.com> Sat, 30 Jan 2010 10:35:50 +0100
10+
11 alsa-plugins (1.0.22-0ubuntu3) lucid; urgency=low
12
13 * lp485488.patch: Update patch to fix capture. Thanks, David
14
15=== added file 'debian/patches/pulse-ignore-underruns.patch'
16--- debian/patches/pulse-ignore-underruns.patch 1970-01-01 00:00:00 +0000
17+++ debian/patches/pulse-ignore-underruns.patch 2010-02-07 09:52:15 +0000
18@@ -0,0 +1,119 @@
19+Description: Do not report underruns to the ALSA layer.
20+ Reporting underruns to ALSA seems to do more bad than good, for these reasons:
21+ * If pulseaudio gets an underrun, the normal way to end that underrun is to
22+ feed it with more buffers. This is different from the ALSA way of dealing
23+ with underruns, which requires hardware buffer pointers to be reset.
24+ * In addition, underrun signals are delivered asynchronously from pulseaudio.
25+ This means that there might be more buffers on the way to pulseaudio when
26+ the underrun is reported, making the underrun obsolete. Unfortunately,
27+ there is currently no known way to determine whether this is the case or
28+ not.
29+Forwarded: yes
30+Bug-ubuntu: https://bugs.launchpad.net/bugs/464008
31+Author: David Henningsson <diwic@ubuntu.com>
32+
33+Index: alsa-plugins/pulse/pcm_pulse.c
34+===================================================================
35+--- alsa-plugins.orig/pulse/pcm_pulse.c 2010-01-30 10:21:14.924545677 +0100
36++++ alsa-plugins/pulse/pcm_pulse.c 2010-01-30 10:23:04.844542098 +0100
37+@@ -38,7 +38,7 @@
38+ /* Since ALSA expects a ring buffer we must do some voodoo. */
39+ size_t last_size;
40+ size_t ptr;
41+- int underrun;
42++ /* int underrun; */
43+
44+ size_t offset;
45+
46+@@ -220,7 +220,7 @@
47+
48+ u = pa_stream_trigger(pcm->stream, stream_success_cb, pcm);
49+
50+- pcm->underrun = 0;
51++ /* pcm->underrun = 0; */
52+ err_o = pulse_wait_operation(pcm->p, o);
53+ if (u)
54+ err_u = pulse_wait_operation(pcm->p, u);
55+@@ -347,10 +347,10 @@
56+ if (ret < 0)
57+ goto finish;
58+
59+- if (pcm->underrun) {
60++ /*if (pcm->underrun) {
61+ ret = -EPIPE;
62+ goto finish;
63+- }
64++ }*/
65+
66+ ret = update_ptr(pcm);
67+ if (ret < 0) {
68+@@ -358,9 +358,9 @@
69+ goto finish;
70+ }
71+
72+- if (pcm->underrun)
73++ /*if (pcm->underrun)
74+ ret = -EPIPE;
75+- else
76++ else*/
77+ ret = snd_pcm_bytes_to_frames(io->pcm, pcm->ptr);
78+
79+ finish:
80+@@ -408,8 +408,8 @@
81+
82+ finish:
83+
84+- if (pcm->underrun && pcm->io.state == SND_PCM_STATE_RUNNING)
85+- snd_pcm_ioplug_set_state(io, SND_PCM_STATE_XRUN);
86++ /*if (pcm->underrun && pcm->io.state == SND_PCM_STATE_RUNNING)
87++ snd_pcm_ioplug_set_state(io, SND_PCM_STATE_XRUN);*/
88+
89+ pa_threaded_mainloop_unlock(pcm->p->mainloop);
90+
91+@@ -462,7 +462,7 @@
92+ goto finish;
93+
94+ ret = size;
95+- pcm->underrun = 0;
96++ /*pcm->underrun = 0;*/
97+
98+ finish:
99+ pa_threaded_mainloop_unlock(pcm->p->mainloop);
100+@@ -575,7 +575,7 @@
101+
102+ update_active(pcm);
103+ }
104+-
105++/*
106+ static void stream_underrun_cb(pa_stream * p, void *userdata)
107+ {
108+ snd_pcm_pulse_t *pcm = userdata;
109+@@ -587,7 +587,7 @@
110+
111+ pcm->underrun = 1;
112+ }
113+-
114++*/
115+ static void stream_latency_cb(pa_stream *p, void *userdata) {
116+ snd_pcm_pulse_t *pcm = userdata;
117+
118+@@ -688,8 +688,8 @@
119+ if (io->stream == SND_PCM_STREAM_PLAYBACK) {
120+ pa_stream_set_write_callback(pcm->stream,
121+ stream_request_cb, pcm);
122+- pa_stream_set_underflow_callback(pcm->stream,
123+- stream_underrun_cb, pcm);
124++ /*pa_stream_set_underflow_callback(pcm->stream,
125++ stream_underrun_cb, pcm);*/
126+ r = pa_stream_connect_playback(pcm->stream, pcm->device,
127+ &pcm->buffer_attr,
128+ PA_STREAM_AUTO_TIMING_UPDATE |
129+@@ -728,7 +728,7 @@
130+ }
131+
132+ pcm->offset = 0;
133+- pcm->underrun = 0;
134++ /*pcm->underrun = 0;*/
135+
136+ finish:
137+ pa_threaded_mainloop_unlock(pcm->p->mainloop);
138
139=== modified file 'debian/patches/series'
140--- debian/patches/series 2010-01-08 22:25:51 +0000
141+++ debian/patches/series 2010-02-07 09:52:15 +0000
142@@ -1,2 +1,3 @@
143 #a52-lavc.patch
144+pulse-ignore-underruns.patch
145 lp485488.patch

Subscribers

People subscribed via source and target branches