Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,781,459 Members 37,639 Now Online
XDA Developers Android and Mobile Development Forum

[DEV only] Random Development thoughts

Tip us?
 
blueether
Old
(Last edited by blueether; 19th May 2014 at 07:27 PM.)
#1  
blueether's Avatar
Senior Member - OP
Thanks Meter 1,097
Posts: 2,555
Join Date: Jan 2011
Location: Te Awamutu, New Zealand

 
DONATE TO ME
Default [DEV only] Random Development thoughts

I have started this thread as a place to discuss random development thought that probably don't need their own threads, and as a place to discuss issues so other threads don't go too far off topic.

Table of Contents:
  • DBV for c6843: Posts 1 - 6
  • GPL: Post 7
  • F2FS: Post 8
  • wlan: post 9, 11 -
  • Optimisation Bookmark: post 10




Original Post 1:

First thought

@dbolivar Have you tried building you (DooMKernel) with CONFIG_DVB_CORE = y/m to see if you can get the TV function to work?
Charles
Alcatel One Touch "easy" -> Nokia 1110i -> Alcatel ame-408 -> Motorola Razr v3 -> Huawei u8100 -> Sony Xperia Z-Ultra

ROM:- Carbon
Kernel:- Pimped Kernel

Thankyou to all those that have donated to me over 2014.
 
dbolivar
Old
#2  
Senior Member
Thanks Meter 309
Posts: 270
Join Date: Nov 2012
Location: Sao Paulo, Brazil
Quote:
Originally Posted by blueether View Post
I have started this thread as a place to discuss random development thought that probably don't need their own threads, and as a place to discuss issues so other threads don't go too far off topic.

First thought

@dbolivar Have you tried building you (DooMKernel) with CONFIG_DVB_CORE = y/m to see if you can get the TV function to work?
Hi, good start. In fact I have, the differences in the kernel options between C6833 and C6843 (Brazilian model with digital TV) are:

Code:
47c47
< CONFIG_MACH_SONY_TOGARI_BRAZIL=y
---
> CONFIG_MACH_SONY_TOGARI_ROW=y
275d274
< CONFIG_ISDBT_TUNER_SMTEJ11X=y
325a325,327
> CONFIG_TOUCHSCREEN_CLEARPAD=y
> CONFIG_TOUCHSCREEN_CLEARPAD_I2C=y
> CONFIG_TOUCHSCREEN_CLEARPAD_RMI_DEV=y
Yes, I don't know why the Clearpad touchscreen is enabled for the C6833, but not for the C6843; I think it's just garbage (perhaps they made the togari defconfig based off honami, and corrected that when making the togari_brazil defconfig). It doesn't make any difference for me, disabling them keep the touchscreen (MAX1187) functions normal.

Well, back to the point: even when applying these differences to the ZU DooMKernel, the digital TV doesn't work. The app stays a long time in a black screen, and finally closes (FC). I investigated the kmsg and logcat, but nothing useful.

CONFIG_DVB_CORE is "m" by default. I tried insmod'ing every module in /system/lib/modules, but same result. I temporarily gave up, because I don't watch the crap they broadcast on the open TV here. But yeah, it would be good to have everything working...
 
blueether
Old
#3  
blueether's Avatar
Senior Member - OP
Thanks Meter 1,097
Posts: 2,555
Join Date: Jan 2011
Location: Te Awamutu, New Zealand

 
DONATE TO ME
Quote:
Originally Posted by dbolivar View Post
Hi, good start. In fact I have, the differences in the kernel options between C6833 and C6843 (Brazilian model with digital TV) are:

Code:
47c47
< CONFIG_MACH_SONY_TOGARI_BRAZIL=y
---
> CONFIG_MACH_SONY_TOGARI_ROW=y
275d274
< CONFIG_ISDBT_TUNER_SMTEJ11X=y
325a325,327
> CONFIG_TOUCHSCREEN_CLEARPAD=y
> CONFIG_TOUCHSCREEN_CLEARPAD_I2C=y
> CONFIG_TOUCHSCREEN_CLEARPAD_RMI_DEV=y
Yes, I don't know why the Clearpad touchscreen is enabled for the C6833, but not for the C6843; I think it's just garbage (perhaps they made the togari defconfig based off honami, and corrected that when making the togari_brazil defconfig). It doesn't make any difference for me, disabling them keep the touchscreen (MAX1187) functions normal.

Well, back to the point: even when applying these differences to the ZU DooMKernel, the digital TV doesn't work. The app stays a long time in a black screen, and finally closes (FC). I investigated the kmsg and logcat, but nothing useful.

CONFIG_DVB_CORE is "m" by default. I tried insmod'ing every module in /system/lib/modules, but same result. I temporarily gave up, because I don't watch the crap they broadcast on the open TV here. But yeah, it would be good to have everything working...
I hadn't got around to diff'ing them I just noticed the DVB line and had a quick look at the brazil defconfig.

I guess there is a binary blob that is needed?

For some reason I have to include the clearpad stuff at the moment in the pimped kernel, I should dig to find out why so the kernel is a tad smaller.
Charles
Alcatel One Touch "easy" -> Nokia 1110i -> Alcatel ame-408 -> Motorola Razr v3 -> Huawei u8100 -> Sony Xperia Z-Ultra

ROM:- Carbon
Kernel:- Pimped Kernel

Thankyou to all those that have donated to me over 2014.
 
dbolivar
Old
#4  
Senior Member
Thanks Meter 309
Posts: 270
Join Date: Nov 2012
Location: Sao Paulo, Brazil
Quote:
Originally Posted by blueether View Post
I hadn't got around to diff'ing them I just noticed the DVB line and had a quick look at the brazil defconfig.

I guess there is a binary blob that is needed?

For some reason I have to include the clearpad stuff at the moment in the pimped kernel, I should dig to find out why so the kernel is a tad smaller.
Hmm very good insight about the binary blob... It's very possible. I have FTFs for the C6833 and C6843, I'll extract them and compare the file list.
 
dbolivar
Old
#5  
Senior Member
Thanks Meter 309
Posts: 270
Join Date: Nov 2012
Location: Sao Paulo, Brazil
I made it work!! Well, involves some manual steps, but it's a very good progress. I started by comparing the file listing in /system from stock C6833 and C6843 firmwares, and although there is no kernel blob, there ARE some files related to DTV, mostly dynamic libs (.so), some configuration, but most importantly, these two:

Code:
/system/bin/dtvsdserver
/system/bin/dtvserver
So, I insmod'ed every module related to DTV/DVB, and then started these guys... And the TV works! BUT, as soon as I quit the Mobile TV app, the process "dtvserver" is killed with a hangup signal, and opening the app again does not restart it, so I have to manually bring the dtvserver up first (otherwise the same previous issue happens, black screen and finally Mobile TV FC's).

I notice some DTV/DVB modules couldn't be insmod'ed:

Code:
insmod: init_module 'dib3000mc.ko' failed (No such file or directory)
insmod: init_module 'dib7000m.ko' failed (No such file or directory)
insmod: init_module 'dib7000p.ko' failed (No such file or directory)
insmod: init_module 'dib8000.ko' failed (No such file or directory)
insmod: init_module 'dib9000.ko' failed (No such file or directory)
insmod: init_module 'mpq-dmx-hw-plugin.ko' failed (No such file or directory)
insmod: init_module 'tuner-simple.ko' failed (No such file or directory)
But the modules are there, and they are the new ones... I don't get it why they can't be insmod'ed, perhaps something is missing from the kernel config? It could be one of the reasons.

Another thing I've been wondering, is why the DVB modules necessary for the Mobile TV are not loaded automatically, like the wlan module is, for instance. Perhaps a difference in the ramdisk? Something to investigate next.
 
blueether
Old
#6  
blueether's Avatar
Senior Member - OP
Thanks Meter 1,097
Posts: 2,555
Join Date: Jan 2011
Location: Te Awamutu, New Zealand

 
DONATE TO ME
Quote:
Originally Posted by dbolivar View Post
I made it work!! Well, involves some manual steps...

Another thing I've been wondering, is why the DVB modules necessary for the Mobile TV are not loaded automatically, like the wlan module is, for instance. Perhaps a difference in the ramdisk? Something to investigate next.
Congrats on getting that far with the DTV, will make for a more complete device for the c6843 users that want to use custom ROMs

Any differences in udev or init.rc or whatever android uses?
Charles
Alcatel One Touch "easy" -> Nokia 1110i -> Alcatel ame-408 -> Motorola Razr v3 -> Huawei u8100 -> Sony Xperia Z-Ultra

ROM:- Carbon
Kernel:- Pimped Kernel

Thankyou to all those that have donated to me over 2014.
 
blueether
Old
#7  
blueether's Avatar
Senior Member - OP
Thanks Meter 1,097
Posts: 2,555
Join Date: Jan 2011
Location: Te Awamutu, New Zealand

 
DONATE TO ME
Development using the GPL and GPL'd code

The GPL is a very powerful tool, as are the other OSS licences. One has to know how they are used and can/can't be enforced before publishing any code under these licences or modifying code that that been published under a OSS licence. Using a OSS licence brings with it risks and rewords, often these are one and the same.

When we do anything with Android [Linux] kernels we fall under the bounds of the GPL v2 that it is published under. Any modification to the kernel has to be published under the same licence, and we have to publish the newly modified source in a sate that can recreate the binary that you publish to the public/xda.

I'll leave you with this quote from http://programmers.stackexchange.com
Quote:
...are you prepared to live by it, and let other people use what you've written, rather than just liking it because of what you can get out of it?
Charles
Alcatel One Touch "easy" -> Nokia 1110i -> Alcatel ame-408 -> Motorola Razr v3 -> Huawei u8100 -> Sony Xperia Z-Ultra

ROM:- Carbon
Kernel:- Pimped Kernel

Thankyou to all those that have donated to me over 2014.
 
dbolivar
Old
#8  
Senior Member
Thanks Meter 309
Posts: 270
Join Date: Nov 2012
Location: Sao Paulo, Brazil
Default F2FS mount and sysfs options

Now that we have an F2FS-enabled firmware by default, I've been reading about the mount options and sysfs entries available. As many of us know, there are lots of tweaks out there for EXT4, but what about F2FS? Well, here is the official documentation from the Linux kernel:

https://www.kernel.org/doc/Documenta...stems/f2fs.txt

As for the mount options, I think only discard could be interesting (but it's questionable, some people say it's better to schedule a regular fstrim call instead). There are also some sysfs tunables which I think can have a noticeable impact in battery life, and performance. Testing them would require a lot of trial and error. I'm pasting them below for those who don't want to go through the full document:

Code:
================================================================================
SYSFS ENTRIES
================================================================================

Information about mounted f2f2 file systems can be found in
/sys/fs/f2fs.  Each mounted filesystem will have a directory in
/sys/fs/f2fs based on its device name (i.e., /sys/fs/f2fs/sda).
The files in each per-device directory are shown in table below.

Files in /sys/fs/f2fs/<devname>
(see also Documentation/ABI/testing/sysfs-fs-f2fs)
..............................................................................
 File                         Content

 gc_max_sleep_time            This tuning parameter controls the maximum sleep
                              time for the garbage collection thread. Time is
                              in milliseconds.

 gc_min_sleep_time            This tuning parameter controls the minimum sleep
                              time for the garbage collection thread. Time is
                              in milliseconds.

 gc_no_gc_sleep_time          This tuning parameter controls the default sleep
                              time for the garbage collection thread. Time is
                              in milliseconds.

 gc_idle                      This parameter controls the selection of victim
                              policy for garbage collection. Setting gc_idle = 0
                              (default) will disable this option. Setting
                              gc_idle = 1 will select the Cost Benefit approach
                              & setting gc_idle = 2 will select the greedy aproach.

 reclaim_segments             This parameter controls the number of prefree
                              segments to be reclaimed. If the number of prefree
			      segments is larger than the number of segments
			      in the proportion to the percentage over total
			      volume size, f2fs tries to conduct checkpoint to
			      reclaim the prefree segments to free segments.
			      By default, 5% over total # of segments.

 max_small_discards	      This parameter controls the number of discard
			      commands that consist small blocks less than 2MB.
			      The candidates to be discarded are cached until
			      checkpoint is triggered, and issued during the
			      checkpoint. By default, it is disabled with 0.

 ipu_policy                   This parameter controls the policy of in-place
                              updates in f2fs. There are five policies:
                               0: F2FS_IPU_FORCE, 1: F2FS_IPU_SSR,
                               2: F2FS_IPU_UTIL,  3: F2FS_IPU_SSR_UTIL,
                               4: F2FS_IPU_DISABLE.

 min_ipu_util                 This parameter controls the threshold to trigger
                              in-place-updates. The number indicates percentage
                              of the filesystem utilization, and used by
                              F2FS_IPU_UTIL and F2FS_IPU_SSR_UTIL policies.

 max_victim_search	      This parameter controls the number of trials to
			      find a victim segment when conducting SSR and
			      cleaning operations. The default value is 4096
			      which covers 8GB block address range.

 dir_level                    This parameter controls the directory level to
			      support large directory. If a directory has a
			      number of files, it can reduce the file lookup
			      latency by increasing this dir_level value.
			      Otherwise, it needs to decrease this value to
			      reduce the space overhead. The default value is 0.

 ram_thresh                   This parameter controls the memory footprint used
			      by free nids and cached nat entries. By default,
			      10 is set, which indicates 10 MB / 1 GB RAM.
The Following 5 Users Say Thank You to dbolivar For This Useful Post: [ Click to Expand ]
 
DooMLoRD
Old
#9  
DooMLoRD's Avatar
Recognized Developer
Thanks Meter 38,226
Posts: 13,054
Join Date: Jul 2010
Location: Noida
@blueether & @dbolivar :
our primary concern should be to get custom wlan (prima/pronto) drivers working on custom compiled kernel for stock ROMs.. once we have that there are a LOT of features which we can add!

so far I havent had much luck but you can find all my tests here
 
blueether
Old
#10  
blueether's Avatar
Senior Member - OP
Thanks Meter 1,097
Posts: 2,555
Join Date: Jan 2011
Location: Te Awamutu, New Zealand

 
DONATE TO ME
A bookmark
Worth the read @dbolivar
http://forum.xda-developers.com/show....php?t=2754997
Charles
Alcatel One Touch "easy" -> Nokia 1110i -> Alcatel ame-408 -> Motorola Razr v3 -> Huawei u8100 -> Sony Xperia Z-Ultra

ROM:- Carbon
Kernel:- Pimped Kernel

Thankyou to all those that have donated to me over 2014.

The Following User Says Thank You to blueether For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes