DS-Homebrew / TWiLightMenu

DSi Menu replacement for DS/DSi/3DS/2DS
https://wiki.ds-homebrew.com/twilightmenu/
GNU General Public License v3.0
3.23k stars 202 forks source link

Takes incredibly long to boot #471

Closed PoroCYon closed 5 years ago

PoroCYon commented 5 years ago

Your console

Tell us which console do you have:

CFW and configuration

Tell us which CFW do you have:

DSi:

3DS/2DS:

TWiLight Menu++ version

Tell us which versions you are using:

Expected behaviour

Something, any sign of life, should be shown within, let's say, 10 seconds. Preferably, the 'main menu' should be shown (when all "show splash screen"-options are turned off, of course), but anything is better than starting to doubt whether everything still works.

(10 seconds is quite generous, I think, it takes less time on my 8-year-old laptop with an equally old HDD to load the bootloader, decompress and jump to the kernel, initialize all drivers and start the init process.)

Actual behaviour

But no, it takes thirty seconds, I repeat, thirty seconds, to do anything at all. Both WinterMute's hbmenu and the system firmware prove that it's possible to do near-instantly. So why does it take this much time? It wasn't this bad in older versions[citation needed], although it was already taking quite some time.

(Secondly, menu navigation is slow because the scrolling animation stops at every menu item, instead of continuing for as long as the dpad button is being pressed. This makes navigation quite painful, but I'm keeping myself from opening another issue because it's currently very hard for me not to start a rant about things like these.)

Steps to reproduce

  1. Turn on the hardware
  2. Stare at the blank screen
  3. Wait
NightScript370 commented 5 years ago

You should get the latest nightly, because it fixes bugs like these. They can be found at @TWLBot's builds repo

chyyran commented 5 years ago

The second bug with the scrolling fixed in the nightlies, but I can kind of vouch for the primary issue, title does seem to take unreasonably long to boot.

NightScript370 commented 5 years ago
[3:14 PM] NightYoshi370: chyyran, do you think you can take a look as to why title takes so long?
[3:16 PM] chyyran: i think robs answered that before
[3:16 PM] chyyran: fatInitDefault takes long
[3:16 PM] chyyran: cant really get around it i assume

BTW, I don't think you should open an issue on having to wait. TWiLightMenu++ does a lot of things much more than the official DSi Menu and the hbmenu, and those things take time to initialize.

NightScript370 commented 5 years ago

Also, this does not happen for me at all. On my Old 3DS XL with my 32GB SD card using a 32K cluster size, it takes 5 seconds from when the screen turns white to go to the main DS-like menu.

PoroCYon commented 5 years ago

I'm using a DSi XL, so there's of course a bit of a slowdown there, and a 16 GiB SD card, which might also slow down things if the FAT driver tries to index all files right away. (EDIT: I don't remember the exact FAT parameters, though, I'll check those when I'm home.)

FYI, Official titles like DSi Sound and Flipnote need a few (<10) seconds to iterate over all the files on the card, but that's still much less than what TWiLightMenu++ does.

Alternatively, a stripped-down version of TWILightMenu++ that doesn't have all the bells and whistles would be nice to have. (eg. no fancy themes, no video playback at startup, etc., but the CPU mode, SCFG access etc. options could still be present, I need them because I'm trying to mess with the DSP.)

chyyran commented 5 years ago

Have you tried the nightlies? I'm not experiencing this drastic of a slowdown on my 3DS with a 64GB SD.

You have to keep in mind that DSi Sound and Flipnote have access to official SDK materials, whereas all DS homebrew is built on the back of hobbyist work. It's much easier for Nintendo to optimize for their own systems than it is for us.

On Mon., Mar. 18, 2019, 8:10 a.m. PoroCYon, notifications@github.com wrote:

I'm using a DSi XL, so there's of course a bit of a slowdown there, and a 16 GiB SD card, which might also slow down things if the FAT driver tries to index all files right away.

FYI, Official titles like DSi Sound and Flipnote need a few (<10) seconds to iterate over all the files on the card, but that's still much less than what TWiLightMenu++ does.

Alternatively, a stripped-down version of TWILightMenu++ that doesn't have all the bells and whistles would be nice to have. (eg. no fancy themes, no video playback at startup, etc., but the CPU mode, SCFG access etc. options could still be present, I need them because I'm trying to mess with the DSP.)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/RocketRobz/TWiLightMenu/issues/471#issuecomment-473884465, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9ENwjy59I0Ao6E3nXuKFm6Q0Mvh4bBks5vX4JEgaJpZM4bZv8Z .

PoroCYon commented 5 years ago

Have you tried the nightlies? I'm not experiencing this drastic of a slowdown on my 3DS with a 64GB SD.

I haven't done that yet, because, as I understood from a previous comment, it mostly changes the scrolling issue, but not the loading thing. I'll try it tonight.

You have to keep in mind that DSi Sound and Flipnote have access to official SDK materials, whereas all DS homebrew is built on the back of hobbyist work. It's much easier for Nintendo to optimize for their own systems than it is for us.

Nintendo doesn't always deliver quality work, and there are a lot of freely usable, working FAT implementations floating around (Linux, all the BSDs, GRUB, Minix, lots of other 'hobby' OSes, and probably even things like RockBox as well), it wouldn't be hard to use one of those.

chyyran commented 5 years ago

The POSIX environment provided by devkitARM is fake. It doesn't implement full POSIX, and only acts like it on the surface. The FAT implementations from Linux would probably run worse than Chism's libfat, which was written for the constraints of the DS; even if they did not, it would not be trivial to port. The reality of it is is that the Nintendo DS probably has a twentieth of the computing power as a 10-year old laptop.

The nightlies include a plethora of bugfixes that may contribute to reducing loading times in other areas, hopefully they at least reduce the problem somewhat.

PoroCYon commented 5 years ago

Whether it is a POSIX environment doesn't really matter, because the API used to talk to the driver doesn't matter that much to the performance.

It's true that a DSi is incomparable to current-day laptops (I've written my own share of graphical effects, in hand-optimized assembly, to achieve 60 FPS), but PCs aren't the only devices Linux (used to) run on. There used to be a port that ran on Motorola 68020s (NetBSD still has theirs), which is comparable in performance to the ARM7. RockBox is made for low-end devices as well, their FAT driver can be found here (GPL).

PoroCYon commented 5 years ago

I've tried the nightly now (I'm a bit late, sorry for that), and it still takes around 30 seconds.

Scrolling is much better now, though, so thanks for that. (But that's only a side issue, as the startup time annoys me most, because I have to test stuff I'm making, and dslink/wifiboot doesn't work for some reason.)

NightScript370 commented 5 years ago

Why not try deleting main.srldr and renaiming mainmenu.srldr to main.srldr?

PoroCYon commented 5 years ago

Results in a Guru Mediatation (after the usual loading time):

pc: 02024792 addr: 080000ac

r0: 080000ac   r8 : 02ff4000
r1: 02081af0   r9 : 020ccf7c
r2: 00000004   r10: 020cdeb0
r3: 00000000   r11: 00000001
r4: 020cc71c   r12: 02024781
r5: 02081af0   sp : 0b0023d0
r6: 020ccf7c   lr : 01000147
r7: 02ff4000   pc : 0202479a

0b0023d0:   020cc71c 02081af0
0b0023d8:   020ccf7c 01000147
0b0023e0:   00000000 02ff4000
0b0023e8:   020ccf7c 020cdeb0
0b0023f0:   00000001 02ff4000
0b0023f8:   020ccf7c 00000001
0b002400:   02ff4000 020ccf7c
0b002408:   020cdeb0 02010b63
0b002410:   00000000 00000000
0b002418:   00000000 00000000

this is the nightly from today (2019-04-08)

FlameAlt53 commented 5 years ago

twilight menu++ on my DSi booted very fast when launching it from the DSi Menu... and with HiyaCFW autoboot it is about as long as it is on my n3ds.

PoroCYon commented 5 years ago

FlameAlt53: what's the storage size of your SD card? Mine's 16 GiB.

FlameKat53 commented 5 years ago

(Hey, main account)

128GB Micro SD Card on my 3DS (UHS 1) 32GB Sandisk Micro SD Card on my DSi (Class 10)

PoroCYon commented 5 years ago

Ok, so it's apparently not the FAT driver being slow on larger volumes? Hm.

Is this the 8.0.0 version you're talking about? I'm still on the 2019-04-08 nightly, and I'm currently in a situation where I do not want things to break, so I'll only be updating after this weekend.

Also, "with HiyaCFW autoboot it is about as long as it is on my n3ds" ... how long is this? I don't have any 3DS.

WorkoutEathealthy commented 5 years ago

Hey I just wanted to say I got the exact same problem on my DSi XL. It takes about 35 seconds to boot and it annoys the hell out of me. Any progress so far?

Epicpkmn11 commented 5 years ago

I'm pretty sure this is mostly a HiyaCFW problem, not a TWiLight problem. TWiLight is still kinda slow, but the 30s or so load times go away if you directly boot TWiLight from Unlaunch... Unfortunately you need Hiya for nds-bootstrap currently...

flutterbrony commented 5 years ago

hmm, in my tests, it took only 19 seconds on the dsi with the nds boot animation and health and safety meessages

PoroCYon commented 5 years ago

@Epicpkmn11 : if I let HiyaCFW boot into hbmenu, it's pretty much instant. TWiLightMenu takes quite a long amount of time.

piratesephiroth commented 5 years ago

How long does DSiWare take to boot on average? TWiLight Menu is an installed title so you can't compare it with homebrew running from the SD.

PoroCYon commented 5 years ago

A second or so. If the difference wasn't so huge, I wouldn't have opened an issue here.

Epicpkmn11 commented 5 years ago

Since nds-bootstrap v0.19.x are working without HiyaCFW again, I got my 128GB card and it takes basically the exact same amount of time to boot TWiLight Menu++ (~6s from power button to loading screen showing up) if you boot BOOT.NDS instead of hiya.dsi in Unlaunch. (If you boot hiya.dsi it takes forever) So I don't think TWiLight is significantly negatively affected by large cards, just HiyaCFW. I'd recommend trying booting TWiLight with BOOT.NDS and seeing if it helps

PoroCYon commented 5 years ago

I've tried it, and it boots much faster indeed. However, the touchscreen doesn't work this way. I guess I'll open another bug.