Hacking cIOSX rev21: controller lag [FIXED!]

BBogey

Member
Newcomer
Joined
Dec 29, 2010
Messages
22
Trophies
0
Website
Visit site
XP
4
Country
Finland
justmike said:
BBogey said:
justmike said:
Why would you not load games through base 58 from 249?

Because it's still buggy, many games are not working and it's slow.

Not worth it then.

Actually I haven't tested the compatability, what I tried was using base 58 in 250 and non of games was not working what I tested, but apparently it needs to be installed to 249 to work. In rev21 released thread there is some discussion about it.
 

davebaol

Well-Known Member
Member
Joined
Sep 3, 2010
Messages
912
Trophies
0
XP
192
Country
Italy
@BBogey and every coder out there
Can you please investigate about difference in loop.c between rev19 (no lag) and rev20 (first rev with lag)?

I'm pretty sure ehci module in rev20 has been committed in date 2010-07-31 while ehci in rev19 is the older one committed in date 2010-02-27.
Here is ehci module history: https://github.com/waninkoko/ehci-module/commits/master/

Main difference in rev20 is the addition of es.c source which define a new function for retrieving title_id.
This function is invoked by loop.c in the main loop when opening the device.

Do you think this function call can cause the infamous lag?


EDIT:
I was a good coder 10 years ago, so I can inspect code and speculate on it but actually I'm not able to compile source for Wii.
frown.gif
 

smf

Well-Known Member
Member
Joined
Feb 23, 2009
Messages
6,647
Trophies
2
XP
5,884
Country
United Kingdom
BBogey said:
If drive spin downs or load_count_cycle is still growing rapidly, I might try change the watchdog timer to 4 seconds to prevent the heads be parked or spin down. But with latest ehci there still might be the controller lag issue, when running watchdog, so the root cause needs to be found.

Western digital hard drives are well known for parking after something stupid like 2 seconds. I keep meaning to find the software that allows to change it, my laptop just sits there ticking as it stops and starts the hard drive constantly.
 

BBogey

Member
Newcomer
Joined
Dec 29, 2010
Messages
22
Trophies
0
Website
Visit site
XP
4
Country
Finland
davebaol said:
@BBogey and every coder out there
Can you please investigate about difference in loop.c between rev19 (no lag) and rev20 (first rev with lag)?

I'm pretty sure ehci module in rev20 has been committed in date 2010-07-31 while ehci in rev19 is the older one committed in date 2010-02-27.
Here is ehci module history: https://github.com/waninkoko/ehci-module/commits/master/

Main difference in rev20 is the addition of es.c source which define a new function for retrieving title_id.
This function is invoked by loop.c in the main loop when opening the device.

Do you think this function call can cause the infamous lag?


EDIT:
I was a good coder 10 years ago, so I can inspect code and speculate on it but actually I'm not able to compile source for Wii.
frown.gif

I tried to comment out the whole title id retrieval, but lag was still there.

There is some thread settings and priority changed in start.s, I reverted the changes and lag disappears. But then loading times increases a lot.
I also tried to revert just thread priority and the lag issue was solved but slow loading was still there.
 

x4mer

Member
Newcomer
Joined
Apr 17, 2010
Messages
24
Trophies
0
XP
56
Country
Canada
BBogey said:
I'm pretty worried that when ehci module is making wake up calls to disk every 10 seconds, and increases load_cycle_count, it wears my drive too quickly.
So I compiled the latest ehci source from wanikokos git (commit f53e23c7f747cca9028ca6002b616b5a0fca378f), and disabled the watchdog for waking up the drive.

If someone else who has problems with games with rev19 ehci, you could try this method also.
Edit: Here's the complied elf with watchdog disabled: http://www.megaupload.com/?d=LOCO5THU
Just replace it in modmii modules rev19 folder, remove old wad and then build the 249beta wad again.

I put it in the rev21 modules folder, and built 249[56]rev21 & 250[57]rev21. At first it appeared to have fixed the problem, and my drive no longer blinked at all while idle. My drive doesn't go to sleep, so this seemed the perfect solution.

However, if you sit on the Wario Shake It save select screen, there is still a problem. Once drive activity stops, wait at least 10 secs., and then hit 1 to go back to the title screen. When the black screen comes up on the way back to the title screen, the Wiimote communication error message box still shows up. It doesn't constantly blink, like the standard rev21, but it will show up as you exit, only if you wait more than 10 secs. There must still be some bad code in rev21, that's based around that timer interval.

Thanks for posting the compiled module.
 

netspy

Well-Known Member
OP
Newcomer
Joined
Sep 8, 2010
Messages
92
Trophies
1
XP
269
Country
United States
Thanks BBogey, nice work !
I can confirm what x4mer just said before. With your modified EHCI rev21, the controller lag occurs when you come back to the Warioland Shake It menu after waiting for a little while. With EHCI rev19, the lag seems to have disappeared completely.
 

BBogey

Member
Newcomer
Joined
Dec 29, 2010
Messages
22
Trophies
0
Website
Visit site
XP
4
Country
Finland
netspy said:
Thanks BBogey, nice work !
I can confirm what x4mer just said before. With your modified EHCI rev21, the controller lag occurs when you come back to the Warioland Shake It menu after waiting for a little while. With EHCI rev19, the lag seems to have disappeared completely.

It might be a different issue, so not related to hdd activity.

Here's the changes between 2010-02-27 and 2010-07-31 commits.
https://github.com/waninkoko/ehci-module/co...fbca327922c9837
https://github.com/waninkoko/ehci-module/co...e0156881a1cd758

So there are timer fixes and addition of the get titles es.c, es.h.

Major addition in the loop.c was this get titles part. What that does actually do? I can comment it out and compile it, netspy or x4mer please privmsg if you like to test it.
 

netspy

Well-Known Member
OP
Newcomer
Joined
Sep 8, 2010
Messages
92
Trophies
1
XP
269
Country
United States
@Kryptical : Thanks, added.

@BBogey : I am not sure I'll have the time to do much testing right now, but if it's OK for you, you can pm me the link, I can at least just quickly retry the Warioland : Shake It test.

EDIT : BBogey, I sent you a PM. It seems to me the GetTitleID part is not the cause for the controller lag.
 

justmike

Well-Known Member
Member
Joined
Sep 15, 2008
Messages
330
Trophies
0
XP
338
Country
Australia
I might as well install cIOS249[56]-v21[EHCI-v19].wad then.

Is it safe to do so, any problems encounted thus far or is it good to go?
 

davebaol

Well-Known Member
Member
Joined
Sep 3, 2010
Messages
912
Trophies
0
XP
192
Country
Italy
Lacius said:
justmike said:
Is it safe to do so, any problems encountered thus far or is it good to go?
I have had nothing but positive results.
AFAIK only drawback is Shaun White Skateboarding doesn't work.
For this game you MUST have rev20b or rev21 with base 56 or 57.
Also hermes cios with base 57 does't work.
 

kamiro04

Well-Known Member
Newcomer
Joined
Dec 3, 2010
Messages
62
Trophies
0
XP
94
Country
Argentina
XFlak said:
Download ModMii4.4.5B-BETA HERE

2drswas.jpg


This is a special test version of ModMii for people experiencing controller lags with cIOSs using base IOS56

This BETA version of ModMii can build cIOS249[56]-v21[EHCI-v19].wad for testing from Download page 4

