sleep and usleep in libogc 1.8.15 not working

Post Reply
Oibaf
Posts: 34
Joined: Mon Jul 04, 2011 1:03 pm

sleep and usleep in libogc 1.8.15 not working

Post by Oibaf » Tue Jan 03, 2017 5:14 pm

The sleep and usleep functions does not work in libogc 1.8.15.
"sleep" freezes the Wii with any value. "usleep" freezes the Wii with big values or when it is called several times.
Since all my projects use the sleep functions, none of them works with the new lib.

Could this be the cause of MAME and network sockettest example not working?

Could it be caused by some problems with the thread managment?

WinterMute
Site Admin
Posts: 1367
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: sleep and usleep in libogc 1.8.15 not working

Post by WinterMute » Wed Jan 04, 2017 4:04 am

It's definitely a distinct possibility. Thanks for pointing this out.

If you could try compiling a fresh copy of libogc with optimisations turned down that might help narrow things down a bit too.
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog

Oibaf
Posts: 34
Joined: Mon Jul 04, 2011 1:03 pm

Re: sleep and usleep in libogc 1.8.15 not working

Post by Oibaf » Wed Jan 04, 2017 1:08 pm

You were right. It is an optimization issue.

I tried with no optimization flag, -O2 and -O3. All of them give a working sleep function.
I also tried other thread tests (i.e. mutex) which did not work; they work with the optimizations above.
I also compiled with -Os (the flag used in your distribution pack) and the sleep function does work.

This are the sizes of libocg.a lib files:
0s: 2,896 KB
02: 3,125 KB
03: 4,436 KB

I am using the O2 version. ll seems to work now.

Oibaf
Posts: 34
Joined: Mon Jul 04, 2011 1:03 pm

Re: sleep and usleep in libogc 1.8.15 not working

Post by Oibaf » Wed Jan 04, 2017 10:07 pm

I wanted to say that with -Os flag, sleep function does not work

WinterMute
Site Admin
Posts: 1367
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: sleep and usleep in libogc 1.8.15 not working

Post by WinterMute » Thu Jan 05, 2017 3:34 pm

Thanks for doing this. I've recompiled the libogc release with -O2 and uploaded a new archive. Shall have to see if I can track down what's happening with -Os later.
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest