Friday, June 26, 2009

New dual-boot release: fixed slowdown in original firmware

As usual, get it here.

I know some people is more than happy with what is actually a side effect of the slower pixel clock: no more screen tearing in certain emulators/games. However, I feel the priority is making dual-boot completely transparent to original firmware. And most importantly, the original firmware is unacceptably slow for some. For those that do need the slow pixel clock "untearing" effect, someone will soon release an "LCD underclocking" application (.app).

Regarding "tearing", it's a visible artifact resulting from frequency mixing. The two frequencies involved are the LCD refresh frequency (set by the LCD pixel clock) and the application screen refresh frequency (commonly called FPS or frames per second). When you multiply two frequencies you obtain two other frequencies: the sum and the substraction. The sum is usually too high to be noticed (65Hz+60Hz = 125Hz), but the substraction is a whole different story (65Hz-60Hz = 5Hz, which is very visible). This is the same effect you can see when you use a camcorder to record an old tube TV.

The only way to get rid of it is retrace syncronization, that is, to force the application to refresh screen at the same rate than the LCD is refreshed. I haven't studied very well how the LCD works and is connected, but I suspect that there is no easy way to synchronize the applications and the LCD. It may not be impossible, but it is certainly going to be difficult.

What you can be sure of is that the original firmware makes no efforts to synchronize, and that is not going to change anytime soon. Our best bet regarding this issue is definitely linux.

Finally one personal note: this has been so fast because I had plenty of time. I've been sick at home for the last three days: I had a very bad muscle contracture on tuesday evening and have had to stay in bed for the last two days. Today I'm better but can't stay sit or standing for very long. Fortunately with help from my wife I found a way to comfortably use my laptop while laying on my stomach. It's quite funny but works. Don't be surprised if you don't see any updates for the next days since I have lots of work (the one that pays the bills) pending.

32 comments:

  1. Hey booboo. Is there a way to change linux key bindings? I would like to make shoulder buttons work as switches so that when I press left shoulder or right shoulder button X,Y,A,B and rest of the buttons would change it's function.

    For example L+A= left alt, R+A= right alt, etc.

    ReplyDelete
  2. Gracias por la explicación y que te mejores!! :)

    ReplyDelete
  3. I successfully installed Dingux in my A320, but now every time I boot into Dingux the flasher is run... Any way to fix that?

    ReplyDelete
  4. Mmm, the usbtool in this release does not find the device:
    [INFO] File size: 4576 bytes
    [INFO] Searching for device...
    [ERR] Device not found.
    [ERR] Ensure your device is in USB boot mode and run usbtool again.

    ReplyDelete
  5. @Master:
    my usbtool (linux) worked well

    ReplyDelete
  6. @Marta

    Don't know what you mean. The flasher utility is embedded into the kernel you upload to RAM. Once your A320 is flashed, it will boot a zImage from miniSD, so you have to put a zImage and rootfs there (see Quickstart guide in the google code wiki). DO NOT USE THE SAME ZIMAGE USED FOR FLASHING DUAL BOOT. That is a spcially tailoerd ifmage just for flashing.

    @Grzegorz

    You can modify the keyboard driver code, and I even believe there is a way to change the key mappings from userspace, but I STRONGLY ADVISE AGAINST THAT. We need an uniform key map across all applications. If you change the keymap it will work only for your application, so why not just change your application?

    ReplyDelete
  7. Works well but
    after the (DINGUX-WWW.DINGUX.COM) Logo, the screen flash white during 1 second. No white flash with old dualboot.
    Just after this, le dingoo logo appears and the dingoo is ready.

    No more lag menus

    Thanx

    ReplyDelete
  8. I think Booboo, you made some kind of mistake in the new release README. "sudo" i dont think is a command windows console will recognize, and still is the only step there is.

    Can you check that? Thanks.

    ReplyDelete
  9. Yeah I have the same problem with windows. tried it 10 times but still the sudo command does not work

    ReplyDelete
  10. Oooops. Yes, sudo is not necessary in windows. Just remove it.

    ReplyDelete
  11. I think of temporarly changing keymap for existing apps. For example for Duke3d 7 buttons isn't enough. If it would be possible to temporarly change keymap just before starting Duke3d and return to original mappings on exit from game.

    Standard keymap is good, but for more complex games it could be a problem.

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. I removed sudo and tried it but still I cant it to work out

    ReplyDelete
  14. booboo, in the previous readme there is a command that says "boot 0", now when i type "usbtool-win 1 zImage_dual_boot_installer_ILI9325 0x80600000" tries to load the image but returns the error that haven't found the target device.

    ReplyDelete
  15. Yes, you did, i got it working, but you forgot to include in the zip the files for USB_Boot (you only included the USBboot.cfg file). I used the ones from the previous release. And yes, the Genesis has its graphical issues again, too bad and sad :(

    ReplyDelete
  16. "Which SPL to flash" does the install ask me..
    1 dual boot or 2 orignal firmware. What I`m gonna do here?

    ReplyDelete
  17. The first option is to reinstall dual boot with the slow issue fixed, and the second option is there to uninstall everything and just leave the original firmware without Dingux. I think, i tried first option and everything is OK.

    ReplyDelete
  18. I have no done it and I looks like it worked. I tried to hold select and start the dingoo. I came to the white dingux screen but no button does work so had to restart the dingoo. Is it right what I have done?

    ReplyDelete
  19. You mean you get stucked in Dingux logo screen? You have installed Linux on your SD card? (not dual boot, but linux). If not, please tell me if you have a 2 or 4gb sd card and i will give you something to make it easier than partitioning SD card and all that stuff.

    ReplyDelete
  20. Yeah that right.. But I do have 8gb Sandisk card. If your guide is only 2 and 4 then please tell me and I will try to get one of them

    ReplyDelete
  21. I have not done anything with the card yet

    ReplyDelete
  22. If you havent installed Linux on your SD, A600 posted an image of his SD cards, so you would only have to type a few commands and your sd will be a clone of his, with Linux on it.

    I don't have the time to translate it, i give you the link here, but if you don't fully understand what you are doing, i don't recommend you to unless someone translates it properly.

    http://www.gp32spain.com/foros/showpost.php?p=926558&postcount=600

    Typing the incorrect drive number, would erase it completely, and its better for you to wait.

    ReplyDelete
  23. Spanish.. only if I could know that language, but I will wait till there is an proper English guide. Thanks

    ReplyDelete
  24. Oh I guess I needed to replace the zImage... Thanks Booboo.

    ReplyDelete
  25. After some time of use, i find that tiny-font is really too small. or even inoperable. It will not be better to use a 8*8 font ?
    320*240 is very comfortable for this (look Amiga ot Atari OS). It is horrible to use with vifm, we see nothing at all. It must recompile the kernel to change it ? It can not be 2 versions of the kernel to see the difference ?
    What do you think about this extra small font ?

    ReplyDelete
  26. Yes, I know the font is tiny, but I needed it to show as much of the boot process output as possible, and thought that anyway nobody would be using text mode on the A320, since it does not have a keyboard.

    And then I wrote the dual boot installer and did it using text mode dialogs and changed the font to 8x16 :-)

    Seriously... font can be easily changed, but you have to recompile the kernel.

    I will consider setting 8x8 as the default for next release, but the boot output gets a bit unreadable due to line wraps.

    ReplyDelete
  27. Ok, thank you for the quick answer Booboo.
    One last little question.

    The dualboot works perfectly with this new release but now I have 4 Boot-screen.
    When I start the Dingoo (without pressing SELECT). I'm seeing:
    1) The DINGUX bootscreen (DINGUX www.dingux.com) during 1 second.
    2) A blank screen during 0.5 second.
    3) The logo Dingoo (the cat paw) during 0.5 second.
    4) The logo of the firmware (my logo in the firmware 1.03TD3) during 4 seconds.
    And the Dingoo is ready ! (all is ok)

    Is this normal ?, I do not think before the update of dualboot, there were 2 and 3.

    It's not a problem but 3 boot screens before My boot screen it's funny ;)

    Otherwise, it's very good job, a big thank you.

    ReplyDelete
  28. @smartseb62

    The display sequence you describe is correct:

    1) The dingox logo is shown for one second. If you press SELECT anytime during that second, linux boot will start. I've found that this works better than just sampling the SELECT state at the very beginning, and it's cool (says "this A320 is modded to boot linux").

    2) The dual-boot SPL code does not switch the backlight off. This is in order to show something on the display while U-Boot loads, then kernel loads, and the framebuffer driver kicks in. A side effect of this is that you'll see a while LCD when the original firmware SPL initializes the LCD. Before you installed dual-boot, this was actually happening while the backlight was off, so you didn't see it. This shortly shown white screen can be completely avoided when booting the original firmware by just switching backlight off after the dingux splash, and it can be avoided in linux if I modify the kernel framebuffer code to make sure backlight is off BEFORE initializing the LCD.

    3) Has always been there (at least in my A320).

    ReplyDelete
  29. Ok thanx Booboo for taking the time to answer. All is OK. Nice job.

    ReplyDelete
  30. [ERR] Device not found.
    [ERR] Ensure your device is in USB boot mode and run usbtool again.

    This is the error message I always get (after dozens of attempts). The first command (hwinit) finds the device-the second (zImage...) does not. ChinaChip drivers have been removed, Dingoo is DEFINITELY in USB mode. I am up against a blank wall. Is this because I have a new Dingoo (ILI9331-3) which is incompatible?

    ReplyDelete
  31. Listen, there are 2 different drivers for USB mode, one for flashing porpuses known as Chinachip USB Loader, the other is for Dingux Dual boot installation porpuses named on Device Manager as Jz4740 USB Boot Device (Rockbox USBtool)

    ReplyDelete