How to fix Microphone low sensetivity (Superpad as example) - Android Software/Hacking General [Developers Only]

Hi,
I've searched a lot and nothing found as solution for my Superpad device so below something like solution.
In example below I'm using Superpad Chinese pad, sure some of this action could be applied to any other android devices.
If you experienced with silent mic problem in android system, you can perform fix in few ways (sure only for rooted device):
1. Way to fix through alsa. Launch terminal and type:
Code:
$ su
- find your input device, for that execute next command
Code:
# alsa_amixer cget numid=3
try numid value from 1 till you will see your input device or message that device doesn't exist
for example my respond:
Code:
numid=3,iface=MIXER,name='Input Volume'
; type=INTEGER,access=rw------,values=2,min=0,max=512,step=0
; values=488,488
- if values is less than max (in example 488<512) then you can continue, type next in console
Code:
# alsa_amixer cset numid=3 512,512
Code:
numid=3,iface=MIXER,name='Input Volume'
; type=INTEGER,access=rw------,values=2,min=0,max=512,step=0
; values=512,512
Settings will be applied till next reboot, after reboot you will execute it by hands again (I found no way to start it automatically at system boot).
So before reboot you can perform:
Code:
# alsa_ctl store
After reboot you can restore:
Code:
# alsa_ctl restore
2. Another way through audio device registers. This way is different for each audio device and should performed accordingly to chip documentation. For example for chip WM8987 (which is used in Superpad).
Microphone boost configuration are stored in the 5,4 bits of 0x20 register (left channel, 0x21 right channel in my device unusable). Configuration of input lines stored in 7,6 bits the same register.
Code:
$ su
- to see current settings perform next
Code:
# cat /proc/driver/audregs
in response you will see current settings;
- from chip datasheet:
Code:
5:4 bit | boost | hex
00 | off | c0
01 | 13dB | d
10 | 20dB | e0
11 | 29dB | f0
- write this registers into devices, for example for 29dB (mix will be little bit noisy so you can try 20dB) boost:
Code:
# echo 0x20 0xf0 > /proc/driver/audregs
- for autostart create XXmicfix (where XX - any unique number) file inside /etc/init.d with next text inside:
Code:
#!/system/bin/sh
echo 0x20 0xf0 > /proc/driver/audregs
Hope this will be helpful,
That's all.

Related

[Q]Where to place...

I'm trying to install dualtouch on my x10 mini pro with the files found here.
http://forum.xda-developers.com/showthread.php?t=1064558
I've done the temporary install through terminal emulator, but it's this bold part that stumps me. The bold parts show the permanent install.
add the two lines before any other insmod at the bottom of hw_config.sh:
"insmod /system/lib/modules/cy8ctma300_ser.ko"
"sleep 1"
Click to expand...
Click to collapse
Im confused
This is my hw_config.sh file trough wordpad on my computer.
# Vibrator configuration
dev=/sys/devices/platform/msm_pmic_vibrator
echo 2400 > $dev/voltage_mv
# lm3530 LMU configuration
dev=/sys/devices/platform/i2c-adapter/i2c-0/0-0036
echo linear > $dev/br::mapping # linear exp
echo 32768 > $dev/br::rate::up # 8, 1024, 2048, 4096, 8192, 16384, 32768, 65538
echo 32768 > $dev/br::rate::down # 8, 1024, 2048, 4096, 8192, 16384, 32768, 65538
echo 226 > $dev/br::limit # 0 - 255
echo 22.5 > $dev/br::fsc # 5.0, 8.5, 12.0, 15.5, 19.0, 22.5, 26.0, 29.5
echo 4,80,160,250 > $dev/curve::borders
echo 60,102,144,185,227 > $dev/curve::targets
echo high-z > $dev/als::r1 # high-z, 9360, 5560 .. 677.6 (see chip mnual)
echo high-z > $dev/als::r2 # high-z, 9360, 5560 .. 677.6 (see chip mnual)
echo 512 > $dev/als::avg-t # 32, 63, 128, 256, 512, 1024, 2048, 4096
echo i2c_pwm_als > $dev/mode # i2c, pwm, i2c_pwm, als, pwm_als, i2c_pwm_als, i2_als
# Proximity sensor configuration
dev=/sys/devices/platform/proximity-sensor/semc/proximity-sensor
echo 15 > $dev/led_on_ms # sensor LED on time in ms
echo 35 > $dev/led_off_ms # sensor LED off time in ms
# Flash LED configuration
dev=/sys/devices/platform/msm_pmic_flash_led
echo 80 > $dev/spotlight::current_ma # spotlight current
echo 4700 > $dev/spotlight::boost_mv # spotlight boost voltage
echo 480 > $dev/cmaflash::current_ma # camera flash current
echo 5000 > $dev/cmaflash::boost_mv # camera flash voltage
# Keyboard LED configuration
dev=/sys/devices/platform/msm_pmic_misc_led.0
echo 3 > $dev/als::cut-off # would be active only in ligh zone "0"
echo user_als > $dev/control::mode # user, als, user_als
echo 40 > $dev/max::current_ma # 0, 10, 20 .. 150 mA
Click to expand...
Click to collapse
Where do i type the 2 lines.
drybones41 said:
I'm trying to install dualtouch on my x10 mini pro with the files found here.
http://forum.xda-developers.com/showthread.php?t=1064558
I've done the temporary install through terminal emulator, but it's this bold part that stumps me. The bold parts show the permanent install.
Im confused
This is my hw_config.sh file trough wordpad on my computer.
Where do i type the 2 lines.
Click to expand...
Click to collapse
just put the two lines at the bottom. Seems like you have a clean hw_config.sh so you can ignore the before part and just insert them at the bottom of the file
slade87 said:
just put the two lines at the bottom. Seems like you have a clean hw_config.sh so you can ignore the before part and just insert them at the bottom of the file
Click to expand...
Click to collapse
Oh so thats what you do, it's just the way you worded the quoted phrase which kind of confused me. Im new to the rooting and editing scene. Thanks for the help
EDIT: Just finished and rebooted and multitouch is working like a charm thanks.

RAM Dumping to SD in Sony Miro...!!!

Hi
Getting RAM Dumping to SD in my sony miro. It takes 5 mins then ti automatically gets rebooted & this is happening frequently. Please be advise, what to do
Thanks in advance
Abhishek
for GOD sake...XDA team please reply solution...
You must have busybox installed. To disable core dumps for all users, open /etc/security/limits.conf, enter:
Code:
# vi /etc/security/limits.conf
Make sure the following config directive exists:
Code:
* hard core 0
Save and close the file. Once a hard limit is set in /etc/security/limits.conf, the user cannot increase that limit within his own session. Add fs.suid_dumpable = 0 to /etc/sysctl.conf file:
Code:
# echo 'fs.suid_dumpable = 0' >> /etc/sysctl.conf
# sysctl -p
This will make sure that core dumps can never be made by setuid programs. Finally, add the following to /etc/profile to set a soft limit to stop the creation of core dump files for all users (which is default and must be disabled):
Code:
# echo 'ulimit -S -c 0 > /dev/null 2>&1' >> /etc/profile

[GUIDE] Native Debian on Samsung Galaxy i7500

Hello fellow phone enthusiasts,
there are some sources on the internet describing how to run Debian on the Samsung Galaxy i7500 (Samsung's first Android device). Unfortunately, none of these sources can act as a complete guide, so I thought I could try to fill this void. This guide is far from complete and will hopefully grow over time. Anyway, I hope this is helpful for some people that are trying to do the same.
Note that this post should have gone into the development section, but I'm not senior enough to post there. Also the URLs in this guide are messed up for the same reason. Each messed up URL is marked with "(FIX this url)". I will fix these things as soon as possible, if there is any interest in this guide.
Best regards,
Frank
0. WARNING
This guide is for experienced users only. You might brick your phone while following this guide. I will not take responsibilty for any harm that may happen to you, your phone or those around you when following this guide. Please read and understand the complete guide before doing the first step. You have been warned.
Make a nandroid backup (can be done in the recovery image). Really, do it. Even if you think there's no valuable data, you must do a nandroid backub, because you will need to have the boot.img to boot back into android after debian has been installed. You must also copy your nandroid backup onto your PC.
1. Credits
A few years ago, there has been quite an active development community for the Galaxy i7500. Unfortunately, these forums have now pretty much died and I was not an active member of that community, because I was using it as my primary device back then and had no interest in hacking it.
Anyway, a HUGE THANK YOU goes to the fine fellas from drakaz.com and the GAOSP. You guys are awesome!
The actual hard technical work for this guide has been done by the authors of the following guides. I'm simply trying to understand what they did and write a step-by-step guide using their expertise:
(FIX this url)https :// code . google . com/p/linux-on-android/wiki/BasicSteps
(FIX this url)https :// wiki . debian . org/ChrootOnAndroid
(FIX this url)http :// www . bananenfisch . net/?p=1056
(FIX this url)https :// sven . killig . de/android/console.html
2. Overview
The goal of this guide is to have a running Debian Squeeze (Debian 6) running natively on a Samsung Galaxy i7500. Debian will not be run in a chroot environment on top of android, but instead the phone will directly boot into debian when powering it on. Debian will be installed on a SD card, so that we could still boot into Android, should we really mess things up at some point. It will not be true dual boot though (i.e. you have to reflash the boot section from a PC to boot into Android).
2.1 Primary goals
In the end, I'd like have the following functionality:
WLAN
Bluetooth
X Window / Graphical User Interface
All this is possible with below description now.
But this means we will loose the ability to make phone calls, send text messages, use GPS, connect to the internet through 3G or anything else you would normally expect from a smartphone. It's very likely possible to also have this functionality included, but I simply don't need it for my project. If someone else is willing to investigate this, I would be interested in the results though.
2.2 Prerequisites
Things you'll need include:
good Linux knowlegde
1 rooted Samsung Galaxy i7500 (I recommend to flash GAOSP)
1 micro SD card (I'm using an 8 GiB class 4 card)
1 computer running Linux with the following software installed (I'm using Debian & Fedora, but any distribution that has debootstrap should work)
debootstrap
git
fastboot (I suggest to use the version that comes with your distro, but you can also try the one from the Android SDK)
GCC cross-compiler for ARM in order to compile the kernel (Debian and Fedora come with compiler versions, that didn't work for me, so I'm using version 7 of the Android NDK, i. e. GCC version 4.4.3)
3. Installing Debian
Note that I had already GAOSP2 beta 3 installed on the i7500. I don't know if any of these steps are possible without installing GAOSP first.
3.1 Prepare partitions on SD card
The Samsung Galaxy i7500 has an "internal SD card" which will be preserved for use with Android, the recovery image, a.s.o. The external SD card will be used for debian. ALL data on the external card will be lost after below steps.
Put the SD card into an SD card reader or boot the i7500 into recovery mode (press "vol-" and "call" buttons when switching on the phone). Note that using GAOSP directly didn't work for me, because for some reason only the first partition was shown on the PC.
Code:
cfdisk /dev/sdX
(replace X with the correct letter for your SD card, and then create the one big enough partition for your needs, I created one 4GiB primary partition leaving me 4GiB for playing around later)
Code:
sudo mke2fs /dev/sdX1
3.2 Build debian filesystem structure
Create a directory for the newly created debian partition (I assume it' s called "debian") and run the following commands
Code:
sudo mount /dev/sdX1 ./debian/
Code:
sudo debootstrap --verbose --arch armel --foreign squeeze ./debian/ (FIX this url) http :// ftp . de . debian . org/debian
Code:
sudo umount ./debian/
3.3 Finalize the debian installation
The following is based on the steps as described here (FIX this url) wiki. debian.org/ChrootOnAndroid and www . bananenfisch .net/?p=1056.
Boot phone into GAOSP
Open terminal
Code:
su
Code:
cd /data/local
Code:
mkdir debian
Code:
mount /dev/block/mmcblk1p1 /data/local/debian
Finalize bootstrap:
Code:
chroot /data/local/debian /debootstrap/debootstrap --second-stage
Mount special file systems and chroot into Debian:
Code:
for f in dev dev/pts proc sys ; do mount -o bind /$f /data/local/debian /$f ; done
Code:
chroot /data/local/debian /bin/bash
Finalise the installation:
Code:
echo "deb (FIX this url) http :// ftp . de . debian . org/debian/ squeeze main non-free contrib" > /etc/apt/sources.list
Code:
apt-get update
Code:
rm -f /etc/mtab
Code:
ln -s /proc/mounts /etc/mtab
Code:
passwd root
Code:
echo i7500 > /etc/hostname
Code:
apt-get install openssh-server
Code:
apt-get clean && apt-get autoclean
The ssh-sever can be started whenever you like through
Code:
/etc/init.d/ssh start
Afterwards you can log in from your PC using "ssh [email protected]" into the chroot environment.
3.4 Configure locale
We need to set the locale for the system (otherwise there will always be warning messages, e.g. when installing new software):
Code:
apt-get install locales console-data keyboard-configuration
You might want to tweak a few more settings (especially if your locale is not en_US). You can use:
Code:
echo export LANG=en_US.UTF-8 >> /root/.bashrc
Code:
export LC_ALL="en_US.utf8"
Code:
dpkg-reconfigure locales
Code:
dpkg-reconfigure console-data
Code:
dpkg-reconfigure keyboard-configuration
3.5 Installing additional software
You can now start installing additional software that you might need (I suggest you log into your phone through ssh as described above). You'll be needing an editor to edit configuration files (I choose vim). For setting up WiFi the package "wpasupplicant" is needed.
Code:
apt-get install vim less wpasupplicant
3.6 Chroot into debian
If you at a later time want to chroot into your debian environment, I recommend to store the following commands in a shell script (I stored it in /data/local/debian.sh) which you can then run as root.
Code:
#!/bin/sh
mount /dev/block/mmcblk1p1 /data/local/debian
for f in dev dev/pts proc sys ; do mount -o bind /$f /data/local/debian/$f ; done
chroot /data/local/debian /bin/bash
4. Create boot image
4.1 Build kernel
Perform the following steps on your PC:
Download the Galaxo kernel sources: git clone (FIX this url) https :// github . com/drakaz/GalaxoKernel.git
Apply the patch described on (FIX this url) https :// code . google . com/p/linux-on-android/wiki/BasicSteps (themddi_toshiba_smd.c patch doesn't work, do the change manually)
Apply patch as described here: (FIX this url) http :// sven . killig . de/android/console.html
copy attached config.txt file to .config
I will eventually create a branch on github containing the patches and default config. But for now, you'll have to do the patching yourself.
Code:
make ARCH=arm CROSS_COMPILE=/path/to/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- oldconfig
Code:
make ARCH=arm CROSS_COMPILE=/path/to/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
Code:
make ARCH=arm CROSS_COMPILE=/path/to/android/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- modules
4.2 Install modules
The modules need to be installed on the SD card partition, so you need to boot your phone into recovery and mount the SD card. Then execute the following command.
Code:
sudo make ARCH=arm CROSS_COMPILE=/path/to/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- INSTALL_MOD_PATH=/path/to/sdcard modules_install
In order for the WLAN kernel module to work the following files need to be copied from the GAOSP ROM to the /etc/ folder on the phone:
rtecdc.bin
nvram.txt
4.3 Minimal boot file system
A boot file system (a.k.a. initramfs) is needed to start the debian boot process. Create a folder called minimal_initramfs with the follwoing content:
Code:
minimal_initramfs/
|-- dev/
|-- init*
|-- mnt/
| `-- root/
|-- proc/
|-- sbin/
| `-- busybox*
`-- sys/
A binary of busybox can be downloaded from the busybox website (use busybox-armv4tl). The file "init" is actually a shell script with the following content:
Code:
#!/sbin/busybox sh
# initramfs pre-boot init script
# Something (what?) needs a few cycles here
/sbin/busybox sleep 1
# Populate /dev
/sbin/busybox mknod /dev/mmcblk1p1 b 179 9
# Mount the root filesystem, second partition on micro SDcard
/sbin/busybox mount -t ext2 -o noatime,nodiratime /dev/mmcblk1p1 /mnt/root
# Transfer root to SDcard
exec /sbin/busybox switch_root /mnt/root /sbin/init
The directory structure must then be compressed. To do this run the following sequence of commands when in the minimal_initramfs directory:
Code:
find . | cpio --quiet -H newc -o | gzip > ../minimal.cpio.gz
4.4 Creating the image
For creating the image you need the tool mkbootimg which you can find in android_bootimg_tools.tar.gz. Run the following command to create the boot image from the initramfs and the kernel you created above:
Code:
./mkbootimg --kernel /path/to/Galaxo-kernel/arch/arm/boot/zImage --ramdisk /path/to/minimal.cpio.gz --cmdline "fbcon=font:VGA8x8" --pagesize 2048 --base 10000000 -o debian_boot.img
5. Configuring network
5.1 Setting up the interface
Your /etc/network/interfaces file on the phone should look like this:
Code:
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
wpa-driver wext
wpa-conf /etc/wpa_supplicant.conf
5.2 Setting up wireless encryption
For network configuration we'll be using wpa_supplicant which we already installed in one of the above steps. On the phone create the file /etc/wpa_supplicant.conf with the following content. Please enter the correct values for ssid, psk and key_mgmt for your network:
Code:
network={
ssid="YourSSID"
psk="YourSecretPassword"
key_mgmt=WPA-PSK
priority=11
}
5.3 Loading drivers
In order for the WLAN kernel module to be loaded add the following line to /etc/modules:
Code:
bcm4325 firmware_path=/etc/rtecdc.bin nvram_path=/etc/nvram.txt
6. Flashing the boot image and booting into Debian
Now it's finally time to finally flash the previously created boot image. At this time, be sure that you only have your Galaxy connected to your PC. Otherwise you might brick any other connected phone. On the PC run
Code:
sudo fastboot flash boot debian_boot.img
Then boot the Galaxy into fastboot mode by pressing "call" when powering on the phone.
When the process is finished the phone will boot into Debian and automatically connect to your wireless network (if the set-up was correct). You can now connect to the phone through ssh and enjoy your new pocket server.
If you may ever want to boot into android again, you just need to flash the original boot.img that you created with nandroid:
Code:
sudo fastboot flash boot boot.img
7. Bluetooth
7.1 Compile brcm_patchram_plus
For getting bluetooth operational it is necessary to use Broadcom's brcm_patchram_plus software. As it is not available as a Debian Squeeze package, we need to compile it ourselves. So we need to install the following packages on the phone:
Code:
apt-get install git gcc make libbluetooth-dev
Then it's possible to download the sources:
Code:
git clone (FIX this url)https :// github . com / MarkMendelsohn / brcm_patchram.git
And compile the tool using:
Code:
make
7.2 Activating bluetooth
In order for bluetooth to work the following files need to be copied from the GAOSP ROM to the same folder on the phone that you compiled the brcm_patchram_plus in:
BCM4325D1_004.002.004.0153.0156.hcd
After that it's possible to execute the followig commands:
Code:
echo 0 > /sys/class/rfkill/rfkill0/state
echo 1 > /sys/class/rfkill/rfkill0/state
./brcm_patchram_plus -d --enable_hci --baudrate 3000000 --use_baudrate_for_download --patchram BCM4325D1_004.002.004.0153.0156.hcd /dev/ttyHS0
The last command will never terminate and you will get a lot of output due to the (-d) switch. After starting a new console, you will be able to scan for bluetooth devices using:
Code:
hcitool -i hci0 scan
7.3 Connecting a keyboard
I'm using a Rapoo E6100 keyboard and the following procedure worked fine for me. It should be similar with other keyboards.
Code:
apt-get install python-bluez python-gobject python-dbus bluez-compat
Code:
cd /usr/share/doc/bluez/examples
Press pairing button on keyboard then
Code:
./simple-agent hci0 6C:xx:xx:xx:xx:xx
(use the bluetooth address of your keyboard, according to the scan in the previous chapter)
The script will ask for a PIN. I entered 0000 on both the keyboard and phone and the keyboard was registered.
Code:
./test-device trusted 6C:xx:xx:xx:xx:xx yes
(again use the bluetooth address of your keyboard)
Code:
hidd --connect 6C:xx:xx:xx:xx:xx
Now you should be good to use your keyboard.
7.4 Automate patchram
Right now, the KB is not automatically connected on boot, because the patchram command from above needs to be executed on every boot. Hence the following commands should be added to /etc/rc.local (before the exit 0):
Code:
#Activate bluetooth
echo 0 > /sys/class/rfkill/rfkill0/state
echo 1 > /sys/class/rfkill/rfkill0/state
/path/to/brcm_patchram_plus --enable_hci --baudrate 3000000 --use_baudrate_for_download --patchram /path/to/BCM4325D1_004.002.004.0153.0156.hcd /dev/ttyHS0 &
8. Setting the clock
I was having trouble with my clock forgetting the day and time after each reboot. It was a flaw in my kernel config. In the current version of attached config file this is fixed. Anyway, I'm also running NTP to have the clock more accurate.
Code:
apt-get install ntpdate
NTP already come nicely pre-configured (thanks, Debian maintainers!). After that the timezone can be selected using
Code:
dpkg-reconfigure tzdata
9. GUI (X.org)
X.org works almost out-of-the-box since we already pathed the kernel as described in chapter 4 above. Based on the description from (FIX this url)https :// code . google . com/p/linux-on-android/wiki/BasicSteps only two minor changes have been made:
The framebuffer device is at /dev/fb0 instead of /dev/graphcics/fb0
I use evdev instead of tslib, because it provided better results for me (thanks to pabs from #debian-mobile for pointing me there)
9.1 Install X.org
All we need to do is download the software
Code:
apt-get install xorg xserver-xorg-video-fbdev xserver-xorg-input-evdev
9.2 Configuring X.org
Now create /etc/X11/xorg.conf:
Code:
Section "InputDevice"
Identifier "Touchscreen"
Driver "evdev"
Option "Device" "/dev/input/event2"
EndSection
Section "Device"
Identifier "Configured Video Device"
Driver "fbdev"
Option "fbdev" "/dev/fb0"
EndSection
Section "Monitor"
Identifier "Configured Monitor"
Option "DPMS" "false"
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection
Section "ServerLayout"
Identifier "Default"
Screen "Default Screen"
InputDevice "Touchscreen" "CorePointer"
EndSection
Section "ServerFlags"
Option "DefaultServerLayout" "Default"
EndSection
9.3 Testing X.org
For testing X.org I've installed icewm and created the following /root/.xsession
Code:
#!/bin/sh
xterm&
exec icewm
Then just type in startx from the console and you have X. Of course you will have to change this to whatever you need or maybe even make X start on boot.
9.4 Boot into Browser
For my target system I want the phone to directly boot into a browser. This can easily be achieved by using the nodm package:
Code:
apt-get install nodm
and midori as browser:
Code:
apt-get install midori
We'll also need a user account. I called my user "default". But naturally you can of course choose whatever you like.
Code:
adduser default
Then nodm has to be configured in /etc/default/nodm:
Code:
# nodm configuration
# Set NODM_ENABLED to something different than 'false' to enable nodm
NODM_ENABLED=true
# User to autologin for
NODM_USER=default
# xinit program
NODM_XINIT=/usr/bin/xinit
# First vt to try when looking for free VTs
NODM_FIRST_VT=7
# X session
NODM_XSESSION=/etc/X11/Xsession
# Options for the X server
NODM_X_OPTIONS='vt7 -nolisten tcp'
# If an X session will run for less than this time in seconds, nodm will wait an
# increasing bit of time before restarting the session.
NODM_MIN_SESSION_TIME=60
And we have to create ~/.xsession for our user:
Code:
#!/bin/bash
midori -e Fullscreen &
exec icewm
A few tweaks in the icewm config (~/.icewm/preferences) will make the window manager look more nicely:
Code:
WorkspaceNames=" 1 "
TaskBarShowCPUStatus=0
TaskBarDoubleHeight=0
TaskBarShowWorkspaces=0
TaskBarShowMailboxStatus=0
TaskBarShowNetStatus=0
TimeFormat="%H:%M"
TaskBarShowWindowListMenu=1
TaskBarShowShowDesktopButton=0
10. Power management
The kernel is already configured with many different frequency govenors. Also the default govenor is set to "ondemand" but for some reason the when looking at /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor it's using the "performance" govenor. This can be solved by simply installing cpufreq-utils:
Code:
apt-get install cpufrequtils
The default settings are already using "ondemand", which seems to be a good choice. Anyway, further optimisations can be done in /etc/default/cpufrequtils if needed.
The phone still gets a little too warm for my taste (I think warmer than in android). Maybe there's something that could fix this, but I'm not an expert.
11. Known shortcomings
The whole set-up is in a really, REALLY early alpha stage
If any of the hardware buttons is touched in text mode the phone crashes (does not happen when in X.org)
The screen will time-out after some time, I have no idea how to wake it up again
Did I mention this is in an alpha stage?
12. Future improvements
Switching to a newer kernel version: The latest version of GAOSP runs on kernel version 2.6.35, while this guide is using 2.6.27. I have experimented with 2.6.29, but I had trouble getting a working frame buffer.
Switching to the latest version of debian (wheezy).
History
History:
2013-12-27:
Initial version
2013-12-30:
Minimized the the init script by removing mounts for /dev, /proc, and /sys. These are not necessary and mounting /dev prevents Debian's udev from working correctly.
2014-01-19:
Added description for bluetooth.
2014-01-25:
Added description for graphical user interface (X.org).
2014-01-25:
Boot into X/Browser and power management
2014-01-26:
Updated clock settings
Video proof
Hi all,
to get a better understanding what this is all about please watch the attached video. Please excuse the poor quality and the fingerprints on the screen.
As you can see the framebuffer output has a few quirks, but hopefully this will work out as soon as X is working.
BR,
Frank
All goals achieved
Okay, I think I now have achieved all goals. I can connect to WiFi and bluetooth. And there is a graphical user interface. Now the tweaking can start (first thing that comes to mind is powersaving). I really created this guide for myself, but I'd be happy to know if anyone else has interest in this topic.
Nice, I am interested. One question!
frank47 said:
Okay, I think I now have achieved all goals. I can connect to WiFi and bluetooth. And there is a graphical user interface. Now the tweaking can start (first thing that comes to mind is powersaving). I really created this guide for myself, but I'd be happy to know if anyone else has interest in this topic.
Click to expand...
Click to collapse
Nice, I am interested. One question!
I would like to use this device to get some data from the sensors. I have tested some apps in Android GAOSP to read the sensors in the i7500, but instead of using android apps, it could be very interesting to have a debian.
Have you tried to do it? Do you think it is possible? Is it too tricky to get a stable debian running an app to send sensors' data to another debian? I could help if you see it is interesting.
What is your opinion? Thank you...
Hi PabloGN,
there are a lot of entries in /proc and /sys. I think it's likely to be possible te access the sensors. For now, I have only looked at the battery status. Don't know if you'd consider that a sensor. Anyway, you would probably have to re-write your software to use those devices instead of using already existing Java libs for android. Hard to tell,*if it's worth the effort.
BR,
Frank
PabloGN said:
I would like to use this device to get some data from the sensors.
Click to expand...
Click to collapse
This is the list of input devices on my the i7500:
Code:
[email protected]:~# cat /proc/bus/input/devices
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="I7500_headset"
P: Phys=
S: Sysfs=/devices/virtual/input/input0
U: Uniq=
H: Handlers=kbd event0
B: EV=3
B: KEY=4 0 0 0 0 0 0 0
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="I7500_keypad"
P: Phys=
S: Sysfs=/devices/virtual/input/input1
U: Uniq=
H: Handlers=kbd event1
B: EV=3
B: KEY=800180 100000 0 41000800 1c1ec0 0 0 0
I: Bus=0000 Vendor=0000 Product=0000 Version=0033
N: Name="melfas-tsi-touchscreen"
P: Phys=
S: Sysfs=/devices/virtual/input/input2
U: Uniq=
H: Handlers=event2
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=11000003
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="compass"
P: Phys=
S: Sysfs=/devices/virtual/input/input3
U: Uniq=
H: Handlers=event3
B: EV=9
B: ABS=20305ff
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="proximity_i2c"
P: Phys=
S: Sysfs=/devices/virtual/input/input4
U: Uniq=
H: Handlers=event4
B: EV=1
So, it should at least be possible to read the compass and proximity sensor data form /dev/input/event3 and /dev/input/event4. Maybe there's more and I just haven't compiled it into the kernel or it's accessed in some other way. Sorry, the sensors are not part of my use case so far.
I'm only using /dev/input/event2 (touchscreen) in my xorg.conf as an input device. Works like a charm.
Good luck with your endeavour. If you want me to test something or send you the output of some command, just ask here or by PM.

[BOOTANIMATION][HDPI] Nexus 5 Boot Animation for codina [480x800]

Hii there!
I just wanna share some Nexus boot-anims which I ported from several sources
I use bash (batch processing) & ImageMagick cmds to make these boot-anims
1. Nexus 5 (Kitkat) Boot Animation
bootanim_nexus-5-kk-default.zip, src: Nexus 5 [kitkat]All APPS , stock Walls , Bootanimation ,Fonts
bootanim_htc-one-google-ed.zip, src: [bootanimation] Google Edition Boot Animation
2. Nexus (Lollipop) Boot Animation
bootanim_nexus-5-l-small.zip, src: [BOOTANIMATION] Nexus 5 Bootanimations Collection
bootanim_nexus-5-l-large.zip, src: [BOOTANIMATION] Nexus 5 Bootanimations Collection
You can put one of them to /system/media and rename it to bootanimation.zip
Don't forget to backup ur old boot animation if you want to. You do it all at your own risk!
Note: How to make these boot-anims?
1. bootanim_nexus-5-l-small.zip
Create a new directory.. for example: bootanim. Extract the source (keyword: N7 Maxed, Manual Install) to bootanim/orig
Then, put this script to bootanim/make-bootanim.sh & execute it to generate bootanim/bootanim.zip
Code:
#!/bin/bash
echo "make-bootanim.sh by @nieltg"
echo
BOOTANIM_SIZE=480x208
BOOTANIM_CROP=1080x468
mkdir mod
# Adjust all pictures
if [ -n "${BOOTANIM_CROP}" ] ; then
cmd_crop="-gravity center -crop ${BOOTANIM_CROP}+0+0 +repage"
else
cmd_crop=
fi
for i in orig/part? ; do
conv_dir=mod/$(basename ${i})
mkdir ${conv_dir} ; echo "mkdir: ${conv_dir}"
for j in $i/*.png ; do
conv_target=${conv_dir}/$(basename ${j})
convert ${j} ${cmd_crop} \
-resize ${BOOTANIM_SIZE} ${conv_target}
echo "converted: ${conv_target}"
done
done
# Generate desc.txt
echo "${BOOTANIM_SIZE//x/ } 30" > mod/desc.txt
tail -n +2 orig/desc.txt >> mod/desc.txt
echo "written: mod/desc.txt"
# Pack bootanim.zip
( cd mod ; zip -0 ../bootanim.zip -r * )
echo "packaged: bootanim.zip"
rm -r mod
echo
echo done.
echo
2. bootanim_nexus-5-l-large.zip
The steps are same like bootanim_nexus-5-l-small.zip.. Extract the source (keyword: N7 Mod, Manual Install) to bootanim/orig
But, you have to make some adjustments with bootanim/make-bootanim.sh
Modify BOOTANIM_SIZE & BOOTANIM_CROP:
Code:
BOOTANIM_SIZE=480x320
BOOTANIM_CROP=
3. bootanim_nexus-5-kk-default.zip
The steps are still the same like bootanim_nexus-5-l-small.zip.. Extract the source (keyword: Boot Animation) to bootanim/orig
And.. like usual, you have to make some adjustments with bootanim/make-bootanim.sh
Modify BOOTANIM_SIZE & BOOTANIM_CROP:
Code:
BOOTANIM_SIZE=480x96
BOOTANIM_CROP=1080x216
Add codes for tail-animation after "Adjust all pictures" section:
Code:
# Tail animation
l=0
mkdir mod/part2
echo "mkdir: mod/part2"
for k in 90 72 50 30 15 ; do
conv_num=$((l++))
conv_target=$(printf mod/part2/%03d.png ${conv_num})
convert mod/part1/059.png \
-resize ${k}% -gravity center -background black \
-extent ${BOOTANIM_SIZE} ${conv_target}
echo "scaled: ${conv_target}"
done
convert -size ${BOOTANIM_SIZE} canvas:black mod/part2/00${l}.png
echo "created: mod/part2/00${l}.png"
And replace "Generate desc.txt" section:
Code:
cat > mod/desc.txt << __DESC
480 96 24
c 1 0 part0
c 0 0 part1
c 1 0 part2
__DESC
echo "written: mod/desc.txt"
4. bootanim_htc-one-google-ed.zip
The steps are still the same like bootanim_nexus-5-l-small.zip.. Extract the source (keyword: GoogleBootanimation768-signed.zip) to bootanim/orig
And.. still like usual, you have to make some adjustments with bootanim/make-bootanim.sh
Modify BOOTANIM_SIZE & BOOTANIM_CROP:
Code:
BOOTANIM_SIZE=480x100
BOOTANIM_CROP=768x160
Add codes for tail-animation which steps is described on bootanim_nexus-5-kk-default.zip
Then, add more codes for head-animation after "Tail animation" section:
Code:
# Head animation
l=0
mkdir mod/part3
echo "mkdir: mod/part3"
easing_tmp=$(mktemp)
# Easing for ActionScript
# Source: http://gizma.com/easing
python3 - > ${easing_tmp} << __PYFILE
import math
def ease (t,b,c,d):
t /= d/2
if (t < 1): return c/2*t*t*t + b
t -= 2
return c/2*(t*t*t + 2) + b
for i in range (0,25):
print ("%.2f" % ease (i,0,100,24))
__PYFILE
easing=$(cat ${easing_tmp})
echo "generated: ${easing_tmp}"
rm ${easing_tmp}
for k in ${easing} ; do
conv_num=$((l++))
conv_target=$(printf mod/part3/%03d.png ${conv_num})
convert mod/part0/000.png \
-modulate ${k} ${conv_target}
echo "brightness: ${conv_target}"
done
And replace "Generate desc.txt" section:
Code:
cat > mod/desc.txt << __DESC
480 100 24
c 1 24 part3
c 1 0 part0
c 0 0 part1
c 1 0 part2
__DESC
echo "written: mod/desc.txt"
I use Fedora 21 64-bit to build these boot-anims.. I think you should be able to build it too on ur Linux
These scripts use common tools, ex: bash, ImageMagick, python3 which usually have already installed
You can use this script to make a new boot-anims or if you want to improve these boot-anims,
you can modify the scripts and rebuild them using these scripts..

How do I add, delete, update playlists, if possible from shell (CM13, no gapps)?

Hi!
I'm generating playlists with bash. They work fine everywhere else and I'd like to use them on my phone. Problem is:
- Sometimes it takes days until a playlist is added even if I re-scan the sd card manually.
- Sometimes they just show up empty for no apparent reason.
- I can't find any documentation.
- Can't find a way to delete the messed up ones comfortably (without deleting the whole media app data + the ones created from applications that I want to keep).. So they just accumulate (I've got more than 500 playlists on there now)
- Can't figure out how exactly I have to create playlists. Best results so far with utf8 m3u without header or anything (just one relative filename per line).
- Tried using m3u8 extension instead or adding the header #EXTM3U to the first line, but those playlists just seem to show up empty (hard to tell because it takes DAYS until they update and I'm never show)
So, the ideal solution for me would be some CLI commands to show / add / remove playlists, so I can do something like this:
Code:
$ crappymediathing --printall playlists | grep "****ty\|broken" | while read playlist; do crappymediathing --remove "$playlist"; done;
$ echo /sdcard/playlists/*m3u | while read playlist; do crappymediathing --addplaylist "$playlist" --doitrightnow --yesreallynotatsomerandompointinthenext2days; done;
... and more.
If that's not possible, I'll have to consider alternatives and hints are appreciated... not planning to install gapps or random closed source apps from the Internets though.
HELP!!?!?!
(please :silly: )
Does anyone know how those sqlite db's are supposed to work? Am I not supposed to set the media type to 0 in the "files" table to remove a playlist?
I played around a bit and managed to remove the broken playlists, but it also broke some stuff and I had to reset that mediaprovider thing.
( I hate android so much T_T )
Code:
#!/bin/bash
tmpdir="/tmp/adbpull"
mkdir -p "$tmpdir"
pushd "$tmpdir" || exit 1
meduid="u0_a9"
mpid="$(adb shell ps | grep $meduid | sed "s/[^ ]* *\([0-9]*\) .*/\1/")"
echo $mpid | grep "[0-9]" && adb shell kill "$mpid"
adb root 2> /dev/null
dadir="/data/data/com.android.providers.media/databases/"
daext="external.db"
daint="internal.db"
[ -f "$tmpdir/$daext" ] || adb pull "$dadir"
sqlite3 $daext "SELECT _data FROM audio_playlists" |
grep "storage/" |
while read file; do adb shell ls $file; done |
grep "No such file" | sed "s/: No such file.*//" |
while read data;
do sqlite3 $daext "SELECT _id FROM audio_playlists WHERE _data='$data'";
done | while read id;
do echo
mpthrees="$(sqlite3 $daext "SELECT * FROM audio_playlists_map WHERE playlist_id='$id'";)"
count="$(echo "$mpthrees" | wc -l)"
plist="$(sqlite3 $daext "SELECT * FROM files WHERE _id='$id'";)"
echo "Playlist: $plist ### Amount of entries: $count"
sqlite3 $daext "UPDATE files SET media_type = 0 WHERE _id='$id'"
done;
#adb shell sqlite3 $dadir$daext \"SELECT \* FROM audio_playlists_map\"
adb push external.db /data/data/com.android.providers.media/databases/
# adb chown $meduid:$meduid "$dadir/$daext"
echo schema hint:
adb shell sqlite3 $dadir$daext .schema | grep play
popd
( Such a mess -.-" )
Unless I mess with the db, the playlists in the media DB just won't update most of the time if I update the corresponding m3u... sometimes the changes show up after a couple of days and reboots but not immediately after re-scanning the files and not even right after the first reboot. But I keep breaking functionality no matter how I try it -.-

Categories

Resources