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

Proposed by David Henningsson
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 Pending
Daniel T Chen Pending
Review via email: mp+18303@code.launchpad.net
To post a comment you must log in.
Revision history for this message
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
38. By David Henningsson

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

Unmerged revisions

38. By David Henningsson

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

37. By David Henningsson

Close relevant bugs in changelog

36. By David Henningsson

Pulse: Do not report underruns.

Preview Diff

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

Subscribers

People subscribed via source and target branches