Enjoy!
Hi Xflak, thanks for your great work!
I was cheking the CFG USB Loader post (http://gbatemp.net/t147638-configurable-usb-loader?&st=13935) and it seems that they found a great combination with:

cIOS249[57]-v21[EHCI-v19] for most games.
cIOS250[56]-v21[EHCI-v19] for instrument games, Guitar Hero, Rock Band, WeSing, USing....

Can you add this build options to your beta?
 

Kryptical

Well-Known Member
Member
Joined
Jun 10, 2010
Messages
312
Trophies
0
Age
29
Location
Canada
XP
109
Country
Canada
Black Ops seem to lag for me when the hard drive "thinks". Is it because my cIOS250[57] has EHCI v21? If it is then I would like to make a request to add cIOS250[57]-v21[EHCI-v19] to ModMii too.
 

davebaol

Well-Known Member
Member
Joined
Sep 3, 2010
Messages
912
Trophies
0
XP
192
Country
Italy
Ok guys, after sleeping 10 years the old coder in me is risen again.
laugh.gif


I've fixed the lag issue in ehci module of rev21.
It was a stupid bug inside the timer used by the watchdog.

Here is the final result:
  • the lag is completely gone
  • the watchdog is alive and kicking (contrary to BBogey's solution)
  • Shaun White Skateboarding works perfectly on base 56 and 57 (previous cIOS249[56]-v21[EHCI-v19] doesn't support that game).
I've heavily tested this solution with 4 different drives affected by lag issue, one of them (a Western Digital Elements SE - 2,5" - 1TB) manifesting severe symptoms, a 10 seconds cycle with the following base sequence:
  • 1 sec. LAG
  • 1 sec. NO LAG
  • 1 sec. LAG
  • 7 secs. NO LAG
Now all my drives run fluently.
cool.gif


Here is a compiled version of the fixed ehci module ready to build the cios with ModMii4.4.5B-BETA (just replace the module)
http://www.mediafire.com/?h4izwbtbfazj5je


Hope you like it
happy.gif


EDIT:

Instructions for building cIOS249[56]-v21 with fixed lag:[*]Download and unzip ModMii4.4.5B-BETA [*]Replace "modules\W19Modules\EHCI.app" with mine (see above)[*]Launch ModMii4.4.5B-BETA[*]Choose download page 4[*]Select 249BETA[*]Enter D to download the wad[*]Ignore the warning message
QUOTE said:
Checking entries in COPY_TO_SD\Download_Log.md5
COPY_TO_SD\WAD\cIOS249[56]-v21[EHCI-v19].wad: Invalid
Results: 1 files processed, 0 good files, 1 bad files.
It's absolutely normal since the EHCI module has been replaced so MD5 check fails.[*]Use MultiMod Manager to install cIOS249[56]-v21[EHCI-v19].wad
NOTE: despite the file name it's a real rev21 without lag[*]Enjoy it
cool.gif

CAUTION:
After replacing EHCI.app in modules folder ModMii4.4.5B-BETA will actually generate all rev19 cios with mine EHCI module.
If you want to download real rev19 wads you need to restore the original EHCI.app or else use standard ModMii4.4.5
 

kamiro04

Well-Known Member
Newcomer
Joined
Dec 3, 2010
Messages
62
Trophies
0
XP
94
Country
Argentina
davebaol said:
Ok guys, after sleeping 10 years the old coder in me is risen again.
laugh.gif


I've fixed the lag issue in ehci module of rev21.
It was a stupid bug inside the timer used by the watchdog.

Here is the final result:
  • the lag is completely gone
  • the watchdog is alive and kicking (contrary to BBogey's solution)
  • Shaun White Skateboarding works perfectly on base 56 and 57 (previous cIOS249[56]-v21[EHCI-v19] doesn't support that game).
I've heavily tested this solution with 4 different drives affected by lag issue, one of them (a Western Digital Elements SE - 2,5" - 1TB) manifesting severe symptoms, a 10 seconds cycle with the following base sequence:
  • 1 sec. LAG
  • 1 sec. NO LAG
  • 1 sec. LAG
  • 7 secs. NO LAG
Now all my drives run fluently.
cool.gif


Here is a compiled version of the fixed ehci module ready to build the cios with ModMii4.4.5B-BETA (just replace the module)
http://www.mediafire.com/?h4izwbtbfazj5je


Hope you like it
happy.gif
Wow! thanks davebaol, I'll test it now!
Do you remember of another problematic game you don't own that could be used to test it?

EDIT: Tested and all working, I was having problems with Worms: Battle Islands - now with base 56 works great
Just reposted this in the CFG Loader discussion so anybody with problems can test it and report back
Thanks again!!!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    I'll reformat and have a 3tb raid0 m. 2 at least
    +1
  • K3Nv2 @ K3Nv2:
    Lmao that sold out fast
    +1
  • Veho @ Veho:
    Yeet the cat.
    +1
  • K3Nv2 @ K3Nv2:
    Good idea
    +1
  • The Real Jdbye @ The Real Jdbye:
    i thought everybody knew cocktails are like 75% ice
  • Veho @ Veho:
    Yeah but not like this.
  • Veho @ Veho:
    It's not like they're complaining that their Slurpee is 99% ice or something, but if the cocktail calls for "shot of vodka, shot of vermouth, shot of gin, shot of Campari, three shots of juice, squirt of lemon" and ends up being a thimbleful of booze, that's a problem.
  • The Real Jdbye @ The Real Jdbye:
    the funny thing is cocktails in norway are only allowed to have 1 20ml shot of booze
  • The Real Jdbye @ The Real Jdbye:
    so..... yeah
  • The Real Jdbye @ The Real Jdbye:
    we're used to only having a thimbleful of booze
  • Veho @ Veho:
    Booo.
  • The Real Jdbye @ The Real Jdbye:
    same thing if you want whisky on the rocks or something, you can't get a double
  • The Real Jdbye @ The Real Jdbye:
    but you could buy as many shots of whisky (or anything else) as you want and ask for a glass of ice and pour them in
  • The Real Jdbye @ The Real Jdbye:
    it's dumb
  • Veho @ Veho:
    Maybe.
  • Veho @ Veho:
    There was a comparison of the number of Ibuprofen poisonings before and after they limited the maximum dosage per box or per pill (i'll look that up). No limit on the number of boxes you can still buy as many as you want, so people argued it was pointless.
  • Veho @ Veho:
    But the number of (accidental) poisonings dropped because drinking an entire package of ibuprofen pills went from "I need a new liver" to "I need a new box of Ibuprofen".
  • Veho @ Veho:
    Here we have ketoprofen that used to be prescription-only because of the risk of toxic dosages, but then they halved the dose per pill and sell them in bottles of six pills apiece instead of twenty and it doesn't need a prescription any more. Yes you can buy more than one bottle but people simply don't.
  • Psionic Roshambo @ Psionic Roshambo:
    Usually accidentally overdose of ibuprofen here is from people taking like cold medicine then ibuprofen for a headache and the combination is over what they need
    Veho @ Veho: https://imgur.com/gallery/QQkYnQu