Re: [pulseaudio-discuss] [PATCH] modules: Disable timer scheduling for a2dp playback to reduce power consumption.
Hi Sajeesh, Thanks for trying to contribute to PulseAudio. While going through old patches I found this one, but as Pierre-Louis says below, I'm not sure how this would reduce power consumption. Could you explain? Or we could drop your patch in case you changed your mind. Thanks, On 2014-08-05 23:59, Pierre-Louis Bossart wrote: On 8/5/14, 12:35 AM, Sajeesh Sidharthan wrote: --- src/modules/bluetooth/module-bluez5-device.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c index 57b2791..eda7a9d 100644 --- a/src/modules/bluetooth/module-bluez5-device.c +++ b/src/modules/bluetooth/module-bluez5-device.c @@ -1170,10 +1170,10 @@ static void thread_func(void *userdata) { a2dp_reduce_bitpool(u); } } - -do_write = 1; -pending_read_bytes = 0; } + +do_write = 1; +pending_read_bytes = 0; } if (writable do_write 0) { @@ -1208,7 +1208,7 @@ static void thread_func(void *userdata) { sleep_for = PA_USEC_PER_MSEC * 500; pa_rtpoll_set_timer_relative(u-rtpoll, sleep_for); -disable_timer = false; +/* disable_timer = false; *//* Disable timer to reduce power consumption */ Why would this reduce power consumption, one would think that you want to buffer up by specifying a large latency. If you disable timers you'll have to force a specific buffer size for this sink. Thanks, -Pierre ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss -- David Henningsson, Canonical Ltd. https://launchpad.net/~diwic ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH] modules: Disable timer scheduling for a2dp playback to reduce power consumption.
05.08.2014 11:35, Sajeesh Sidharthan wrote: --- src/modules/bluetooth/module-bluez5-device.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c index 57b2791..eda7a9d 100644 --- a/src/modules/bluetooth/module-bluez5-device.c +++ b/src/modules/bluetooth/module-bluez5-device.c @@ -1170,10 +1170,10 @@ static void thread_func(void *userdata) { a2dp_reduce_bitpool(u); } } - -do_write = 1; -pending_read_bytes = 0; } + +do_write = 1; +pending_read_bytes = 0; } if (writable do_write 0) { @@ -1208,7 +1208,7 @@ static void thread_func(void *userdata) { sleep_for = PA_USEC_PER_MSEC * 500; pa_rtpoll_set_timer_relative(u-rtpoll, sleep_for); -disable_timer = false; +/* disable_timer = false; *//* Disable timer to reduce power consumption */ } } } I have tested this patch. Both with and without this patch, using Wine (which always requests tlength=40.00 ms, minreq=10.00 ms unless patched with winepulse, which is something that e.g. Arch does not do), I have: I: [pulseaudio] protocol-native.c: Final latency 99.03 ms = 39.52 ms + 2*10.00 ms + 39.51 ms Without this patch, Wine somehow marginally manages to work, with some Skipping 7119 us (= 1252 bytes) in audio stream messages in the pulseaudio log. With this patch, it just produces a lot of xruns. -- Alexander E. Patrakov ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH] modules: Disable timer scheduling for a2dp playback to reduce power consumption.
On 8/5/14, 12:35 AM, Sajeesh Sidharthan wrote: --- src/modules/bluetooth/module-bluez5-device.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c index 57b2791..eda7a9d 100644 --- a/src/modules/bluetooth/module-bluez5-device.c +++ b/src/modules/bluetooth/module-bluez5-device.c @@ -1170,10 +1170,10 @@ static void thread_func(void *userdata) { a2dp_reduce_bitpool(u); } } - -do_write = 1; -pending_read_bytes = 0; } + +do_write = 1; +pending_read_bytes = 0; } if (writable do_write 0) { @@ -1208,7 +1208,7 @@ static void thread_func(void *userdata) { sleep_for = PA_USEC_PER_MSEC * 500; pa_rtpoll_set_timer_relative(u-rtpoll, sleep_for); -disable_timer = false; +/* disable_timer = false; *//* Disable timer to reduce power consumption */ Why would this reduce power consumption, one would think that you want to buffer up by specifying a large latency. If you disable timers you'll have to force a specific buffer size for this sink. Thanks, -Pierre ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH] modules: Disable timer scheduling for a2dp playback to reduce power consumption.
Title: Samsung Enterprise Portal mySingle Hi, I have disabled timer scheduling for a2dp playback with this patch to reduce power consumption. Could you please review this change and let me know if it can cause any side effect. If its worth giving an option to disable timer scheduling similar to alsa-sink ( tsched param ), I would like to do the same. Thank You. Sajeesh --- Original Message --- Sender : Sajeesh Sidharthansajees...@samsung.com Chief Engineer/SRI-Bangalore-MM Applications/Samsung Electronics Date : Aug 05, 2014 14:35 (GMT+09:00) Title : [pulseaudio-discuss] [PATCH] modules: Disable timer scheduling for a2dp playback to reduce power consumption. ---src/modules/bluetooth/module-bluez5-device.c |8 1 file changed, 4 insertions(+), 4 deletions(-)diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.cindex 57b2791..eda7a9d 100644--- a/src/modules/bluetooth/module-bluez5-device.c+++ b/src/modules/bluetooth/module-bluez5-device.c@@ -1170,10 +1170,10 @@ static void thread_func(void *userdata) { a2dp_reduce_bitpool(u); } }--do_write = 1;-pending_read_bytes = 0; }++do_write = 1;+pending_read_bytes = 0; } if (writable do_write 0) {@@ -1208,7 +1208,7 @@ static void thread_func(void *userdata) { sleep_for = PA_USEC_PER_MSEC * 500; pa_rtpoll_set_timer_relative(u-rtpoll, sleep_for);-disable_timer = false;+/* disable_timer = false; *//* Disable timer to reduce power consumption */ } } }-- 1.7.9.5___pulseaudio-discuss mailing listpulseaudio-discuss@lists.freedesktop.orghttp://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss ___ pulseaudio-discuss mailing list pulseaudio-discuss@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss