[pulseaudio-discuss] PA now compiles on OS X

Lennart Poettering lennart at poettering.net
Thu Jul 23 04:41:42 PDT 2009


On Thu, 23.07.09 13:58, Kim Lester (kim at dfusion.com.au) wrote:

>
> I'm happy to upload my patches but I'd like advice on how you want them.
> I consider them at "hack" level and _might_ break linux compiles so I  
> don't want to break the trunk (not that I expect I have write permission 
> anyway). I'm also not a git expert, so advice please...

As Colin pointed out it would be greate if you'd make them available
in a git repo on gitorious or so.

> Incidentally I also made some other minor changes as I got tired of the 
> compiler complaints about "wait" (and one other) function arguments 
> shadowing globals because -Wshadow is turned on. In my case  simply 
> appended and _ so wait becomes wait_ but I'd rather not send those 
> changes back without agreement.

Hmm, please make sure to base your patches on current git. IIRC we
already have a couple of patches in there which rename variables
'wait' to 'wait_op' or so.


>> Hmm, but we fall back to gettimeofday if the monotonic clock does not
>> exist. Which should be good enough. Or isn't it?
>
> Yes that's quite correct. I actually got stuck in the tests  
> (rtstutter.c) that calls clock_gettime() directly. Incidentally alsa  
> tests also include clock_gettime().

Hmm, we probably could change those to use pa_rtclock_now() instead...

> The obvious solution was just to change the test but I had been  
> irritated by this omission of Apple and did some homework.
> I haven't done any performance tests myself but reading Apple and other 
> articles indicates that high res times are available
> and efficient. I'm not sure how good gettimeofday is in this regard (it 
> has to do extra work at least). So since I happen to care about
> latency I tried writing a replacement in the spirit of hires timers. The 
> actual difference may not be worth it and I'm not claiming my version is 
> more efficient (I did a divide to get seconds from ns which would be 
> better avoided).

It's not actually about the accuracy of gettimeofday() (which is good
enough, given that it returns usecs), but more about the fact that the
monotonic clock is ... uh ... monotonic. i.e. independant of time
changes, time zone changes, NTP, yadda yadda.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list