Setting up resolution in Android

6,308 views
Skip to first unread message

Marian Buschsieweke

unread,
Apr 2, 2013, 6:58:36 PM4/2/13
to cubie...@googlegroups.com
Hi, everybody!

I'm using the "Android TV Box Allwinner release2 image [285MB] (preferred Android image for Cubieboard, with XBMC preinstalled)" android image on a DVI monitor, which does not send any EDID information at all. I'm able to set up the resolution on Linux (arch linux arm) via module parameter:

/etc/modprobe.d/resolution.conf:
options disp screen0_output_type=3
options disp screen0_output_mode=1920x1080p60

I tried to set the resolution up via script.bin (first converting script.bin to fex via bin2fex, then changing screen0_output_mode to 10 in the [disp_init] section, then converting the edited fex file back to bin via fex2bin and replacing the old script.bin by the new one). I found two script.bin files in /dev/nanda (script.bin and script0.bin) and changed both. But it was totally ignored.

I guess I also have to work with module parameters. But how do I set these up in android?

Thanks for your help!

Regards,
Marian

Stefan Boller

unread,
Apr 3, 2013, 6:28:47 AM4/3/13
to cubie...@googlegroups.com
it seems that the device use the script.bin changes and do a fullHD resolution untill the android gui starts. Then the android resolution overrides it.
but i can´t find the file with the HDMI output resolution.

Rolando Quivira

unread,
Apr 3, 2013, 10:32:51 AM4/3/13
to cubie...@googlegroups.com
Yep... same here.
About 2 month ago I've tried to do the same with a lvds LCD with the same results: android starts on the LCD but when the gui loads it goes back to the hdmi..... sigh... 
(and I haven't come back to the cubie since then... D=... I know, I know... shame on me! )

We need a Android gurú I think hehe.

Bye!.

Silverio Diquigiovanni

unread,
Apr 4, 2013, 7:38:32 AM4/4/13
to cubie...@googlegroups.com
I've saw the same effect and I've catch interested code in Android.
In next days, I will try a patch to solve that ...

Stay tuned :)

Rolando Quivira

unread,
Apr 5, 2013, 9:54:59 AM4/5/13
to cubie...@googlegroups.com
Niiiiice... I hope it work without any problem for you =). 
We'll be tuned, of course.

Mike Fe

unread,
Apr 6, 2013, 6:33:50 PM4/6/13
to cubie...@googlegroups.com
I hope you had a success with fix for this little bug. Let us know when you have some results, thanks

Silverio Diquigiovanni

unread,
Apr 7, 2013, 2:20:28 PM4/7/13
to cubie...@googlegroups.com
Actually I've solved changing some code in SystemServer.java and now Android don't re-init display and all works fine.
Unfortunately I wasn't able to store resulting img in nand with LiveSuit (I'm running XUbuntu 64 bit on MAC OS Host).

For a better fix should be necessary to add the LVDS settings on android, actually I've removed HDMI and TV settings so it don't touch
initial settings.

