Changing the Android resolution

Started by jupoulton, September 02, 2013, 06:02:00 PM

Previous topic - Next topic

jupoulton

I want the resolution from the hdmi of my A20 to have the same aspect ratio as 1280*1024.
I need it to be on Android.

Where do I change this ? In the SDK source code ?

tlhingan

I don't know about the Android image for this device,
But I assume they've set it up in a similar way as the Debian image.
If it is, then the driver will autodetect the native resolution of the screen you are outputting to and will try to match the resolution.

jupoulton

I have it connected to a 1280*1024 LCD screen. And its only resolution option is 1024*600  :-\
And I can't find any fex scripts in the android distrib.

gaussgss

The .fex scripts are in boot sector block of the NAND.

You can mount it from adb shell with:

mkdir /boot
mount -t vfat /dev/block/nanda /boot


Then you will see script.bin and script0.bin in the /boot.
A13,A20,LCD7TS

jupoulton

Thank you, I mounted the boot partition and modified script.bin (there wasn't any script0.bin).
However, even though I've changed all sorts of display options (including the resolution for A13LCD7inch screen connected to LCD port), when I reboot I get exactly the same result : default 1024*600 on hdmi + garbage on the LCD.
Is modifying the script.bin the proper way to change the resolution of the hdmi, it doesn't seem to have any effect ?

Mouchon

Hello,

The script bin that you need to change seem not to be on nanda(boot) but on nandb(env)


jupoulton

Thanks Mouchon,
Do you know how I can mount the nandb partition ? It seems to have an unknown filesystem.
mount -t vfat /dev/block/nandb /boot
outputs "Invalid argument".
I've tried replacing vfat with other filesystem names but nothing I tried worked.

stulluk

Let me try to help as much as I can...

In Olimex A20 board with the SDK, there is nothing working as we expect to run like Linux builds ( i.e debian )

I have exactly same issue with you, however mine is a little more complicated ( I am trying to be able to change resolution for HDMI, 7" LCD and 10" LCD" at the same time )

I am working on the SDK's provided by whoever ( olimex, wits, aw...), but the only one I have found is the torrent file found in the wiki here: https://www.olimex.com/wiki/A20-OLinuXino-MICRO

When you download the SDK, you will have to decompress to your (*)ubuntu and be able to compile with following steps:

cd lichee
./build.sh -p sun7i_android
cd android4.2
source build/envsetup.sh
lunch 15
extract-bsp
make -j8
pack

This will give you a ~450Mbyte img file in the end ( for the 1st time of android compile, it will take hours... After 1st succesfull compile, it will take some minutes, not hours :) )

What you said whole above is fully correct:

1) In android builds, script.bin file in /dev/block/nanda has ZERO effect.. Even I modify script.bin for different resolutions, it doesn't take effect.

2) You can NOT mount nandb to anywhere, because it is a RAW partition, you can only take the image of it, loop mount....etc but that is hard way to do..

3) The easiest way to be able to change resolution is by modifying the file:

lichee/tools/pack/chips/sun7i/configs/android/wing-k70/sys_config.fex

In this file, there are a lot of options, and please be carefull about them... I have succesfully be able to change resolutions up to 1920x1080, but when I do this, android system gets very very slow and crashes..

=====

For 2 weeks, I am trying to figure out how to use Android on OLIMEX A20 board, but unfortunately most of the people using these embedded devices uses Linux, and of course Linux is much much better OS than any others, so they have no problem...

But for us, which need to use Android, there are really very lack of knowledge, information, experience from the people..

This is not only for Allwinner, I have used TI, IMX.. mostly similar,android building and matching with the SDK is very very blind eyed... Hard job..

I am sorry to inform you about these, but if I can figüre out why UARTs are causing kernel to die, why sys_config.fex doesn't take correct effect, how to build android on A20 correctly... I will try to help...

jupoulton

#8
Thanks a bunch stulluk, thanks to your help I've made good progress !
I should now be able to have the proper aspect ratio for my A20  ;D.
I tried using a 1920x1080 resolution too but, like you said, performance was terrible. Except when playing video ! Had HD video running just fine. But I don't want the App to crash so I'll stick with a lower res I think. I suppose this is because the A20's CPU has to do all the rendering of the OS by itself, causing the performance drop.

You said you wanted to have three screens at the same time connected to your A20 ? Isn't that impossible ? there are only 2 sets of screen config options in the fex files. And I'm pretty sure I read "2 framebuffers" somewhere on the datasheet.

Does your compiled Android image have the Ethernet working ? I haven't looked into making the network available yet. I could try with a USB connector for now I suppose.

You are right about Linux, but unfortunately there doesn't seem to be a way to have accelerated video on Debian image yet. Playing HD video is my top priority.

olimex

A20 can drive LCD and HDMI separately in different resolutions

stulluk

Yes I have been able to enable Ethernet on OLIMEX A20 board. To be able to do this:

cd lichee
make ARCH=arm menuconfig
Go to Drivers/networking-> And enable Ethernet EMAC for sun7i
Save &exit
./build.sh -p sun7i_android
cd ../android4.2
extract-bsp
make -j8
pack

And you will have Ethernet on Android settings, just enable it and it will get DHCP automatically in 10 seconds...

However, I think it still have some issue with power management, and when system enters SuperStandby state, EMAC GPIOs fails suddenly, I still couldn't figure out why...

I am not sure what happens if you disable SuperStandby by using sys_config.fex file that I mentioned above..

If I be able to fix it, I will let you know...

Please note that, for Ethernet, we even didn't touched to sys_config.fex file. I mean, if you enable it by kernel .config, you really don't need to touch sys_config.fex.. I feel it is really strange, if you search internet for this, many people will tell you about sys_config.fex, but it is really nothing alone...

And what @olimex said above is correct. Theoritically, A20 can drive two display at the same time. This is also said to be done by sys_config.fex, but I think this is not true in reality, surely we had to touch some more places to be able to get this done...

And, finally, I have used much worse performance chipsets to be able to get 1920x1080 output on HDMI, surely this A20 must also be able to do it fluently, but the bad point is nobody knows android :(

If I could help, I would do my best for you, you can contact with me stulluk [at]  gmail dotcom :)

Meanwhile, if olimex share how they enabled bottom USB would be great ;)

stulluk

It seems I have fixed UART, Ethernet and Bottom USB issues ;) Trying to figure out display issues :(