[pulseaudio-discuss] [RFC PATCH] alsa-sink: Reduce hardware pointer update syscalls

Laurențiu Nicola lnicola at dend.ro
Thu Oct 2 02:14:59 PDT 2014


Without patch, with a latency of 48 ms:

   4.80%    lt-pulseaudio  [kernel.kallsyms]         [k] __do_softirq
   2.43%  alsa-sink-USB A  [snd_pcm]                 [k] snd_pcm_hwsync
   2.32%    lt-pulseaudio  [kernel.kallsyms]         [k]
   finish_task_switch.isra.60
   2.27%  alsa-sink-USB A  [snd_pcm]                 [k]
   snd_pcm_playback_poll
   2.24%    lt-pulseaudio  [kernel.kallsyms]         [k]
   __usb_hcd_giveback_urb
   1.57%    lt-pulseaudio  [kernel.kallsyms]         [k] fget_light
   1.26%  alsa-sink-USB A  libalsa-util.so           [.] thread_func
   1.13%  alsa-sink-USB A  [kernel.kallsyms]         [k] do_sys_poll
   1.11%  alsa-sink-USB A  [kernel.kallsyms]         [k] fget_light
   0.91%  alsa-sink-USB A  [kernel.kallsyms]         [k] eventfd_write
   0.89%    lt-pulseaudio  [kernel.kallsyms]         [k] do_sys_poll
   0.87%    lt-pulseaudio  [kernel.kallsyms]         [k] datagram_poll
   0.81%  alsa-sink-USB A  libpulsecore-5.0.so       [.] pa_rtpoll_run
   0.79%  alsa-sink-USB A  [snd_pcm]                 [k]
   snd_pcm_sync_ptr
   0.78%    lt-pulseaudio  [kernel.kallsyms]         [k] sock_poll
   0.77%    lt-pulseaudio  [kernel.kallsyms]         [k]
   __wake_up_sync_key
   0.74%  alsa-sink-USB A  [snd_pcm]                 [k] snd_pcm_status
   0.74%    lt-pulseaudio  [kernel.kallsyms]         [k] pipe_read
   0.69%    lt-pulseaudio  libpulse.so.0.17.3        [.]
   pa_mainloop_dispatch
   0.68%  alsa-sink-USB A  [kernel.kallsyms]         [k] __do_softirq
   0.59%  alsa-sink-USB A  ld-2.18.so                [.] __tls_get_addr
   0.59%  alsa-sink-USB A  libpulsecore-5.0.so       [.] inputs_drop
   0.58%    lt-pulseaudio  libpulse.so.0.17.3        [.]
   pa_mainloop_prepare
   0.56%  alsa-sink-USB A  libpulsecommon-5.0.so     [.]
   pa_memblock_unref
   0.56%  alsa-sink-USB A  [kernel.kallsyms]         [k] vector_swi
   0.55%  alsa-sink-USB A  [kernel.kallsyms]         [k]
   __copy_to_user_memcpy
   0.55%  alsa-sink-USB A  libpulsecore-5.0.so       [.]
   pa_object_check_type
   0.54%  alsa-sink-USB A  libpulsecore-5.0.so       [.]
   pa_sink_input_peek
   0.53%    lt-pulseaudio  [kernel.kallsyms]         [k] eventfd_write
   0.52%    lt-pulseaudio  [kernel.kallsyms]         [k] vector_swi
   0.51%    lt-pulseaudio  [kernel.kallsyms]         [k]
   unix_stream_recvmsg

With the patch, I get the same assertion failed as Peter ("frames > 0").
With Peter's change, I get this: http://pastebin.com/dWx6fiwT, even with
no client connected. The reported delay is -5 * default-fragments *
default-fragment-size-msec.

Laurentiu


On Tue, Sep 30, 2014, at 11:11, Alexander E. Patrakov wrote:
> 30.09.2014 12:43, David Henningsson wrote:
> >
> >
> > On 2014-09-29 16:33, Laurențiu Nicola wrote:
> >> If nobody tried it, I might test the patch on my USB DAC. The problem is
> >> that I'm not sure what's the best way to benchmark the playback. Do you
> >> have some tips on that?
> >
> > Run "top" in a low-latency playback scenario, that should be enough. You
> > might want to verify (e g with pactl) that you end up with the same
> > latency both with and without the patch.
> >
> > Maybe others have more accurate methods to measure CPU consumption.
> 
> I used "perf". Please see this message:
> 
> http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-September/021745.html
> 
> If others also try this method, we may be able to compare the results.
> 
> -- 
> Alexander E. Patrakov


More information about the pulseaudio-discuss mailing list