like I said, the channel is not even launched !
if it were, you'd see the USBGX logo first before it even tries to mount SD or HDD, if it fails it would go to sysmenu.
but you'd see the logo if it's a device mounting issue!
If it's a channel booting issue, then you wouldn't see the logo. But then, it's not USBGX channel booter's fault, but the console, because the source is always the same, being random means it's probably not the souces nor libogc nor priiloader either. something like hardware or time base issue? Timing bugs are not easy to spot.
if the wii boots directly to sysmenu it means the installed dol didn't even manage to boot the channel.
So, it's either :
- priiloader not booting the installed dol
- installed dol not booting the channel (I don't think, but still a possibility, like ... NAND access not ready?)
priiloader's UNEO booter source :
You could try by installing another dol, for example the forwarder.dol (with a meta.xml and no_ios_reload tag) to get AHB access to USBGX boot.dol
or directly the boot.dol (the meta is already provided) so it would boot it directly.
you'd see wheher the dol is launched or not. But being a random occurrence, it's always hard to trigger it to properly debug the problem.
If you can do the tests, be sure to enable LOGS in priiloader and post in Priiloader's 9 thread!
DacoTaco will help and fix the problem if it's indeed something on his side.
if it's just a Wii init/libogc issue, he can't do a lot. maybe add a delay? not sure.
Edit:
further check of the sources:
(booter) Wii init -> (libogc) init by doing IOS_open/write/close or error -> (booter) launch uneo tile -> (libogc) if init then launch title or error -> (booter) if error, boot sysmenu -> (libogc) if init launch sysmenu title or error
If it's a timing issue, maybe "
WII_Initialize();" does some async calls? (IOS_open/write/close are async?)
But it waits for a return value or fails into error. so I think it's sync.
WII_LaunchTitle() starts by checking if it's initialized and return an error if not, resulting in return to menu.
"WII_ReturnToMenu();" does the same init check to loads sysmenu, it would fail if not init yet.
meaning it wouldn't even reach return WII_LaunchTitle(0x100000002LL);
and sysmenu wouldn't launch.
so, I think the wii is properly initialized, libogc properly run Launchtitle and the channel should launch.
the sources is pretty short, so I don't think it's the booter problem.
I didn't look at priiloader source, but I still think doing lot of tries with logs enabled and showing DacoTaco when it's happening will give us more information.
Like I said, I often noticed this behavior when booting the wii using the wiimote power button !
never when using the console's button.
Soo, maybe the timing or the boot is different when triggered from the wiimote?