[RFC] enable CONFIG_UACCESS_WITH_MEMCPY - G1 Android Development

I've tested enabling CONFIG_UACCESS_WITH_MEMCPY in a 2.6.33.4 kernel for CM-5.0.8.
Code:
Use kernel mem{cpy,set}() for {copy_to,clear}_user() (EXPERIMENTAL)
CONFIG_UACCESS_WITH_MEMCPY:
Implement faster copy_to_user and clear_user methods for CPU
cores where a 8-word STM instruction give significantly higher
memory write throughput than a sequence of individual 32bit stores.
A possible side effect is a slight increase in scheduling latency
between threads sharing the same address space if they invoke
such copy operations with large buffers.
However, if the CPU data cache is using a write-allocate mode,
this option is unlikely to provide any performance gain.
Empirically there seems to be an improvement not in snappiness but when
heavier i/o is involved. The only test i could think of so far is:
Code:
WITH CONFIG_UACCESS_WITH_MEMCPY
/ # hdparm -tT /dev/block/mmcblk0p2
/dev/block/mmcblk0p2:
Timing buffer-cache reads: hdparm: HDIO_DRIVE_CMD: Inappropriate ioctl for device
78 MB in 0.51 seconds = 154505 kB/s
Timing buffered disk reads: 42 MB in 3.03 seconds = 14171 kB/s
hdparm: HDIO_DRIVE_CMD: Inappropriate ioctl for device
Code:
WITHOUT CONFIG_UACCESS_WITH_MEMCPY
/ # hdparm -tT /dev/block/mmcblk0p2
/dev/block/mmcblk0p2:
Timing buffer-cache reads: hdparm: HDIO_DRIVE_CMD: Inappropriate ioctl for device
24 MB in 0.56 seconds = 43828 kB/s
Timing buffered disk reads: 15 MB in 3.11 seconds = 4938 kB/s
hdparm: HDIO_DRIVE_CMD: Inappropriate ioctl for device
Attached you will find a boot.img and modules.sqf or modules.tar.gz for CM-5.0.8 if you want to test it.
For a fast test you can use fastboot to boot the kernel:
Code:
sudo fastboot boot new_boot.img
For more extensive tests you maybe need to copy the modules to your device
(the .sqf or tar.gz depending on your setup DeathSPL/AnySPL) and eventually flash the boot image.
DON'T DO IT IF YOU DON'T KNOW EXACTLY HOWTO!!!
Attached also my kernel config.
Critics and hints on whether this could be useful are welcome.
Enjoy.

Related

Boost Speed and Space Significantly in Android With SquashFS and AUFS or ubifs!

I think it would be a good idea to compress /system/bin and /system/lib at least with squashfs, I have done this on a couple ubuntu and gentoo systems and it actually increased performance and space significantly!
Reasons (short version): decompressing data is faster than reading it from the hard drive, in most current computers, especially when you have multiple programs reading from the disk, causing thrashing, and/or when the data on the disk is fragmented. You can read more details about what was done and the results on http://forums.gentoo.org/viewtopic-p-4732709.html#4732709
Squashfs is intended for general read-only file system use and in constrained block device/memory system, it can also be combined with a union mount system like unionfs and aufs for read/write access.
Gentoo Benchmark results:
I have compressed /bin /sbin /lib /opt /usr and then tried the following operations with and without the squashfs images mounted:
1) start the system up to the login screen
2) login and wait until desktop is usable (session is restored, hard disk stops screaming)
3) start openoffice-writer
4) start eclipse
5) generate random file access pattern and record the total time to read all files.
Code:
# find /usr -type f -printf "%s %p\n" | sort -R | awk '{ printf $2; printf "\n" }' > /sort
# time cpio -o --quiet -H newc < sort > /dev/null
Some Benchmarks on a gentoo system:
Times without squashfs+aufs:
1) 7.5 seconds to load the kernel, another 10 seconds until file systems are mounted (up to this point no speed increase is possible by this method), another 42 seconds until the login screen pops up (out of which 24 seconds are just for waiting on the network interfaces). A total of 60 seconds, out of which only 18s are relevant to our benchmark
2) 16s
3) 9s
4) 25s
5) 36m31.726s
Times with squashfs+aufs:
1) total time: 58s, out of which 16s are relevant to the benchmark -> 11% decrease in time
2) 10s -> 37.5% decrease
3) 6s -> 33% decrease
4) 22s -> 12% decrease
5) 9m48.873s -> less than 1/3 of the normal time!
We will be able to improve android boot time, app launch time, and increase space, what more could we ask for? Maybe a little bit more ram? Whats up with compcache too?
So now we just need to compile squashfs-tools for android and experiment, im pretty damn excited to try this!
[edit] Also ubifs has lzo compression, not sure how that would work either, it seems ubifs is favored over jffs2 and yaffs2
found a nice pdf:
http://free-electrons.com/doc/flash-filesystems.pdf
Benchmarks Of Yaffs2, JFFS2, SquashFS, & UBIFS:
http://free-electrons.com/pub/conferences/2008/elce/flash-filesystems.pdf
Seems like people are already using ubifs on android:
http://groups.google.com/group/andr...36603d429a/646a017892783e2b?#646a017892783e2b
Reference:
http://forums.gentoo.org/viewtopic-p-4732709.html#4732709
http://jt0.org/news/squashing_usr_and_the_2629_kernel
you should PM Cyanogen about this, he's good at this kind of stuffs, maybe he'll incorporate this hack with his MOD.
This would be a great addition to the Cyanogen Mods. Its fast enough as it is, but I can see this helping a bit more if it gets implemented!
firestrife23 said:
you should PM Cyanogen about this, he's good at this kind of stuffs, maybe he'll incorporate this hack with his MOD.
Click to expand...
Click to collapse
I notified him on Twitter, He said:
@ionstorm it's a good idea, maybe in a later release
I am sure if you say something in his thread and make more awareness of this im sure we can see it done quicker, I also let DudeOfLife know and he said he will look at it for a future release as well, he also thinks its a good idea.
Hey Defcon I'm actually playing around with this instead of Union/Cram for an upcoming build and its nice to hear some more good things!
justanothercrowd said:
Hey Defcon I'm actually playing around with this instead of Union/Cram for an upcoming build and its nice to hear some more good things!
Click to expand...
Click to collapse
hey count me in on testing this for you, also looking for your twitter..
this sounds like i good idea. i hope he does implement it
Justanotherdev just compiled squashfs for kernel 2.6.29, and he is working on it as well
I just started toying with this and 2.6.29 last night. Expect a new "experimental" version soon
1st post..
Good day all...I definately agree with poster about squashfs. I dont use gentoo..but i use Sabayon which is a gentoo derivitive..just has the option for source or binary...running an os on squash will def improve performance
compression is a mistake
Im sorry to say but this is bull****.
How you dare showing proof of eclipse (300 MB !!!!) loading up an insignificant 3 seconds faster just because you compressed it and system have to load 225MB from disk instead of 300MB. Or openoffice which i dont have but im sure it is worth a good 300 MB too, and again gaining another 3 secconds load time.
How much seconds of loading time will we gain loading a compressed 0.3 MB library, 0.00001 secs? And this "improve" at the cost of giving up a good amount of the very limited RAM needed for execution, this phone have!
not to say how much incompatibilities will carry the "decompressing on the fly" with the very poor and limited RAM this phone have. and even with cpu scaling and android accessing and decompressing libraries or apps on the phone.
force closes in sight.
I also dont trust the (5) point.
HOLY GRAIL:
The real speed boost will come with the compilation of the whole android system and libraries with -O2 (speed) instead of -Os (size)
The problem is a 2.5 MB binary compiled with -Os is a 20MB binary compiled with -O2.
-O2 is between 20% - 40% faster so i am drooling for it thinking about it, but... G1 doesnt have DISK SPACE.
-O2 compilation is the holy grail. Ask gentoo users
Oh, squashfs could come handy in this case.. sad we dont have RAM or SPACE and android is the monster of slowiness. java suck!
If its a mistake then don't use it and work on the O2 yourself.
also: the phone has flash memory, which should have totally different characteristics
I wouldn't totally dismiss this idea until it's actually tested. LZO compression is really fast. A couple of us are working on it.
Squashfs was made for and used for low memory systems, I've seen amazing results on systems with 128 meg ram and a 500mhz processor, we'll try it on android and see what happens, I'm curious
*subscribed*
definately looking forward to seeing how this turns out, i just reverted back to ION today for the performance over rosie, and i cant imagine any faster, this would definately be another milestone if it worked out
Have you tried cyanogen's builds? Imo its faster than the ion roms.
wootroot said:
*subscribed*
definately looking forward to seeing how this turns out, i just reverted back to ION today for the performance over rosie, and i cant imagine any faster, this would definately be another milestone if it worked out
Click to expand...
Click to collapse
dwang said:
Have you tried cyanogen's builds? Imo its faster than the ion roms.
Click to expand...
Click to collapse
I will confirm that it is at least equal. Faster is questionable, but Cyanogen does do optimization, so...
dwang said:
Have you tried cyanogen's builds? Imo its faster than the ion roms.
Click to expand...
Click to collapse
I am not sure which builds are faster, so far its just peoples words without benchmarks, maybe we should benchmark fs read times, ram usage, free ram, cpu times.. etc..
Also some tweaks/changes may be useless or counter productive so we'll need some tests done to make sure which tweaks work and which do not.
We gotta work on is optimizing memory/cpu and startup times, with each change we should do a benchmark.
I just tested a build using the 2.6.29 build with squashFS. xbin, framework and modules can easily be compressed to squashFS images just like JF did with cramfs. Making /system/lib a squashFS image made the phone unbearable slow until it crashed
Code:
I/ActivityManager( 800): ANR (application not responding) in process: org.jsharkey.sky
I/ActivityManager( 800): Annotation: Broadcast of Intent { action=android.appwidget.action.APPWIDGET_ENABLED comp={org.jsharkey.sky/org.jsharkey.sky.TinyAppWidget} }
I/ActivityManager( 800): CPU usage:
I/ActivityManager( 800): Load: 8.63 / 7.74 / 4.33
I/ActivityManager( 800): CPU usage from 10086ms to 371ms ago:
I/ActivityManager( 800): system_server: 3% = 0% user + 3% kernel
I/ActivityManager( 800): org.freecoder.widgets.overclock: 3% = 0% user + 2% kernel
I/ActivityManager( 800): loop3: 3% = 0% user + 3% kernel
I/ActivityManager( 800): mediaserver: 2% = 0% user + 2% kernel
I/ActivityManager( 800): com.google.android.apps.scoreboard: 2% = 0% user + 1% kernel
I/ActivityManager( 800): android.process.acore: 0% = 0% user + 0% kernel
I/ActivityManager( 800): logcat: 0% = 0% user + 0% kernel
I/ActivityManager( 800): pdflush: 0% = 0% user + 0% kernel
I/ActivityManager( 800): kswapd0: 0% = 0% user + 0% kernel
I/ActivityManager( 800): loop2: 0% = 0% user + 0% kernel
I/ActivityManager( 800): vold: 0% = 0% user + 0% kernel
I/ActivityManager( 800): zygote: 0% = 0% user + 0% kernel
I/ActivityManager( 800): com.android.phone: 0% = 0% user + 0% kernel
I/ActivityManager( 800): +org.jsharkey.sky: 0% = 0% user + 0% kernel
I/ActivityManager( 800): TOTAL: 100% = 2% user + 19% kernel + 77% iowait
iowait of 77%?!

[REQ]Compcache stats needed. Linux swap stats helpful too.

I suspect that compcache is not interacting properly with android but I need some stats to really analyze it. This should be standardized so please answer as I request and avoid any "me too" type answers.
Here's what you need:
Compcache running or a linux swap partition or file (swapper counts).
The default browser bound to a shortcut (search-b) and set to load www.cnn.com as your homepage. Close extra windows before starting and go there at least once. Make sure you're blocking popups.
A homescreen where you have icons and widgets that you have noticed in the past have taken time to load.
Music player to run in the background if you need to increase the system load.
Optionally: Gmail bound to a keyboard shortcut. (search-g for me)
Adb shell and knowledge to run these tests.
Here's what you're doing:
adb shell into your phone
Grab following stats (you can copy and paste in on one line):
Code:
uname -r;uptime;cat /proc/sys/vm/swappiness;cat /proc/swaps;cat /proc/ramzswap;free
Hit home button and go to homescreen. Take note of whether the homescreen needed to reload everything or if it was snappy. After completely done loading, run 'free' and record.
Keyboard shortcut to browser. Take note of whether the browser had to download and reload everything. After completely done loading, run 'free' and record.
Repeat 3-4 until either:
switching is always snappy,
the value of 'free' for swap ceases to change significantly while apps are reloading (like +-100 over 2-3 slow reloads),
or the value of 'free' for swap maxes out (note if you start getting lots of force closes).
Code:
total used free shared buffers
Mem: 97876 95492 2384 0 644
Swap: 43880 [B] 404[/B] 43476
Total: 141756 95896 45860
If its always snappy, put more load on the system by setting the music player in the background. If that still doesn't stress the system, throw in Gmail in the mix randomly. Note if snappy, and record 'free' stats.
If you're using both compcache and a linux swap, try to get information at the point where you've crossed over from compcache to linux swap. So if you're compcache is only 8 megs, seeing the difference as your swap fills over the 8 meg boundary is useful.
Finally, here's what you should report, either by putting it into a text file and attaching, or by placing it into a
Code:
block.
[list=1][*]Mod used. e.g. Cyanogen 3.9
[*]Info from step 2) above. [code]2.6.29-cm
12:47:45 up 3:43, load average: 2.13, 2.05, 2.09
15
Filename Type Size Used Priority
/dev/ramzswap0 partition 12284 408 -1
/system/sd/swapfile.swp file 31596 0 -2
DiskSize: 12288 kB
NumReads: 33
NumWrites: 102
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 0
ZeroPages: 3
GoodCompress: 77 %
NoCompress: 9 %
PagesStored: 99
PagesUsed: 31
OrigDataSize: 396 kB
ComprDataSize: 118 kB
MemUsedTotal: 124 kB
total used free shared buffers
Mem: 97876 95720 2156 0 632
Swap: 43880 408 43472
Total: 141756 96128 45628
[*]Results from repeating 3-4. If it ended up being too responsive and you couldn't stress it just include one cycle. Mark what you swapped to and whether it reloaded (Y for yes). e.g.
Code:
home
total used free shared buffers
Mem: 97876 95824 2052 0 292
Swap: 24464 2268 22196
Total: 122340 98092 24248
browser Y
total used free shared buffers
Mem: 97876 96032 1844 0 252
Swap: 24464 2540 21924
Total: 122340 98572 23768
home
total used free shared buffers
Mem: 97876 94436 3440 0 264
Swap: 24464 2940 21524
Total: 122340 97376 24964
browser Y
total used free shared buffers
Mem: 97876 95960 1916 0 280
Swap: 24464 5292 19172
Total: 122340 101252 21088
home Y
total used free shared buffers
Mem: 97876 92868 5008 0 272
Swap: 24464 6484 17980
Total: 122340 99352 22988
[/list]
Thanks!
Reserved for my test results.
Another good test is iMeem. This app is a memory whore and really puts pressure on the system.
Code:
Cyanogen 3.6.8.1
2.6.29-cm
15:19:09 up 5:28, load average: 7.58, 5.31, 4.33
20
Filename Type Size Used Priority
/dev/ramzswap0 partition 24464 15968 -1
DiskSize: 24468 kB
NumReads: 7817
NumWrites: 8908
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 0
ZeroPages: 241
GoodCompress: 65 %
NoCompress: 12 %
PagesStored: 5871
PagesUsed: 2370
OrigDataSize: 23484 kB
ComprDataSize: 9323 kB
MemUsedTotal: 9480 kB
total used free shared buffers
Mem: 97876 95852 2024 0 560
Swap: 24464 15968 8496
Total: 122340 111820 10520
home Y
total used free shared buffers
Mem: 97876 96348 1528 0 776
Swap: 24464 14600 9864
Total: 122340 110948 11392
browser Y
total used free shared buffers
Mem: 97876 96528 1348 0 420
Swap: 24464 14844 9620
Total: 122340 111372 10968
home Y
total used free shared buffers
Mem: 97876 96432 1444 0 752
Swap: 24464 14792 9672
Total: 122340 111224 11116
browser Y
total used free shared buffers
Mem: 97876 96484 1392 0 404
Swap: 24464 14844 9620
Total: 122340 111328 11012
home Y
total used free shared buffers
Mem: 97876 96464 1412 0 668
Swap: 24464 15048 9416
Total: 122340 111512 10828
No other posts? C'mon everyone, these statistics will help YOU get a faster, better configured phone.
**********
sha.goyjo said:
I'm going to be the first to say it. Doing tests on compcache .5 is somewhat pointless atm. If you follow Cyanogens, you'll see that he's currently working with the compcache people on an arm revision of .6, which uses a VERY different code base. I'd contribute to your thread if it wasn't trying to fiddle with a version that was just an arm patch on the existing compcache branch. You'd be better off waiting till the .6 goes stable on the trunk. All that being said, if you want to try and rewrite kernel modules that are in the process of being re-re-written, be my guest.
Not trying to be an ass, just trying to save us all some time by working towards things efficiently.
That being said, .6 could REALLY use some people working on it. Once it gets working we'll be able to use backing swap files instead of a partition, which would be great. No more Linux-swap on an sdcard.
Click to expand...
Click to collapse
Hmm. So what you are saying is that we should find no significance in the fact the cyanogen already posted in this thread with supportive info for the tests.
Also, in regards to your work on .6, what benchmarking plan did you have to prove:
1) that .6 performs better than .5 on our phones
2) that .6 performs better than a linux swap on our phones
3) that .6 performs better than .5 with a backing swap on our phones
Please note that any answers to this thread could help build these benchmarks for you.
Running CM 3.8
Browser only reloaded once...even with music playing, and running wisepilot! Even the one reload was a quick one.
Code:
2.6.29-cm
18:05:17 up 1:13, load average: 2.75, 3.69, 4.14
60
Filename Type Size Used Priorit
/dev/ramzswap0 partition 31996 21264 -1
DiskSize: 32000 kB
NumReads: 15024
NumWrites: 16558
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 246
ZeroPages: 196
GoodCompress: 75 %
NoCompress: 4 %
PagesStored: 7804
PagesUsed: 2977
OrigDataSize: 31216 kB
ComprDataSize: 11516 kB
MemUsedTotal: 11908 kB
total used free shared buffers
Mem: 97876 96376 1500 0 576
Swap: 31996 21264 10732
Total: 129872 117640 12232
#
From CNN to Home
**snappy
total used free shared buffers
Mem: 97876 95752 2124 0 588
Swap: 31996 22040 9956
Total: 129872 117792 12080
From Home to CNN
**snappy no reload
total used free shared buffers
Mem: 97876 96032 1844 0 520
Swap: 31996 22020 9976
Total: 129872 118052 11820
#
ADDED MUSIC PLAYER BACKGROUND And checked mem
total used free shared buffers
Mem: 97876 95964 1912 0 624
Swap: 31996 17516 14480
Total: 129872 113480 16392
FROM HOME TO CNN
**Reload
total used free shared buffers
Mem: 97876 96120 1756 0 448
Swap: 31996 24780 7216
Total: 129872 120900 8972
CNN to Home
**Snappy...no redraw
total used free shared buffers
Mem: 97876 96400 1476 0 492
Swap: 31996 29248 2748
Total: 129872 125648 4224
Home to Browser
***Snappy NO RELOAD WITH MUSIC RUNNING!!!
total used free shared buffers
Mem: 97876 96288 1588 0 464
Swap: 31996 26660 5336
Total: 129872 122948 6924
ADDED WISEPILOT NAVIGATION mUSIC STILL RUNNING
total used free shared buffers
Mem: 97876 96532 1344 0 396
Swap: 31996 27592 4404
Total: 129872 124124 5748
WISEPILOT RUNNING, MUSIC RUNNING, SWITCHED TO CNN from within wisepilot (search b)
***NO RELOAD, NO LAG....
total used free shared buffers
Mem: 97876 95988 1888 0 492
Swap: 31996 27208 4788
Total: 129872 123196 6676
#
double posted
by the way, in case everyone missed it:
I have two G1's. Both have brand new installs of CM 3.9. One has compcache (with swapiness set to 20 and 24mb of space allocated) and one does not. After a reboot on both devices and waiting a five minutes for everything to settle, I filmed the opening of the camera app. The one without compcache is noticeably quicker. Is compcache slowing our machines down, at least in certain instances?
By the way, cat /proc/ramzswap confirms compcache is enabled.
http://www.youtube.com/watch?v=gNYv-5WLDVA
edit:swappiness for the above tests was at 60....
Running Cyanogen 3.8.1 with the Palm Pre theme ( dunno if it made a diff.) and HTC Music app running.
Code:
2.6.29-cm
03:53:53 up 3 min, load average: 2.22, 1.47, 0.60
60
Filename Type Size Used Priority
/dev/ramzswap0 partition 31996 11612 -1
DiskSize: 32000 kB
NumReads: 1902
NumWrites: 3415
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 0
ZeroPages: 137
GoodCompress: 72 %
NoCompress: 4 %
PagesStored: 3278
PagesUsed: 1128
OrigDataSize: 13112 kB
ComprDataSize: 4461 kB
MemUsedTotal: 4512 kB
total used free shared buffers
Mem: 97876 96488 1388 0 652
Swap: 31996 11612 20384
Total: 129872 108100 21772
Home Y
total used free shared buffers
Mem: 97876 95704 2172 0 668
Swap: 31996 11612 20384
Total: 129872 107316 22556
Browser Y
total used free shared buffers
Mem: 97876 96308 1568 0 432
Swap: 31996 15528 16468
Total: 129872 111836 18036
Home N
total used free shared buffers
Mem: 97876 86336 11540 0 468
Swap: 31996 14936 17060
Total: 129872 101272 28600
Browser Y
total used free shared buffers
Mem: 97876 95196 2680 0 520
Swap: 31996 14932 17064
Total: 129872 110128 19744
Home N
total used free shared buffers
Mem: 97876 96176 1700 0 460
Swap: 31996 15056 16940
Total: 129872 111232 18640
Browser (Opened up really quick) N
total used free shared buffers
Mem: 97876 96432 1444 0 540
Swap: 31996 15200 16796
Total: 129872 111632 18240
Home N
total used free shared buffers
Mem: 97876 96096 1780 0 540
Swap: 31996 15208 16788
Total: 129872 111304 18568
pinetreehater said:
by the way, in case everyone missed it:
I have two G1's. Both have brand new installs of CM 3.9. One has compcache (with swapiness set to 20 and 24mb of space allocated) and one does not. After a reboot on both devices and waiting a five minutes for everything to settle, I filmed the opening of the camera app. The one without compcache is noticeably quicker. Is compcache slowing our machines down, at least in certain instances?
By the way, cat /proc/ramzswap confirms compcache is enabled.
http://www.youtube.com/watch?v=gNYv-5WLDVA
edit:swappiness for the above tests was at 60....
Click to expand...
Click to collapse
I'm not surprised it was.
Without compcache : Start camera app, realize your out of memory, kill another application (meaning it will start slower the next time, going through full initialization).
With compcache : Start camera, push inactive application into compcache.
I'd like to see some similar tests with more tests run. I think I might actually write a little app for this.
derfolo said:
Hmm. So what you are saying is that we should find no significance in the fact the cyanogen already posted in this thread with supportive info for the tests.
Also, in regards to your work on .6, what benchmarking plan did you have to prove:
1) that .6 performs better than .5 on our phones
2) that .6 performs better than a linux swap on our phones
3) that .6 performs better than .5 with a backing swap on our phones
Please note that any answers to this thread could help build these benchmarks for you.
Click to expand...
Click to collapse
No, I apologize for being offensive. Part of my reasoning has more to do with the fact that, as far as I have seen, regardless of what works best people tend to move to the latest version. It wasn't a utility prediction. In that respect, you are going in the right direction. I do think that the plans to implement dynamic swapping between backing and ramz in the future really make a big difference, however, in any kind of work we are trying to do here. Also, from what I've looked at the difference in the modules, they look significantly different now.
I didn't mean to press your buttons, but what I'm saying does have merit.
I say this because it's not about benchmarking the current version vs. the new version. That kind of a benchmark doesn't work, because the new version has an improved feature set. Software with a larger feature set rarely performs better than software with a smaller feature set. However, the features inherent in compcache .6 are VERY compelling for android phones, specifically the ability to use backing_swap from a FILE instead of a partition. The fewer partitions on your sdcard, the better. Less wasted space, and less time spend confusing the kernel as to which /dev/ it should be writing to at the time.
As to cyanogen having "supported" your tests, there are a lot of good reasons for it. You could discover a kernel interfacing problem. You could discover a problem in the arm patch that would be relevant to the new version or upgraded versions of CM.
All I think is that the compcache project could use all the help it can get rolling out .6 for android, and that if more people helped them with that, maybe we could try and find ways to fix the version of compcache we'll be using, instead of the one we'll be moving away from.
One thing people need to realize is that there is no free lunch. Swap (whether the partition or compcache) is not for speeding up the system but for allowing you to run many big apps together at the same time.
swap will slow you down a bit, whether its compcache (cpu overhead for compression) or partition (I/O overhead). So, stop fooling yourself. If you want a fast phone, just use basic things and leave swap out of picture. if you want a fast phone AND want to run tonnes of stuff like touchflo, get a phone with more RAM.
test results
devsk said:
One thing people need to realize is that there is no free lunch. Swap (whether the partition or compcache) is not for speeding up the system but for allowing you to run many big apps together at the same time.
swap will slow you down a bit, whether its compcache (cpu overhead for compression) or partition (I/O overhead). So, stop fooling yourself. If you want a fast phone, just use basic things and leave swap out of picture. if you want a fast phone AND want to run tonnes of stuff like touchflo, get a phone with more RAM.
Click to expand...
Click to collapse
Correct me if I'm wrong, but it sounds rather like you're saying, "Stop trying to make things better." Rather an odd sentiment for a Development forum, no?
I ran this test with just Calendar and Weather widgets running on the home screen and, although I have occasionally found the entire home screen slow to reload during regular use, during this test the home screen never seemed to reload at all, even with Music playing and an occasional jump to Gmail.
I'm running CM 3.9 with a simple Compcache script (no backing swap) initiated from Gscript for default disk size and 20 swappiness:
Code:
2.6.29-cm
12:23:08 up 36 min, load average: 3.37, 3.65, 2.79
20
Filename Type Size Used Priority
/dev/ramzswap0 partition 24464 6992 -1
DiskSize: 24468 kB
NumReads: 587
NumWrites: 1761
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 0
ZeroPages: 126
GoodCompress: 66 %
NoCompress: 5 %
PagesStored: 1635
PagesUsed: 602
OrigDataSize: 6540 kB
ComprDataSize: 2338 kB
MemUsedTotal: 2408 kB
total used free shared buffers
Mem: 97876 92880 4996 0 552
Swap: 24464 6992 17472
Total: 122340 99872 22468
Browser: N
total used free shared buffers
Mem: 97876 92856 5020 0 552
Swap: 24464 6992 17472
Total: 122340 99848 22492
Home: N
total used free shared buffers
Mem: 97876 92856 5020 0 552
Swap: 24464 6992 17472
Total: 122340 99848 22492
(after stressing with Music playing AND switching to Gmail)
Browser: Y
total used free shared buffers
Mem: 97876 95752 2124 0 452
Swap: 24464 7892 16572
Total: 122340 103644 18696
Home: N
total used free shared buffers
Mem: 97876 96496 1380 0 444
Swap: 24464 8276 16188
Total: 122340 104772 17568
ei8htohms said:
I ran this test with just Calendar and Weather widgets running on the home screen and, although I have occasionally found the entire home screen slow to reload during regular use, during this test the home screen never seemed to reload at all, even with Music playing and an occasional jump to Gmail.
Click to expand...
Click to collapse
And it probably doesn't, with compcache you have enough memory to keep it in, while without it needs to go through the whole onCreate and xml inflation.
I am not saying don't make it better. What I am saying is your expectations should be correct.
I use compcache myself. I use it with memlimit_kb=32000 disksize_kb=48000 backing_swap=/dev/block/mmcblk0p3 and a swappiness of 20. But I don't expect it to make my system fly. I just expect that more of my apps will stick around rather than killed and reloaded later. So, I am paying a little swapping cost upfront for payback later.
any lag once compcache fills up?
devsk said:
I am not saying don't make it better. What I am saying is your expectations should be correct.
I use compcache myself. I use it with memlimit_kb=32000 disksize_kb=48000 backing_swap=/dev/block/mmcblk0p3 and a swappiness of 20. But I don't expect it to make my system fly. I just expect that more of my apps will stick around rather than killed and reloaded later. So, I am paying a little swapping cost upfront for payback later.
Click to expand...
Click to collapse
Understood about managing expectations. I'm still considering the potential negative impact on battery life as well, since this is one notorious weak spot on the G1 (when it came out you didn't hear huge numbers of people complaining about how SLOW it was, but everyone complained about battery life...).
Do you mind explaining a little about your memlimit and disksize settings? I read a little about those options in the Google Code page, but I can't say I fully grokked the significance or difference.
I also can't seem to find a good explanation of how compcache and backing-swap work together. Most reports on XDA point to massive lag after compcache maxes out, but is it only then that backing-swap kicks in (and maybe a lot of those folks were using the 60 or 100 swappiness settings)? Can Linux-swap and compcache be run in parallel or separately from each other in some way (I'm guessing no)?
ei8htohms said:
Understood about managing expectations. I'm still considering the potential negative impact on battery life as well, since this is one notorious weak spot on the G1 (when it came out you didn't hear huge numbers of people complaining about how SLOW it was, but everyone complained about battery life...).
Do you mind explaining a little about your memlimit and disksize settings? I read a little about those options in the Google Code page, but I can't say I fully grokked the significance or difference.
I also can't seem to find a good explanation of how compcache and backing-swap work together. Most reports on XDA point to massive lag after compcache maxes out, but is it only then that backing-swap kicks in (and maybe a lot of those folks were using the 60 or 100 swappiness settings)? Can Linux-swap and compcache be run in parallel or separately from each other in some way (I'm guessing no)?
Click to expand...
Click to collapse
According to the Dev:
**********************************************************
Usage:
- modprobe ramzswap [memlimit_kb=<val>|disksize_kb=<val>] [backing_swap=<dev>]
memlimit_kb: This param is applicable only when backing_swap is given.
It is limit on amount compressed data stored in memory. Any
additional data is forwarded to backing_swap. It cannot be greater
than backing device size. If missing or 0, default value is used:
15% of RAM or backing device size, whichever is smaller.
disksize_kb: This param is applicable only when backing_swap is not given.
It is limit on amount of *uncompressed* worth of data stored in
memory. For e.g. disksize_kb=1024 means it can hold 1024kb worth of
uncompressed data even if this data compresses to just, say, 100kb.
If missing or 0, default value is used: 25% of RAM.
backing_swap: This is block device to be used as backing store for ramzswap.
It must be a valid swap partition. We move data to this device when we
encounter incompressible page or memlimit is reached. TODO: we may also
move some pages from ramzswap to this device in case system is really
low on memory.
This device is not directly visible to kernel as a swap device
(/proc/swaps will only show /dev/ramzswap0 and not this device).
Managing this backing device is the job of ramzswap module.
Examples:
1) modprobe ramzswap memlimit_kb=10240 backing_swap=/dev/sda2
sets ramzswap limit as 10MB and /dev/sda2 as backing swap device.
NOTE: here /dev/sda2 is a valid swap partition.
2) modprobe ramzswap backing_swap=/dev/sda2
same as (1) but memlimit is set to default: 15% of RAM or size of
backing swap device, whichever is smaller.
3) modprobe ramzswap disksize_kb=10240
sets ramzswap disk size as 10MB.
4) modprobe ramzswap.ko
same as (3) but ramzswap disk size will be set to default:
25% of RAM size.
Once module is loaded, activate this swap with highest priority:
swapon /dev/ramzswap0 -p 100
(-p param set swap priority)
Notes:
- ramzswap stats are exported via /proc/ramzswap
- If you give non-swap partition as backing_swap, nothing bad will happen -
swapon will simply fail to recognize /dev/ramzswap0 as swap partition.
So, in this case, unload the module and reload with correct backing_swap.
**********************************************************
thanks! very interesting
uwonsum said:
According to the Dev:
memlimit_kb: applicable only when backing_swap is given...limit on amount compressed data stored...additional data is forwarded to backing_swap.
disksize_kb: applicable only when backing_swap is not given...limit on amount of *uncompressed* worth of data stored.
Click to expand...
Click to collapse
So if I'm reading this right, memlimit and disksize would never be used together, right? And when backing_swap is NOT used, compcache is using the disksize allocation for uncompressed data, like virtual swap within RAM? Huh?
Once module is loaded, activate this swap with highest priority:
swapon /dev/ramzswap0 -p 100
(-p param set swap priority)
Click to expand...
Click to collapse
This swap priority info seems to directly conflict the info on the CompilingAndUsing page of the Google code project page:
Add ramzswap as swap device
swapon /dev/ramzswap0 -p 1 (give this swap device the highest priority).
Click to expand...
Click to collapse
Is 1 the highest priority or is 100 the highest priority? Is this the same as setting the swappiness? There must be a typo somewhere. Any help?
[EDIT]NVM, "-p 1" seems to be an invalid parameter.[/EDIT]
BTW, I started playing with your (rather more exotic) script from the CM Wheel of Death thread:
http://forum.xda-developers.com/showpost.php?p=4205132&postcount=518
Have you had any further findings about the various settings employed?
Thanks again!

[Q] ability to access WiFi 802.11 stack and radio headers?

Hi all,
I've been digging around to try and gain the ability to access the WiFi stack from an Android device that is rooted. What I am interested in, is capturing the 802.11 radio headers. I've done a bunch of searching, and it seems like getting the card in to promiscuous/monitor mode is out of the question. I haven't been able to find anyone to do it. But, even not being in this mode I am wondering if it is possible to get 802.11 headers.
I've downloaded the android-wifi-tether project to get the tools it has pre-built and installed on the file system, such as iwconfig, and I've also installed tcpdump.
I cannot get the card into monitor mode, as was expected:
Code:
# ./iwconfig tiwlan0 mode monitor
Error for wireless request "Set Mode" (8B06) :
SET failed on device tiwlan0 ; Operation not supported on transport endpoint.
That's fine. But when I use tcpdump, it seems as though the lowest layer of information available is the Ethernet/IP information:
Code:
# /data/tcpdump -i tiwlan0 -L
tcpdump: WARNING: can't create rx ring on packet socket 3: 92-Protocol not available
Data link types (use option -y to set):
DOCSIS (DOCSIS) (printing not supported)
EN10MB (Ethernet)
So for example, if I tcpdump:
Code:
07:51:21.793444 IP 192.168.1.103.34528 > 64.233.169.193.443: Flags [S], seq 3412091441, win 5840, options [mss 1460,sackOK,TS[|tcp]>
07:51:22.096239 IP 64.233.169.193.443 > 192.168.1.103.34528: Flags [S.], seq 513767123, ack 3412091442, win 5672, options [mss 1430,sackOK,TS[|tcp]>
Has anyone been able to dig any lower in the networking stack?
Thanks!
George
OK, I've done a significant amount of digging, and luckily the TI wl1271 wireless driver is built as a kernel module (I'm using a Droid 1). the "dmesg" output provides some hints that the TIWLAN module is active and parsing incoming packets at the lower layer:
Code:
<6>[ 5940.231292] TIWLAN: 3835.067243: rx , ERROR: rxData_receivePacketFromWlan() : MLME returned error
The code for this function can be found here, and even better the low-level packet information (e.g., RSSI) is available in this function.:
Code:
/*
* Set rx attributes
*/
RxAttr.channel = pRxParams->channel;
RxAttr.packetInfo = pRxParams->flags;
RxAttr.ePacketType= pRxParams->packet_class_tag;
RxAttr.Rate = appRate;
RxAttr.Rssi = pRxParams->rx_level;
RxAttr.SNR = pRxParams->rx_snr;
RxAttr.status = pRxParams->status & RX_DESC_STATUS_MASK;
I'm also wondering whether or not it might be possible to drop the card in to promiscuous mode with some driver hacking. It appears to be possible through the RX filter, albeit maybe not supported by the actual firmware (that would suck):
Code:
#define RX_CFG_PROMISCUOUS 0x0008 /* promiscuous - receives all valid frames */
#define RX_CFG_BSSID 0x0020 /* receives frames from any BSSID */
#define RX_CFG_MAC 0x0010 /* receives frames destined to any MAC address */
#define RX_CFG_ENABLE_ONLY_MY_DEST_MAC 0x0010
I too want to capture WiFi packet headers on Android using tcpdump. I am using an HTC dream phone (Android 1.6, Wi-Fi (802.11b/g) using a Texas Instruments WL1251B chipset). The default TI driver filters the 802.11 packet headers while doing a packet capture on the device using tcpdump. Did you figure out a way to capture the 802.11 headers using the default TI driver?
Also, I was looking at installing a mac80211 based driver on an android device. I followed the instructions to create the kernel modules and loaded them up on the phone. But, I could not activate the WiFi interface after doing so (though I saw the "wlan0" interface indicating that the mac80211 driver was loaded).
So, I am stuck at this point. Can you provide some directions from here?
Thanks
Ashish

Modify firmware/disable postprocessing on Vizio hdtv via serial U-Boot

Backstory: I have an old (2008?) vizio VA22L FHDTV10T. 1920x1080 60hz panel. I want to connect it to my pc, but if I use anything other than the VGA port (eg HDMI) it overscans and applies all this crap to the image. It's clear and crisp and beautiful if I use VGA (tested with old VGA gpu), but alas, my pc doesn't have a VGA output. (Yes I tried all the settings, no they don't fix it. Yes, I tried adjusting the graphics driver settings, no they haven't fixed it without being a PITA every time I turn the tv off.)
On to the important stuff: I can access the tv with a serial connection via "Service port" and can see a Das U-boot boot sequence and issue commands. I just don't know linux and can't get anywhere past the help menus. If someone could guide me on modifying this thing I'd be rather grateful!
For starters, here's the output when I first turn it on whilst pc is plugged in via VGA, wait for it to finish booting, and press enter.
PS: using PuTTY @ 115200baud
Code:
▒Boot-
Bank 0 : DQS(3 ~ 42), Size 39, Middle = 22
Bank 1 : DQS(-1 ~ 41), Size 42, Middle = 20
DRAM is set as 16 bits
Boot
Starting C main
0x00001b04
LZHS addr:0x00001b80
LZHS size:0x0002fcd8
LZHS checksum:0x00000084
U-Boot 1.1.4 (Oct 9 2009 - 12:58:21)
U-Boot code: 00D00000 -> 00D2FCD8 BSS: -> 00D7430C
RAM Configuration:
Bank #0: 00000000 64 MB
Detect flash #0: MXIC(25L320)
Flash: 4 MB
0.0.0.0
In: serial
Out: serial
Err: serial
DramSizing: 0x02000000
Finding Image...
Decompression image to 0x00010000...
Booting
Nucleus Heap is at 0x00603208(0x00be5f80)
Main task stack is at 0x00603218 (0x00002000)
============================================
Memory for Image at 0x00010000(0x005eda08):
Memory for OSAI at 0x00605228(0x00ae5f80)
Memory Reserved for ARM lib at 0x010ec000(0x00100000)
Memory Reserved for FBM at 0x011ec000(0x00e10000)
Memory Reserved for MMU at 0x01ffc000(0x00004000)
Find panel index 102(PANEL_LG_LM215WF1) from GPIO
TunerInit.....................MUSBStack-S v2.303 Init pBase = 0x20029000.
Image ROBase:0x0001099c ROLimit:0x004483f4
Protect readonly memory from 0x00000000 to 0x004483e8
MMU protect: 0x01ffc000 ~ 0xfffffff8
Successed to initialize Memory Intrusion Detection!
DTV>Detect flash #0: MXIC(25L320)
[SRM] DISP CTRL 0 0 0 0
[SRM] DISP CTRL 0 1 0 0
[DM] VT = 1111 (1111)
DM Panel V(1089 1099 1200) H(1999 2175 2239) P(120000000 143472527 175000000) F(50 75)
DM H MIN(1800 2048) H MAX(2624)
DM OK V(1111) H(2176) F(60)
[DM] VT = 1111 (1111)
DM OK HS(254)
[DM] VT = 1111 (1111)
DM Panel V(1089 1099 1200) H(1999 2175 2239) P(120000000 143472527 175000000) F(50 75)
DM H MIN(1800 2048) H MAX(2624)
DM OK V(1111) H(2176) F(60)
[DM] VT = 1111 (1111)
DM OK HS(254)
Watchdog enable:405000000
W: 1920 H: 1080 Rate: 60 DSH:800 DSV: 800 USH: 800 USV: 800 VSP: 0 TUNE: 0 bStackSize: 1
[Help]
cd: Change current directory
do: Repeat command
alias(a): Add/Show current alias
read(r): Memory read(word)
write(w): Memory write(word)
basic_(b): basic command
mtktool(0): mtktool command
customer(cust): Get customer name
pmx: pmx (scpos) command
musb: MUSB command
sif: Sif command
eeprom: Eeprom command
nim: Nim command
ir: Ir command
rtc(rtc): RTC commands
aud: Aud command
nptv(n): Nptv command
dbs: Dbs command
dmx(d): Demux commands
memtest: Memory test
pdwnc(pdwnc): PDWNC commands
bwt: BWT command
gpio: Gpio interface
DTV>
Again, thanks in advance!
Mmm, so right after posting, I figured out that I had to change directory to one of the commands listed in the first help in order to issue commands from the sub-help of each one instead of using them as arguments. EG: cd pmx [enter] pattern 1 [enter] would turn on the test pattern instead of pmx pattern or pmx pattern 1 or pmx -p and other such variants. There's probably a guide for this out there somewhere but most of my searches just turned up historical info on German submarines... Oh, and this thread which is kinda along the same lines: https://forum.xda-developers.com/android/software/rooting-mediatek-based-linux-smart-tv-t3150281
I guess now I just have to find which setting(s) fix my apparent problem, then I'll need to append the firmware, assuming I can't do it from the serial console. And that'll be the part I definitely need help with.
Maybe I can just use commands to do this, but I don't know what most of this is, and my searches aren't yielding much... That said, I can run the commands and post back the results since I don't expect anyone to have this same model.
Here's the menu and submenus with my comments in quotes:
Code:
cd: Change current directory "Figured out this one"
do: Repeat command "Self explanatory"[HIDE]
Usage: do loop cmd ex: do 10 read 0x200 0x10
CLI Command Return Value (-1)[/HIDE]
alias(a): Add/Show current alias "not quite sure what this does"
read(r): Memory read(word) "I guess these are self explanatory? no output if I just run the commands"
write(w): Memory write(word)
basic_(b): basic command [HIDE]
[Help]
stop: Stop RS232 transparent mode
sv: System mode detection
version(ver): System version/build date
reboot: System reboot/restart
getpllclk(gpc): close loop, gpc [cpu|sys|ps|vo|adc|b2r|apl1|apl2] [[band num]]
backup(bk): backup command
[/HIDE]
mtktool(0): mtktool command "the help kinda explains?[HIDE]
[Help]
et: Enter RS232 transparent mode
ft: Set RS232 factory mode
st: Stop RS232 transparent mode[/HIDE]
customer(cust): Get customer name "returns [TPV] and nothing more"
pmx: pmx (scpos) command "looks promising?"[HIDE]
[Help]
enable(e): enable/disable LVDS
pattern(p): enable/disable test pattern
list(l): show panel list
query(q): dump pmx(scpos) info
set(s): set parameter
[/HIDE]
musb: MUSB command "probably controls the usb port on the back?" [HIDE]
[Help]
debug_on(d_on): MUSB.d_on
debug_off(d_off): MUSB.d_off
debug_level(d_l): MUSB.d_l
init(i): MUSB init
speed(speed): MUSB speed
hmsd(hm): MUSB host msd test
htst(ht): MUSB host compilance test
suspend(s): USB bus suspend
resume(r): USB bus resume
[/HIDE]
sif: Sif command "I know what edid is basically, maybe I could make the computer think this is a non-hdtv type connection?"[HIDE]
[Help]
init(i): Sif init
read(r): Sif read
write(w): Sif write
writebyte(wb): Sif write byte
hdcp: Sif write HDCP SRAM default value
rhdcp: Sif read HDCP
wbhdcp: Sif write byte to HDCP
rbhdcp: Sif read byte from HDCP
wallhdcp(wah): Sif write all 320 bytes to HDCP
rallhdcp(rah): Sif read all 320 bytes from HDCP
edid: Sif write EDID default value
redid: Sif read EDID
walledid(wae): Sif write all 256 bytes to EDID
ralledid(rae): Sif read all 256 bytes from EDID
tunerread(tr): Tuner I2C No-sub-addr read
tunerwrite(tw): Tuner I2C No-sub-addr write
multipleread(mr): Multiple sub-addr I2C read
multiplewrite(mw): Multiple sub-addr I2C write
scan1(s1): Scan BUS0 (System I2C)
scam2(s2): Scan BUS1 (Tuner I2C)
sif_x_read(xr): fully functional sif read
sif_x_write(xw): fully functional sif write
edidreadbyte(edidrb): edid read byte
[/HIDE]
eeprom: Eeprom command "there's an 8 pin eeprom on the mainboard" [HIDE]
[Help]
readbyte(rb): eeprom.rb [eeprom-offset]
writebyte(wb): eeprom.wb [eeprom-offset] [byteval]
uartwrite(uw): Get data from Uart and write to eeprom.[/HIDE]
nim: Nim command "I assume this controls the onboard tv tuner"[HIDE]
[Help]
id: Set Tuner ID
ver: Tuner version
dtd: Nim dtd
atd: Nim atd
d_l: Set Debug Level
go: Start Nim
up: Channel Up
down: Channel Down
channel: Channel Set
freq: Freq Set
init(i): Nim init
open(o): Nim open
close(c): Nim close
setcable(sc): Nim set cable parameters
setBW(sbw): Nim set BW
getcablelevel(gclv): Nim get cable signal level
getcablesignal(gcsc): Nim get cable signal parameter
getcablelock(gclk): Nim get cable lock status
detachmw(dm): Nim Detach MW
detachi2c(dei2c): Detach Tuner I2C
[/HIDE]
ir: Ir command "InfraRed as in the remote I s'pose" [HIDE]
rx(rx): RX commands
[/HIDE]
rtc(rtc): RTC commands "returns [HELP] and nothing more. Real Time Clock I'd wager unless that has another meaning"
aud: Aud command "onboard speakers and other audio functions"[HIDE]
[Help]
ptsdly(ptsd): Delay audio startup by increasing PTS
dd_banner(banner): DD banner turn on for DD Test
spdif: spdif command
adac: adac command
interdac: inter dac command
dsp: dsp command
uop: audio uop
cfg: configuration
t: test
Clip: Aud Clip
factory(fac): Factory mode
[/HIDE]
nptv(n): Nptv command "not the foggiest idea of what these do."[HIDE]
[Help]
Ycproc(ycproc): YCPROC Command
TVD(tvd): TVD Command
NR(nr): NR Command
SCART(scart): SCART Command[/HIDE]
dbs: Dbs command "not this either"[HIDE]
[Help]
init(i): Dbs init
print(p): Dbs print at once
reset(r): Dbs reset[/HIDE]
dmx(d): Demux commands "This looks like the solution, except... the one command does nothing..."[HIDE]
[Help]
query(q):[/HIDE]
memtest: Memory test[HIDE][Help]
run(r): Memory test[/HIDE]
pdwnc(pdwnc): PDWNC commands "another one that just returns [Help]. no idea what it is"
bwt: BWT command "BandWidth Testing. not what I'm looking for I don't think"[HIDE]
[Help]
init: BandWidth Testing Preliminaries
testing: BandWidth Testing (BWT)
report: BandWidth Testing Report
chgchannel: Change Channel Number
dtv: BWT for DTV
atv: BWT for ATV
cvbs: BWT for CVBS
ypbpr: BWT for YPbPr
hdmi: BWT for HDMI
vga: BWT for VGA
src: Get current input source
mtime: Set BWT measure time
pippop: BWT for PIP/POP[/HIDE]
gpio: Gpio interface "General Purpose I/O. Don't think this is what I need either as it's hardware" [HIDE]
[Help]
output(out): gpio.out [gpio num] [[0|1]]
input(in): gpio.in [gpio num]
servo(servo): gpio.servo [0-4][/HIDE]
Wake times are also over 10 seconds, and the bright blue when there's no signal is rather jarring, so I suppose I'll need to extract and modify the firmware. Can anybody help with this?
Bump I s'pose. Still stuck, so for now I'm working on other things till I find someone who can help with this. I'd rather not drop $25 on a chinese basic mainboard for the panel or whatever I can get away with paying for a dubious identical-looking universal mainboard.
So I'm at it again trying to make this work. Glad I posted everything I did since I totally forgot how to work this thing... Still need help. I'm trying to dump the firmware with u boot so I can try to modify and reupload it with my custom values.
I also have this TV and would like to disable overscan. How should I connect my PC to one of its service ports? It has two service ports: a type A USB port and some port that I think is called 'ISP' or something like that. For what it's worth, I already have several USB to RS232 adapters (male USB type A on one end of the cable, male RS232 on the other end of the cable), but this TV doesn't have an RS232 port. I've already downloaded a third-party PuTTy app ("PuTTy (Unofficial)", if I recall correctly, from the Microsoft Store).
Edit: Made a correction.
I also have an adapter that is USB type B on both ends. It is called "SharkPort", IIRC. It was designed for connecting a PC to a PlayStation 2 to transfer PS2 game save files. It *might* be a USB host-to-host adapter. It is probably USB 1.0 or 1.1.
Big love for this thread even though I'm probably useless at the moment.
I'm ambitiously following some of your footsteps to tinker with my all-but-entirely defunct Vizio E3D420VX.
Curious how this story played out though; it looks like it relies more on TV knowledge than Linux-- these settings are pretty dense.

[KERNEL] mainlining Manta kernel

Hi,
I'm trying to port kernel 5.x to the Manta device (Nexus 10). The architecture is arm and the soc is exynos5250. I have no problem with drivers support because there are few similar devices already supported in mainline.
Therfore I started a write a device tree and tried to boot it. Nothing happened. Screens stays blank and device seems to be dead.
I'm looking for ideas. I tried a lot of things already . It's very strange because I would have expected a kernel panic and a reboot. It does nothing at all.
Of course I don't have a serial link. For now I use a small ramdisk image that just reboot the system after a 20 seconds sleep.
I'm wondering if there not a compatibility problem with the old bootloader. Please note that I append the dtb to the zImage and I activated the DTB-ATAGS compatibility options.
I fixed the decompressed kernel address (zreladdr) because the default calculation couldn't work.
I was thinking that my kernel image was a bit too big : I increased the original kernel size using zeroed padding and this one still works very well with my ramdisk.
So I'm a bit confused and I don't really know what I could check right now.
Here is the repo : https://github.com/jmarcgit/manta-mainline
You can find there the current dts and the config file I'm 'using.
I'm merging the default exynos config file with mine therefore it discards a lot of useless options in order to reduce the kernel size and does very few adaptations.
Thanks a lot for your support
Hi,
Happy to see that I'm not the only one trying to accomplish that!
I am not surprised that your reboot script does not work. On my config, the kernel boots without panic, but any call to a sleep/wait function freezes the system. Hence you may want to try to reboot the system without delay.
I cannot remember any compatibility issue with the bootloader.
Please note that you can get a serial link using the audio jack, see here: https://wiki.postmarketos.org/wiki/Serial_debugging:Cable_schematics#Nexus_debug_cable
Then you will have to enable low-level serial (I don't remember the exact name of the kernel option) on TTYSAC2. This has been immensely helpful on my side. Be careful though, as manta uses 1.8V UART.
I will fork your repo to put my config and dts in there as soon as I get some time, so that we can hopefully share, compare and improve our respective progress.
As a follow-up, I ran your configuration on my Manta (I only made the changes to get the serial console and added a missing fixed-clock node in the DTS that made the kernel panic in an early stage, see my fork here https://github.com/alexmrqt/manta-mainline/tree/8bf3528c1f9d9fb5eeb478901a88c495cacf5247).
With that, the device reboots after some times (but it is due to a kernel issue, as I used another ramdisk that is not supposed to do that).
See the kernel console below.
Code:
Starting kernel at 0x40008000...
AST_POWERON..
DEVICEINFO;R32D2042RBF;MANTAMF01;8;08:D4:2B:1F:C7:06;08:D4:2B:1F:C7:05;INFODONE
DTB:0x4021CC48 (0x0000A06D)
C:0x400080E0-0x40226E00->0x40682800-0x408A1520
DTB:0x40897368 (0x0000A1AB)
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 5.16.0-rc5-next-20211215 ([email protected]) (armv7-alpine-linux-musleabihf-gcc (Alpine 11.2.1_git20220219) 11.2.1 2022022
CPU: ARMv7 Processor [410fc0f4] revision 4 (ARMv7), cr=10c5387d
CPU: div instructions available: patching division code
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
OF: fdt: Machine model: Samsung Nexus 10 (manta)
printk: bootconsole [earlycon0] enabled
Memory policy: Data cache writealloc
Samsung CPU ID: 0x43520210
Zone ranges:
Normal [mem 0x0000000040000000-0x000000004fffffff]
HighMem empty
Movable zone start for each node
Early memory node ranges
node 0: [mem 0x0000000040000000-0x000000004fffffff]
Initmem setup node 0 [mem 0x0000000040000000-0x000000004fffffff]
percpu: Embedded 9 pages/cpu s13136 r0 d23728 u36864
Built 1 zonelists, mobility grouping on. Total pages: 65024
Kernel command line: earlyprintk mem=256M console=ttySAC2,115200n8 PMOS_NO_OUTPUT_REDIRECT s3cfb.bootloaderfb=0x60000000 androidboot5
Unknown kernel command line parameters "PMOS_NO_OUTPUT_REDIRECT", will be passed to user space.
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 249628K/262144K available (3072K kernel code, 519K rwdata, 896K rodata, 1024K init, 207K bss, 12516K reserved, 0K cma-reserve)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
rcu: Preemptible hierarchical RCU implementation.
rcu: RCU event tracing is enabled.
Trampoline variant of Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
random: get_random_bytes called from start_kernel+0x374/0x5e4 with crng_init=0
Exynos5250: clock setup completed, armclk=1000000000
Switching to timer-based delay loop, resolution 41ns
clocksource: mct-frc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
genirq: irq_chip COMBINER did not update eff. affinity mask of irq 57
arch_timer: cp15 timer(s) running at 24.00MHz (virt).
clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
Ignoring duplicate/late registration of read_current_timer delay
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable
/cpus/[email protected] missing clock-frequency property
/cpus/[email protected] missing clock-frequency property
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
cblist_init_generic: Setting adjustable number of callback queues.
cblist_init_generic: Setting shift to 1 and lim to 1.
Setting up static identity map for 0x40100000 - 0x40100060
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
CPU1: failed to boot: -110
smp: Brought up 1 node, 1 CPU
SMP: Total of 1 processors activated (48.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911
Hi Alex,
you did a great step forward ! I definately missed the serial cable.
Do you still work on it ? I think we are close to get it stable now.
Hi Marc,
Yes, I still work on it from time to time.
I got some nice progress since my last post:
- All CPUs now boot (a secure-firmware node was missing)
- WiFi now works
- Access to MMC partitions now works
- USB gadget works, but only when booting via fastboot (which suggests that something prevents the kernel to properly initialize the chip).
No luck getting the display to work so far
I just updated my repo with the last DTS and defconfig I use.
FYI, I do my tests with postmarketos (which allows me to test "advanced" features such as WiFi).
Hi Alex,
that's really great progress...
Does the backlight work ?
I don't have much time now.
Hi Marc,
Good news, I got the screen to work (as well as other things: battery, USB, touchscreen).
The bad news is that it requires some patches to the kernel code.
I included the patches (generated against kernel 6.1.4 from kernel.org) in the "patch" folder here - > https://github.com/alexmrqt/manta-mainline/tree/f4c38a7867f4e0e7481b71f96a0d0b4116b41c0f

Categories

Resources