Give me some day to solve some issue with nand flash... (at moment I'm running Android in SD)

Silverio Diquigiovanni

unread,
Apr 8, 2013, 8:09:34 AM4/8/13
to cubie...@googlegroups.com
IMPORTANT: I'm NOT responsible for any bugs caused by custom-made fixes/additions/tweaks. You use them at your own risk and responsibility!

Ok, I'm so busy these days that I can't afford that project but I've made a workaround that works for what would like to use LCD display (normal or LVDS),
using script.bin how only way to configure display hardware.


In that sources I've changed SystemServer.java removing the display re-initialization part so system continue to use values read in script.bin.


So :

- Flash it with LiveSuit
- Start Cubieboard without a display connected.
- After a while use adb to change script.bin with:
   
   $adb shell
   mkdir /mnt/tmp
   mount -t vfat /dev/block/nanda /mnt/tmp
   exit

   $adb pull /mnt/tmp/script.bin
   $bin2fex script.bin script.fex
   
   Modifiy script.fex to support your LCD (every display is different)

   $fex2bin script.fex script.bin
   $cp script.bin script0.bin
   $adb push script.bin /mnt/tmp
   $adb push script0.bin /mnt/tmp
   
   $adb shell
    busybox umount /mnt/tmp
    exit

  Power off your board, connect LCD display and cross fingers...

Mine works fine with 800x480 and antutu show :
 


Rolando Quivira

unread,
Apr 8, 2013, 9:27:28 AM4/8/13
to cubie...@googlegroups.com

Congratulations and thank you Silverio!. I'm going to try this out when I come home tonight =D I'll post results obviously.

Mike Fe

unread,
Apr 8, 2013, 3:29:00 PM4/8/13
to cubie...@googlegroups.com
Thank You for this fix. Does anyone know how to enable 800x480 resolution on hdmi out? Or at least on VGA? I'm desperate to find any working solution. Regards

Silverio Diquigiovanni

unread,
Apr 8, 2013, 3:37:51 PM4/8/13
to cubie...@googlegroups.com
> Thank You for this fix. Does anyone know how to enable 800x480 resolution on hdmi out? Or at least on VGA? I'm desperate to find any working solution. Regards

Ok,  here I'm writing a document on how to connect a LVDS display (a sample) to cubieboard (I haven't finished yet... sorry) : http://linux-sunxi.org/Cubieboard/LVDS

In document you can find also the script.fex (only display part) that I've used for my target.

I hope this help you.

shineworld

Mike Fe

unread,
Apr 8, 2013, 3:56:54 PM4/8/13
to cubie...@googlegroups.com
Hey Silverio,
 
You're using settings for  LVSD connection but I use HDMI out on cubie to LCD controller and only then to Innolux 6.5" matrix. I see that it's possible to output 800x480 through LVDS if only it was able to do the same for HDMI. Regards

Silverio Diquigiovanni

unread,
Apr 8, 2013, 4:43:09 PM4/8/13
to cubie...@googlegroups.com
> You're using settings for  LVSD connection but I use HDMI out on cubie to LCD controller and only then to Innolux 6.5" matrix. I see that it's possible to output 800x480 through LVDS if only it was able to do the same for HDMI. Regard

I'm using only a LVDS display connected to Cubieboard and I don't use HDMI connector.
However you can connect your Lnnoulux 6.5" matrix directly to LCD outputs of cubie changing settings to script.bin to meet its requirements.
I don't think you have to use HDMI connector for that.

I've choose LVDS because is fast to cable, is more robust in industrial fields vs noise and vibrations stress (overall for a prototype where I don't have realized yet a specific baseboard).

A10 is capable of dual framebuffer but android isn't. So only a display framebuffer can be used and only one display.
Otherwise you can use more than one display if that uses same resolution (HDMI resolutions are limited from standard).

Sorry if I've mistake the question,
my English is so limited ...

Mike Fe

unread,
Apr 8, 2013, 6:01:10 PM4/8/13
to cubie...@googlegroups.com
The thing is I need a hdmi out because I use two sources that I switch between using lcd controller for that lcd matrix. Your route is perfect if using one source and still thank you for creating a fix for us. Although it's strange that A10 hdmi can't push 800x480 because if I use pc board with correct driver I'm able to receive that resolution. Are those resolutions (576p, 720p  etc) hardcoded in kernel?
 

Rolando Quivira

unread,
Apr 8, 2013, 7:08:53 PM4/8/13
to cubie...@googlegroups.com
Hey! Silverio. it worked!!!! Thank you very much. Here's a picture


As for your tutorial, we wrote with George Loakimedes a little tutorial on that too. It's on the LVDS Display thread. There's some formulas too about the parameters, and if you want I can send you a tutorial on how to get the parameters from the EDID itself, so you can add it to the wiki (I don't know how hehe).

Anyways. Thank you very much! =D
Good work!.

Bye!

tvsa...@gmail.com

unread,
Apr 24, 2013, 5:20:29 AM4/24/13
to cubie...@googlegroups.com
Hi Silverio.
Please give instruction how-to patch my own sources of cubieboard with  ypur patch. I have not found  SystemServer.java in the uncompressed directory to change it. 

понедельник, 8 апреля 2013 г., 16:09:34 UTC+4 пользователь Silverio Diquigiovanni написал:

Silverio Diquigiovanni

unread,
Apr 24, 2013, 12:28:08 PM4/24/13
to cubie...@googlegroups.com
tvsa if you compare the https://www.dropbox.com/s/v9vka32mlqtld9x/SystemServer.java with original SystemServer.java you can view that I've added some comment
to remove code related to display re-initialization according with settings in System.settings.

It's only a workaround but work for me.

I'm modifying all the code adding LCD (LVDS) settings to DisplaySettings, Dispxxx, and so on ...

It's a lot of job so I don't know if I will able to finish next week.

ariee dzig

unread,
Apr 25, 2013, 7:07:31 AM4/25/13
to cubie...@googlegroups.com
Hi Silverio,

Will this work with VGA out?
I have modified script.bin and script0.bin to use VGA as output and use your image.
Android was started and displayed the android desktop for a couple second and then blank.
After that, I cannot get any display on my VGA monitor at all, even though I start over the step that you have mentioned.

Regards,

Arief

Silverio Diquigiovanni

unread,
Apr 26, 2013, 2:13:22 AM4/26/13
to cubie...@googlegroups.com
I guess because In SystemServer.java, one of Android's main classes executed at early stage, read System configuration
and restore HDMI default settings.

A workaround is just remove that code.
I've tried it and works fine for me with LVDS pannels.

I don't know how VGA over HDMI works, but if it is only a different devices settings
in resolutions the SystemServer.java is the right point to work because it restore
all to default HDMI values or previous HDMI settings used.

The right operation should be add new display sizes to it to support your configuration...
There are other class to be modified for that....

Frank LaVerne

unread,
Jun 1, 2013, 4:43:42 AM6/1/13
to cubie...@googlegroups.com
 
Mike,
 
I use the same display via a VS-TY2662 (also known as PCB800099) inverter board which provides HDMI output.
 
While it's not possible for me yet to switch to 800x480, which is a WVGA resolution not provided natively via HDMI, I could switch to HDMI 480p (720x480) easily, which is A LOT better on the little display than the standard 720p setting.
 
I know that this setting also is provided in Settings->Display->OutputMode, but don't be fooled - for me it just seems to have changed the pixel density.
 
You have to stick to the manual regarding script.bin provided by Silverio above, and change the following settings (details can be found using the Allwinner Fex Guide):
 
screen0_output_type = 3
screen0_output_mode = 2
 
Now: The type is 3, which according to the guide is HDMI (which is exactly what we want). The mode originally is 5 though, which according to the guide is 720p - so here we go and change the value to 2, which is 480p resolution.
 
After pushing the modified script.bin back and reboot, we have 480p resolution.
 
Go on and give it a try, it's worth it!
 
Cheers,
 
Frank

Mike Fe

unread,
Jun 12, 2013, 4:21:19 PM6/12/13
to cubie...@googlegroups.com
Hey Frank,
 
Thanks for this information. I already done that before and it works flawlessly though I've gone further and trying to recode 480p to show 800x480. I'm close to the truth but still not there. Anyways I'll let you know if I succeded.
 
Regards

Bastam Beyrami

unread,
Aug 9, 2013, 1:48:48 PM8/9/13
to cubie...@googlegroups.com
thanks for your instruction
if possible please help me how to change SystemServer.java and generate output img for LiveSuit

herve devehat

unread,
Sep 6, 2013, 1:25:10 PM9/6/13
to cubie...@googlegroups.com
Hello Silverio,

Thanks for your method, your image works fine with my LCD and Cubieboard.

However it works only in landscape mode. Is there a way to make it work in portrait mode ?

Regards,

-Herve

Reply all
Reply to author
Forward
0 new messages