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

Thomas Martitz kugel at rockbox.org
Tue Sep 30 02:46:57 PDT 2014


Am 30.09.2014 um 11:10 schrieb David Henningsson:
>
>
> On 2014-09-30 10: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 
>>
>
> I'm hesitant to using perf, at least in that way. The result will 
> include the entire startup phase, include how we probe the devices, 
> read configuration files and so on. That impact is significant, unless 
> you run your test for a very long time.
>
> I wonder if there's a way we can tell perf to skip the first 10 
> seconds, or so? That way the test would be more accurate.
>


As an alternative to perf, I think using the CPU time of the process 
should be pretty accurate. You could also remember the CPU time after 
10s (wall clock time) and subtract later measurements by that value.

You can get the CPU time (in-process) with the times() syscall on Linux. 
That returns the user and sys time as separate values. You could even 
add a service to pactl/pacmd to print out that information.

Best regards.


More information about the pulseaudio-discuss mailing list