Jump to content


Photo

Pre-Alpha 0.3 Ubuntu Linux for MK802 III / UG802 / MK808 / UG007 / iMito MX1


  • Please log in to reply
505 replies to this topic

#341 fkubi

fkubi

    Member

  • Jr. Member
  • PipPip
  • 20 posts

Posted 15 January 2013 - 04:30 AM

...

./mkbootimg --kernel Image --ramdisk ramdisk.gz --base 60400000 --pagesize 16384 --ramdiskaddr 62000000 -o recovery.img

ramdisk.gz - fake ramdisk

Thanks!

Now it seems that everything works fine, but it was a long night :)
I erase Android, so do not follow the description below! If you do so you will kill all the puppies and baby seals in the world!

  • I've recompiled the kernel with my config (added Atheros support for my TP-Link dongle, removed some stuff to decrease footprint) and used initramfs.cpio from Andrew --> arch/boot/Image
  • The kernel image file is larger than 8MB, so I had to modify parameters.txt in the ROM Flash Tool: I've simply added 0x2000 (+25% sould be enough for now)to the original 0x8000 size of the kernel space on the MTD and, of course, shifted the position of all items after the kernel by the same amount. Unfortunately the flash tool does not read this file for flashing, so you need to update the flashing positions in the tool too.
  • Flash it! Well, it took 10 times 'till I realized that it is not enough to flash the kernel, but somehow I have to flash the recovery image too. If I do not flash the recovery the box does not reboot, but stays in programming mode.
  • Copy the newly built modules to the root partition. Note that you may need to delete old ones...
  • Just reboot and enjoy Ubuntu with network connection.

But honestly, who needs Ubuntu? I'm a Debian guy :)

  • Created a new partition on my SD card.
  • Mount it to /mnt
  • Run debootstrap to set up a Debian testing
  • Chroot and install some fancy stuff such as iw, wpa supplicant and Midnight Commander
  • Copy kernel modules and firmwares to the new filesystem
  • Use e2label to rename the old linuxroot to ubuntu and give linuxroot name to the new partition.
  • Reboot
  • Enjoy Debian Testing

This was a quick hack, needs some polishing. One of the most important stuff is to change the initramfs.cpio to Debian's to have it as standard as possible. I also plan to create a proper Debian package from the kernel source.

I will share all of my files in the afternoon (CET).

#342 fkubi

fkubi

    Member

  • Jr. Member
  • PipPip
  • 20 posts

Posted 15 January 2013 - 04:47 AM

You have identified the points to short correctly...

but the tool to short the same needs sharper edge.

I recommend using a this screw-driver, to first scrape off any flux that is bound to be there...
Second, use the same screw-driver to short the same.
Lastly, while keepint it shorted, you need to powerup...

Be assured, it works... you need to try it out for a few times...

Alok


Some advice if you are touching microchips...

  • DO NOT TOUCH! Definitely not when the device is powered.
  • Use static electricity release wrist tap
  • Buy an SMD micro switch, push button or jumper head and solder/glue it to the panel. MX1's manufacturer did it, thanks God (or Comrade Mao).


#343 burchanie

burchanie

    Member

  • Jr. Member
  • PipPip
  • 26 posts

Posted 15 January 2013 - 06:11 AM

This was a quick hack, needs some polishing. One of the most important stuff is to change the initramfs.cpio to Debian's to have it as standard as possible. I also plan to create a proper Debian package from the kernel source.

I will share all of my files in the afternoon (CET).


Just as a matter of feature request. Is this very difficult to recompile your kernel with Oprofile support? It is a low overhead kernel-level profiler which uses kernel's perf subsystem. Very useful for low level comparizon of these ARM chips to more conventional architectures. From my preliminary tests, my AK802 shows a very comparable performance to my high-end i7 laptop (when compute job is very small to fit into cache, it sometimes does just twice slower being run at 1Ghz vs 2.8Ghz for my i7 sandy bridge). At the moment the only way to measure the performance is bash time commmand, but it would be very useful for me to go deeper. I'm going to make some postings with performance tests I'm doing for everyone's benefit.

#344 cctsao1008

cctsao1008

    Newbie

  • Jr. Member
  • Pip
  • 3 posts

Posted 15 January 2013 - 06:45 AM

Great job, thank you!!

I am going to buy one UG802 to test with this release.

#345 fkubi

fkubi

    Member

  • Jr. Member
  • PipPip
  • 20 posts

Posted 15 January 2013 - 07:00 AM

Just as a matter of feature request. Is this very difficult to recompile your kernel with Oprofile support? It is a low overhead kernel-level profiler which uses kernel's perf subsystem. Very useful for low level comparizon of these ARM chips to more conventional architectures. From my preliminary tests, my AK802 shows a very comparable performance to my high-end i7 laptop (when compute job is very small to fit into cache, it sometimes does just twice slower being run at 1Ghz vs 2.8Ghz for my i7 sandy bridge). At the moment the only way to measure the performance is bash time commmand, but it would be very useful for me to go deeper. I'm going to make some postings with performance tests I'm doing for everyone's benefit.


Sure, I will do this.
Do you have any good tools for load testing?

Until then what is the output of "time dd if=/dev/zero bs=1M count=1000 | gzip >/dev/null" of your ARM?

#346 burchanie

burchanie

    Member

  • Jr. Member
  • PipPip
  • 26 posts

Posted 15 January 2013 - 07:56 AM

Sure, I will do this.
Do you have any good tools for load testing?

Until then what is the output of "time dd if=/dev/zero bs=1M count=1000 | gzip >/dev/null" of your ARM?


Thanks in advance!

I was making my mind to compile the kernel myself, but this would be the first time compiling linux kernel and having fun packaging it as you just experienced. And also, I have very occasional access to monitor and keyboard; don't know how to flash without them, honestly :)

About tools, I already used a rather unsorted list of things, which include:
  • STREAM benchmark (regular memory access bandwidth test) -- run successfully.
  • LibSMM library compiled on the device (fortran-and-bash made Atlas-like library for very small matrix-matrix multiplies, roughly indicative to register file and SIMD capabilities) - done.
  • Atlas (self-optimising BLAS for moderate-to-large matrix sizes) -- didn't succeed building on device, Atlas configure stage detects 'CPU throttling' as my Ak802 runs 1.2Ghz stable maximum but the kernel declares 1.6Ghz is theoretical peak; need to hack Atlas, postponed.
  • OSKI (self-optimising sparse BLAS; didn't succeed building on the device: it uses FFTW timer subsystem when optimising itself, but FFTW timer subsystem also fails due to some sort of lack of support on this installation) -- another thing to investigate.
  • compiling relatively heavy C++ templated scientific finite element methods code library (Nektar++) on device -- successfully compiled and run against some test mesh.
  • compiling and running FORM (special purpose computer algebra manipulation tool for high performance calculations; on some problem it easily produces gigabytes of data which it quite efficiently swaps to hard drive, it's not RAM-constraint) -- compiling is done, need to tweak my input sample a little bit, postponed.

Surely I forgotten something, but anyway it was enough to keep me occupied the last week. Probably it's also good idea to compile some SPEC benchmark or Dhrystone (writing to my TODO list). Any suggestions welcome.

At the moment I don't have an access to my device (left at home) and will post timing for "time dd if=/dev/zero bs=1M count=1000 | gzip >/dev/null" later.

#347 aruangra

aruangra

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 73 posts

Posted 15 January 2013 - 08:12 AM

Sure, I will do this.
Do you have any good tools for load testing?

Until then what is the output of "time dd if=/dev/zero bs=1M count=1000 | gzip >/dev/null" of your ARM?



This is my output from MK808 running at 1.6GHz (performance mode)


ubuntu@rk3066dev:~$ time dd if=/dev/zero bs=1M count=1000 | gzip >/dev/null
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 32.0948 s, 32.7 MB/s

real 0m32.104s
user 0m27.520s
sys 0m4.520s

#348 olegk0

olegk0

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 111 posts

Posted 15 January 2013 - 09:16 AM

But honestly, who needs Ubuntu? I'm a Debian guy :)


:)
hi
I'm also a fan of Debian and use it on my mk808

#349 fkubi

fkubi

    Member

  • Jr. Member
  • PipPip
  • 20 posts

Posted 15 January 2013 - 07:49 PM

I will share all of my files in the afternoon (CET).


Here are some files

#350 aruangra

aruangra

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 73 posts

Posted 15 January 2013 - 08:05 PM

Here are some files


Does internal wifi work ?

Edited by aruangra, 15 January 2013 - 08:06 PM.


#351 aruangra

aruangra

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 73 posts

Posted 16 January 2013 - 04:46 AM

I add echo performance to /etc/rc.local. Right after booting, it is in the performance mode but after half a minute, it changes to "ondemand". I guess a process sets the cpu speed after rc.local runs. Any advice would be appreciated.


I finally get my MK808 to run at the performance mode by adding these commands in /etc/rc.local

while :
do
        ch=$(sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
        if [ "$ch" != "performance" ]; then
             sudo sh -c 'echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
             echo ">>>>>>>>>> Performance mode"
        fi

        sleep 5
done

Edited by aruangra, 16 January 2013 - 04:47 AM.


#352 JustinTime4Tea

JustinTime4Tea

    Developer

  • FW Developer
  • PipPipPip
  • 276 posts

Posted 16 January 2013 - 04:56 AM

I thought I read a question earlier in the thread regarding installing armhf based software in this miniTV "distro" of Linux. Also I have noticed the lack of support so far for the on board rockchip wireless SO I would much like to lend my knowledge to the pool. I have began installing TONS of software. I will begin compiling a list of what works what doesn't and creating a spreadsheet based compatibility chart that I hope others will find usefull and add to. I have on order some peripherals and until they arive I have been downloading packages from a Live USB Ubuntu 12.04 distro onto the sdcard directly into the /linuxroot/home/ubuntu/Downloads and then I preceide to install them from there placing the sd card into the 808 & rebooting recovery of course :) I plan on going away for a few days and while on vacation I will be mirroring as many armhf repos as I can get my hands on €_€

The easiest method I've found to not only find available software but also be sure to grab every little dependency is to use Synaptic to build a wget bash script that grabs everything you need to install your softwares :) I will be posting a more thurough Walkthrough on how to install Synaptic on the 808/whichever miniTV you have if it's stuck offline.

Currently I have installed and ran: Eclipse IDE, Battle for Wesnoth (like Warcraft remember that!?!? Good ol abandon ware... I will never abandon you) ALSO the entire Libre office for spreadsheets, word documents, presentations and desktop publishing! (calc, writer, impress, draw) and too many more to remember right now. For now I have to say SOO MUCH amazing compatible software. GET EXCITED!

I will continue to install software and several games starting with the largest and begin compiling a compatibility list but in the mean time check this official Ubuntu forum as a starting place in using Synaptic to install offline: http://ubuntuforums....d.php?t=1900550 if the link didn't show please goto ubuntuforums and the thread number is 1900550. You're smart. You'll figure it out.

DON'T WORRY about online machine not being of same CPU architecture the bash file with the wget list will get the correct packages because it was generated on the offline system running the correct architecture. MAKE SURE THOUGH your architecture is armhf : good luck and please email me or post with questions I will start posting more as I compile drivers and such. Hope to be a good addition to the dev community here :yahoo:

_.-=/ Here we go again! Ubuntu 12.10 on ARM the way it's meant to be experienced! Easy, Optimized and now even smaller. \=-._



.-=/ Open GL ES GOODIES! \=-.


. - ( *_Quake-3_*- .. -*_GLTron_*- .. -*_Playstation_Emulator_*- .. -*_XBMC with AddOns!_[COME and get IT!]* ) - .



.-=/ OTHER GOODIES! \=-.


. - ( *_XChat FREE Direct Live Help and Growing Community!_*- .. -* Joomla 3.1 Quick Professional Modern Website Easy as 1-2-3 *- .. -* HW Support: Webcams, Hubs, PS3Remote, much more *- .. -* too much to list! Download now and enjoy! Join us using XChat and lets plan the next release together!_* ) - .



_.-=/ Justin Gross ]
_.-='/ home://io ]
_.-=/ Seattle, WA ]

#353 aloksinha2001

aloksinha2001

    Developer

  • FW Developer
  • PipPipPip
  • 247 posts

Posted 16 January 2013 - 04:58 AM

I finally get my MK808 to run at the performance mode by adding these commands in /etc/rc.local

while :
do
        ch=$(sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
        if [ "$ch" != "performance" ]; then
             sudo sh -c 'echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
             echo ">>>>>>>>>> Performance mode"
        fi

        sleep 5
done


This is not the right way to setup performance scaler in PicUntu.

There is a daemon running ...

S99ondemand... this is found in /etc/rcx.d/
- where x is the run level you are running
- if you are running GUI mode, then you are on level 5 and you need to worry about /etc/rc5.d/S99ondemand
- If in text mode, then level 3 /etc/rc3.d/S99ondemand.

This daemon is responsible for managing the system at 'ondemand' level,

In case you want to change the way of system running, then build another set of deamons - S99performance may be, and activate them at boot... and deactivate this daemon. [ /etc/init.d/ondemand stop ]. A simple hack would be to disable the startup of this daemon in the boot up seq, and then echo performace to the /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor and performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

In the next release of PicUntu, we would be releasing options for people to select which CPUFREQ to use.. that should be able to help remove all of this manual handling anyways.

Alok

Edited by aloksinha2001, 16 January 2013 - 05:05 AM.


#354 nooy

nooy

    Newbie

  • Jr. Member
  • Pip
  • 3 posts

Posted 16 January 2013 - 05:50 AM

If you didn't backed it up using some sort of clockworkmod recovery fw, may be this link help: http://www.rikomagic....php?f=9&t=3193



Hi,

The Linux kernel into NAND Flash.
After switching on the linux kernel boots up. <initramfs>
When I try to flash the android recovery.img (android stick in flash mode connected) then is the show error message.

Thx,

#355 burchanie

burchanie

    Member

  • Jr. Member
  • PipPip
  • 26 posts

Posted 16 January 2013 - 07:10 AM

Hi,

The Linux kernel into NAND Flash.
After switching on the linux kernel boots up. <initramfs>
When I try to flash the android recovery.img (android stick in flash mode connected) then is the show error message.

Thx,


- what error message do you get?
- how do you put your android stick to flash mode?
- how do you flash recovery.img? Please describe what you are doing, steps by steps.

#356 fkubi

fkubi

    Member

  • Jr. Member
  • PipPip
  • 20 posts

Posted 16 January 2013 - 07:27 AM

Does internal wifi work ?


I have not tried with this kernel, but when I tried to copy wifi drivers from iMiTO MX1 Android packages it did not recknonize the MT5931 internal wifi chip. That was one of the reason to recompile the kernel to support my TP-Link USB wifi dongle (Atheros 7010).

I will play around a bit with the Android driver when I have some free time, but as the USB dongle works, it is not so urgent any more.

#357 aruangra

aruangra

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 73 posts

Posted 16 January 2013 - 07:30 AM

This is not the right way to setup performance scaler in PicUntu.

There is a daemon running ...

S99ondemand... this is found in /etc/rcx.d/
- where x is the run level you are running
- if you are running GUI mode, then you are on level 5 and you need to worry about /etc/rc5.d/S99ondemand
- If in text mode, then level 3 /etc/rc3.d/S99ondemand.

This daemon is responsible for managing the system at 'ondemand' level,

In case you want to change the way of system running, then build another set of deamons - S99performance may be, and activate them at boot... and deactivate this daemon. [ /etc/init.d/ondemand stop ]. A simple hack would be to disable the startup of this daemon in the boot up seq, and then echo performace to the /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor and performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

In the next release of PicUntu, we would be releasing options for people to select which CPUFREQ to use.. that should be able to help remove all of this manual handling anyways.

Alok


Thanks. This is my new solution

sudo mv /etc/rc2.d/S99ondemand /etc/rc2.d/K99ondemand
sudo mv /etc/rc3.d/S99ondemand /etc/rc3.d/K99ondemand
sudo mv /etc/rc4.d/S99ondemand /etc/rc4.d/K99ondemand
sudo mv /etc/rc5.d/S99ondemand /etc/rc5.d/K99ondemand

Then add these commands to /etc/rc.local

sudo sh -c 'echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
sudo sh -c 'echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor'


#358 fkubi

fkubi

    Member

  • Jr. Member
  • PipPip
  • 20 posts

Posted 16 January 2013 - 07:50 AM

This is not the right way to setup performance scaler in PicUntu.
...
Alok


Yesterday I've tried to set CPU frequency (cpufrequtils debian package) on my iMiTO MX1. When I list available frequencies, it shows many steps between 250MHz and 1.61GHz. However I could not set any higher than 1.2GHz. There were no error messages, just the freq has been topped at 1.2GHz regardless of the cpufreq governor setting.

Is there some hidden switch somewhere to enable higher freqs?

#359 fkubi

fkubi

    Member

  • Jr. Member
  • PipPip
  • 20 posts

Posted 16 January 2013 - 08:08 AM

Here are some files


So,

What is in the package...
  • config480p, config1080p -- kernel configs
  • debian-3.0.8+fkubi.cpio.gz -- Debian initrd for armhf made by mkinitrd and included all modules (I don't know if it is a good idea). This is used during Linux kernel "3.0.8+fkubi" compilation. See the config files for details.
  • fakeramdisk.gz -- empty ramdisk used to create "Image####p.img" files for flashing.
  • Image1080p.img, Image480p.img -- kernel image files to flash. Note that they are larger than 8MB, so you need to modify your flash tool parameters. Please refer to my former post on this topic.
  • linuxroot.tar.gz -- it is the Debian Testing image made by debootstrap and added some packages. You can use this as a base for your further installation. Partition should be named "linuxroot". Only root user with password "root12"
  • make -- small script used to build image files

These kernel do not have profiling support checked or modified for Oprofile.

Edited by fkubi, 16 January 2013 - 01:40 PM.


#360 burchanie

burchanie

    Member

  • Jr. Member
  • PipPip
  • 26 posts

Posted 16 January 2013 - 02:38 PM

Sure, I will do this.
Do you have any good tools for load testing?

Until then what is the output of "time dd if=/dev/zero bs=1M count=1000 | gzip >/dev/null" of your ARM?


Right, I finally got time to do this, output for me is as follows (in order):

burchanie@rk3066dev:~$ sudo cpufreq-set -rf 1.2Ghz
burchanie@rk3066dev:~$ cpufreq-info 
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: rk30
  CPUs which run at the same hardware frequency: 0 1
  CPUs which need to have their frequency coordinated by software: 0 1
  maximum transition latency: 40.0 us.
  hardware limits: 252 MHz - 1.61 GHz
  available frequency steps: 252 MHz, 504 MHz, 816 MHz, 1.01 GHz, 1.20 GHz, 1.27 GHz, 1.42 GHz, 1.51 GHz, 1.61 GHz
  available cpufreq governors: powersave, ondemand, hotplug, userspace, interactive, performance
  current policy: frequency should be within 252 MHz and 1.61 GHz.
                  The governor "userspace" may decide which speed to use
                  within this range.
  current CPU frequency is 1.01 GHz.
  cpufreq stats: 252 MHz:0.00%, 504 MHz:0.00%, 816 MHz:0.00%, 1.01 GHz:100.00%, 1.20 GHz:0.00%, 1.27 GHz:0.00%, 1.42 GHz:0.00%, 1.51 GHz:0.00%, 1.61 GHz:0.00%
[....second CPU is the same....]
burchanie@rk3066dev:~$ sudo cat /sys/devices/system/cpu/*/cpufreq/cpuinfo_cur_freq
1200000
1200000
burchanie@rk3066dev:~$ sudo cat /proc/cpuinfo
Processor	: ARMv7 Processor rev 0 (v7l)
processor	: 0
BogoMIPS	: 1631.46

processor	: 1
BogoMIPS	: 1631.46

Features	: swp half thumb fastmult vfp edsp neon vfpv3 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x3
CPU part	: 0xc09
CPU revision	: 0

Hardware	: RK30board
Revision	: 0000
Serial		: 0000000000000000
burchanie@rk3066dev:~$ cat /proc/cpuinfo
Processor	: ARMv7 Processor rev 0 (v7l)
processor	: 0
BogoMIPS	: 1631.46

processor	: 1
BogoMIPS	: 1631.46

Features	: swp half thumb fastmult vfp edsp neon vfpv3 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x3
CPU part	: 0xc09
CPU revision	: 0

Hardware	: RK30board
Revision	: 0000
Serial		: 0000000000000000
burchanie@rk3066dev:~$ dd if=/dev/zero bs=1M count=1000 | gzip >/dev/null
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 50.2734 s, 20.9 MB/s
burchanie@rk3066dev:~$ sudo dd if=/dev/zero bs=1M count=1000 | gzip >/dev/null
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 42.1994 s, 24.8 MB/s

Conclusions:
- it's clear that under normal account and sudo I have different clock speed
- BogoMIPS value doesn't change depending on current clock setting
- dd has higher performance under higher clock rate.