Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSCBundle:TimeTag - iOS 10 problem #24

Open
Enigma644 opened this issue Oct 9, 2016 · 5 comments
Open

OSCBundle:TimeTag - iOS 10 problem #24

Enigma644 opened this issue Oct 9, 2016 · 5 comments

Comments

@Enigma644
Copy link

Something weird is going on with iOS 10 with these two lines in OSCBundle (lines 218, 219):

long time_s = NSSwapHostLongToBig(floor(interval));
long time_us = NSSwapHostLongToBig((long)(floor((double)1000000.0 * ((double)(interval - (double)time_s)))));

I'm not sure what is happening, but NSSwapHostLongToBig is just not giving out the same results on iOS 10 vs iOS 9.
As a result the bundle time is getting totally messed up. I think it's got to do with LONG_MAX being much higher on my x64 iOS 10 iPhone 6 test device.

Also of note, on line 218, (interval - time_s) should be (interval - floor(interval)).

@mrRay
Copy link
Owner

mrRay commented Oct 10, 2016

howdy-

thanks for letting me know about this. i don't have an iOS 10 SDK at my disposal right now, but i made some changes- if you could please let me know if they resolve your issue i'd appreciate it!

cheers
: : ray

@Enigma644
Copy link
Author

Awesome, thank you. iOS9 and iOS10 are now behaving the same.

I am however noticing problems with the fraction microseconds (in any iOS). In the test utils that I'm using they are showing the microseconds not changing, but looking at the packet you are creating, it looks to me like the timetag is built correctly. Can I ask what test tool you're using? I'm testing with oscP5.

@Enigma644
Copy link
Author

FYI other libs have the second component as a fraction of 4294967296 eg:
http://cim.mcgill.ca/sresvn/audioscape/audioscape_resources/PDa/extra/dumpOSC.c

@Enigma644
Copy link
Author

After a bunch of testing, I'm 99% sure you should have:
uint32_t time_us = CFSwapInt32HostToBig((uint32_t)floor((double)4294967296.0 * ((double)(interval - floor(interval)))));

@mrRay
Copy link
Owner

mrRay commented Oct 12, 2016

you are, of course, correct- nice catch, thanks for the tip! just pushed some changes, please let me know if you have any more problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants