[INFO][hammerhead] Change Wi-Fi MAC address - Nexus 5 General

Should you find yourself in a legit need to change the mac address (for testing, debugging etc), a simple 'busybox ifconfig wlan0 hwaddr' won't work (returning auth errors).
It looks like the mac address needs to be encoded into /persist/wifi/.macaddr
Backup the .macaddr file and issue the following:
Code:
echo -e "\x00\x11\x22\x33\x44\x55" > /persist/wifi/.macaddr
Turn the wifi off and on and the resulting MAC will be 00:11:22:33:44:55
If you want to emulate an Apple device (can obviously be anything but this was easy to extract), the following script will give you a random MAC:
Code:
#!/system/xbin/bash
apple=( 00:03:93 00:05:02 00:0A:27 00:0A:95 00:0D:93 00:10:FA 00:11:24 00:14:51 00:16:CB 00:17:F2 00:19:E3 00:1B:63 00:1C:B3 00:1D:4F 00:1E:52 00:1E:C2 00:1F:5B 00:1F:F3 00:21:E9 00:22:41 00:23:12 00:23:32 00:23:6C 00:23:DF 00:24:36 00:25:00 00:25:4B 00:25:BC 00:26:08 00:26:4A 00:26:B0 00:26:BB 00:30:65 00:3E:E1 00:50:E4 00:61:71 00:6D:52 00:88:65 00:A0:40 00:C6:10 00:F4:B9 00:F7:6F 04:0C:CE 04:15:52 04:1E:64 04:26:65 04:48:9A 04:54:53 04:69:F8 04:DB:56 04:E5:36 04:F1:3E 04:F7:E4 08:00:07 08:70:45 08:74:02 0C:15:39 0C:30:21 0C:3E:9F 0C:4D:E9 0C:74:C2 0C:77:1A 0C:BC:9F 10:1C:0C 10:40:F3 10:41:7F 10:93:E9 10:9A:DD 10:DD:B1 14:10:9F 14:5A:05 14:8F:C6 14:99:E2 18:20:32 18:34:51 18:9E:FC 18:AF:61 18:AF:8F 18:E7:F4 18:EE:69 18:F6:43 1C:1A:C0 1C:AB:A7 1C:E6:2B 20:78:F0 20:7D:74 20:9B:CD 20:A2:E4 20:C9:D0 24:24:0E 24:A0:74 24:A2:E1 24:AB:81 24:E3:14 28:0B:5C 28:37:37 28:5A:EB 28:6A:B8 28:6A:BA 28:CF:DA 28:CF:E9 28:E0:2C 28:E1:4C 28:E7:CF 28:F0:76 2C:1F:23 2C:B4:3A 2C:BE:08 2C:F0:EE 30:10:E4 30:90:AB 30:F7:C5 34:12:98 34:15:9E 34:36:3B 34:51:C9 34:A3:95 34:C0:59 34:E2:FD 38:0F:4A 38:48:4C 38:C9:86 3C:07:54 3C:15:C2 3C:AB:8E 3C:D0:F8 3C:E0:72 40:30:04 40:33:1A 40:3C:FC 40:6C:8F 40:A6:D9 40:B3:95 40:D3:2D 44:2A:60 44:4C:0C 44:D8:84 44:FB:42 48:43:7C 48:60:BC 48:74:6E 48:D7:05 48:E9:F1 4C:7C:5F 4C:8D:79 4C:B1:99 50:7A:55 50:EA:D6 54:26:96 54:4E:90 54:72:4F 54:9F:13 54:AE:27 54:E4:3A 54:EA:A8 58:1F:AA 58:55:CA 58:7F:57 58:B0:35 5C:59:48 5C:8D:4E 5C:95:AE 5C:96:9D 5C:97:F3 5C:AD:CF 5C:F5:DA 5C:F9:38 60:03:08 60:33:4B 60:69:44 60:92:17 60:C5:47 60:D9:C7 60:F8:1D 60:FA:CD 60:FB:42 60:FE:C5 64:20:0C 64:76:BA 64:9A:BE 64:A3:CB 64:B9:E8 64:E6:82 68:09:27 68:5B:35 68:64:4B 68:96:7B 68:9C:70 68:A8:6D 68:AE:20 68:D9:3C 6C:3E:6D 6C:40:08 6C:70:9F 6C:94:F8 6C:C2:6B 70:11:24 70:14:A6 70:3E:AC 70:48:0F 70:56:81 70:73:CB 70:CD:60 70:DE:E2 70:E7:2C 70:EC:E4 74:81:14 74:E1:B6 74:E2:F5 78:31:C1 78:3A:84 78:6C:1C 78:7E:61 78:9F:70 78:A3:E4 78:CA:39 78:D7:5F 78:FD:94 7C:01:91 7C:11:BE 7C:6D:62 7C:6D:F8 7C:C3:A1 7C:C5:37 7C:D1:C3 7C:F0:5F 7C:FA:DF 80:00:6E 80:49:71 80:92:9F 80:BE:05 80:D6:05 80:E6:50 80:EA:96 84:29:99 84:38:35 84:78:8B 84:85:06 84:8E:0C 84:B1:53 84:FC:FE 88:1F:A1 88:53:95 88:63:DF 88:C6:63 88:CB:87 8C:00:6D 8C:29:37 8C:2D:AA 8C:58:77 8C:7B:9D 8C:7C:92 8C:FA:BA 90:27:E4 90:3C:92 90:72:40 90:84:0D 90:8D:6C 90:B2:1F 90:B9:31 90:FD:61 94:94:26 94:E9:6A 94:F6:A3 98:03:D8 98:5A:EB 98:B8:E3 98:D6:BB 98:E0:D9 98:F0:AB 98:FE:94 9C:04:EB 9C:20:7B 9C:29:3F 9C:35:EB 9C:F3:87 9C:FC:01 A0:18:28 A0:99:9B A0:ED:CD A4:31:35 A4:5E:60 A4:67:06 A4:B1:97 A4:B8:05 A4:C3:61 A4:D1:D2 A8:20:66 A8:5B:78 A8:66:7F A8:86:DD A8:88:08 A8:8E:24 A8:96:8A A8:BB:CF A8:FA:D8 AC:29:3A AC:3C:0B AC:7F:3E AC:87:A3 AC:BC:32 AC:CF:5C AC:FD:EC B0:34:95 B0:65:BD B0:9F:BA B4:18:D1 B4:F0:AB B8:09:8A B8:17:C2 B8:44:D9 B8:78:2E B8:8D:12 B8:C7:5D B8:E8:56 B8:F6:B1 B8:FF:61 BC:3B:AF BC:4C:C4 BC:52:B7 BC:67:78 BC:6C:21 BC:92:6B C0:1A:DA C0:63:94 C0:84:7A C0:9F:42 C0:CE:CD C0:F2:FB C4:2C:03 C8:1E:E7 C8:2A:14 C8:33:4B C8:69:CD C8:6F:1D C8:85:50 C8:B5:B7 C8:BC:C8 C8:E0:EB C8:F6:50 CC:08:E0 CC:20:E8 CC:29:F5 CC:78:5F CC:C7:60 D0:03:4B D0:23:DB D0:25:98 D0:33:11 D0:4F:7E D0:A6:37 D0:E1:40 D4:9A:20 D4:F4:6F D8:00:4D D8:1D:72 D8:30:62 D8:96:95 D8:9E:3F D8:A2:5E D8:BB:2C D8:CF:9C D8:D1:CB DC:2B:2A DC:2B:61 DC:37:14 DC:86:D8 DC:9B:9C E0:66:78 E0:AC:CB E0:B5:2D E0:B9:BA E0:C9:7A E0:F5:C6 E0:F8:47 E4:25:E7 E4:8B:7F E4:98:D6 E4:C6:3D E4:CE:8F E8:04:0B E8:06:88 E8:80:2E E8:8D:28 EC:35:86 EC:85:2F F0:24:75 F0:99:BF F0:B0:E7 F0:B4:79 F0:C1:F1 F0:CB:A1 F0:D1:A9 F0:DB:E2 F0:DB:F8 F0:DC:E2 F0:F6:1C F4:1B:A1 F4:37:B7 F4:F1:5A F4:F9:51 F8:1E:DF F8:27:93 FC:25:3F FC:E9:98 FC:FC:48 )
array=( 1 2 3 4 5 6 7 8 9 0 a b c d e f )
newmac=\\x${array[$RANDOM%16]}\\x${array[$RANDOM%16]}:\\x${array[$RANDOM%16]}${array[$RANDOM%16]}:\\x${array[$RANDOM%16]}\\x${array[$RANDOM%16]}
vendor=$(echo "${apple[$RANDOM%406]}"|sed 's/:/\\x/g')
echo -e "\x$vendor$newmac" > /persist/wifi/.macaddr
Can be combined with Tasker if you want to randomize it every time Wi-Fi is turned off/on.
*NOTE - this has been tested on KitKat 4.4.4 - not sure if it still works on 5.x

Related

Android OS 2.0.1 for X1 [ Platinum Edition Update 21 February 2010 ]

Hello guys,
i'm back and bring you Platinum Edition (faster, stabile and reliability).
WORKING :
1. touchscreen
2. keyboard
3. button pad
4. radio (GSM)
5. GPRS / 3G
6. microphone
7. charging
8. market
9. wifi
10. idle sleep mode
11. Turn Off LCD
12. Keyboar Slider
13. Phone Shutdown
14. Horizontal view
15. Bluetooth -> as known hardware.
16. GPS -> added pair using gps utility.
17. New Installation Wizard
18. UPSIDE DOWN LCD (at last -> thanks to vdelf your're the man dude) and (scholbert & jerpelea) for the patch (not NATIVE).
19. swapfile ( the most important for running fast )
Not Working :
1. bluetooth
2. camera
3. GPS
4. brightness LCD
[ change log ]
Build 21 February 2010
1. increase memory up to 102 mb
2. adding swapfile 128 mb
3. terminal emulator ready
Download build 21 february 2010
LINK :
http://neosites.org/X1/Android/fatsal/xperoid/fatsal-xperoid-20100221.tar.gz
use previous haret.exe & download STARTUP.TXT <--- a must
MIRROR :
http://www.mediafire.com/?ytywmt20gir
thanks to : X1iser
http://rapidshare.com/files/354113124/fatsal-xperoid-20100221.tar.gz
thanks to : Liebhild
OR COPY PASTE STARTUP.TXT BELOW
Code:
set ramsize 0x8000000
set ramaddr 0x10000000
set mtype 2006
set FBDURINGBOOT 0
# msmts_calib=0xc5.0x399.0x367.0x4d
set KERNEL zImage
set initrd initrd.gz
set cmdline "init=/ console=tty0 mem=102M msmsdcc_id=3 imgdevname=/dev/mmcblk0p1 imgdevnum=1 imgdir=/ msmts_calib=0x0366.0x04b.0x0c8.0x038e fbcon=rotate:2 wifi.mac=00:23:45:37:17:2c lcd.density=240 msmvkeyb_toggle=off pmem.extra=1 no_console_suspend clock-7x00.mddi=0xa51"
boot
Donation
i'm sorry about this, but i have to say...this is my promise to my self, if the screen goes normal i will added my donation here.
support me :
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UAFFXQKKFG4CL
FAQ
1. is it a rom ?
- Nope
2. is it can destroy my WinMo ?
- Nope
3. How to run this things ?
- Just hit haret & pray
4. does it support PIN ?
- Nope. Just disabled it.
5. i can't running run this things, waiting over 30 minutes ?
- Just soft reset it. android loads max 10 minutes
6. so what's wrong ?
- check your SDCARD space, it's take 512 mb, or check the file name or fragment on your SDCARD
7. i can't using my phone ?
- come on, it's previous build.
8. how to turn off the phone ?
- press and hold the end call button.
9. i can't starting wifi ?
- check your SDCARD in the root directory must have filename "calibration"
10. is it ok to use other build system.sqsh ?
- yep, but do not expect running smooth like real build.
11. i've got an error "cannot find system.sqsh or system.img" ?
- are you using different kernel ?
12. i cannot hear any sound when i receive a calling ?
- come on man just give me a break...i'm still working on it.
13. is it camera working ?
- oh no...again ?
14. how big this things ?
- just free up your SD CARD min 512 mb
TRICKS :
i've been make a riset, and found a solution for going faster Xperoid :
1. try decrease application install in folder androidapps
2. using wifi when you we're needed. if not try to turn off.
if you're running this build for the first time, Android looks heavy and slow running, just be patient let android finish all process. and then push the red button on the panel to shutdown (after that softreset of course).
next android will go fast.
---------------------------------------------------------------------------------------------------------------------------------
OLD Version
---------------------------------------------------------------------------------------------------------------------------------
Changes Log
Build 19 February 2010
--------------------------------------------------------
1. Breaking the rules about upside down, not native on the kernel but patch on android driver.
2. clean build eclair which good for tweaking (thanks to : jerpelea)
This build is dedicated for Kovsky, if your using other build i'm not sure will working with this build esspecially wifi.
please do not expect too much from this build, all i working on it is the best i can do.
How to update kernel
download latest kernel from Download Kernel Build part and rename to zImage. and then copy zImage into sdcard if already exists kernel replace it. (backup your old kernel, is good. in case something happen you don't want it ).
example :
zImage-build20100126 -> zImage
How to running this thing :
1. hit "haret", and then your screen will show a millions text after that you will see an boot animation.
2. just wait 5 - 10 minutes. (to long for waiting)
3. after you will see setup wizard appear.
4. if got some error message pop up just hit "wait"
Download Link :
Build 19 February 2010
1. http://www.xperoid.com/downloads/xperoid-builds/14-xperoid-2-0
2. http://neosites.org/X1/Android/fatsal/xperoid/fatsal-XPEroid-20100219.tar.gz
if doesn't work, right click "save as..."
thanks to seth for the space
3. http://files2.loginworks.com/fatsal-XPEroid-20100219.tar.gz // --> down for temporary
thanks to dheerajjuneja for the mirror
4. http://rapidshare.com/files/352784582/fatsal-XPEroid-20100219.tar.gz
thanks to Liebhild
OLD Version Download
http://neosites.org/X1/Android/fatsal/XPEroid-2.0.1_build-20100123.7z
thanks to Muo for the hosting files...
http://rapidshare.com/files/333818061/X1_eclair.7z
http://www.mediafire.com/file/nrbwmhizn3d/X1_eclair.7z
thanks to locomarco for the mirror...
http://rapidshare.com/files/340293817/XPEroid-2.0.1_build-20100123.7z.html - thanks to Reversedhex
http://www.megaupload.com/?d=9AOJYXZ9 - thanks to patt2k
Download Kernel Build :
http://neosites.org/X1/Android/fatsal/zImage-build20100126
All Version Download
http://neosites.org/X1/Android/
thanks to Muo for the mirror files...
Wallpaper from locomarco :
http://forum.xda-developers.com/showpost.php?p=5264026&postcount=41
The ART OF UBUNTU 8.04
http://forum.xda-developers.com/showpost.php?p=5548627&postcount=399
Thanks to :
1. dcordes
2. AIV
3. vdelf
4. scholbert
5. sp3dev
6. stachi01
7. locomarco
8. all of you guys...
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Android 1.6 :
http://forum.xda-developers.com/showpost.php?p=5183104&postcount=203
Download the files :
http://www.pinandita.com/downloads/X1_andoidOS.tar.gz
how to build a working kernel for kovsky :
step 1 :
prepared compiling environment :
1. ubuntu karmic (good step) or *nix OS
2. for ubuntu user :
2.a. apt-get install git-core build-essential libncurses-dev
3. mkdir /home/<username>/kovsky-dev
4. Download the source :
4.a. cd /home/<username>/kovsky-dev
4.b. git clone git://git.linuxtogo.org/home/groups/mobile-linux/kernel.git <--- old version
4.b. git clone git://gitorious.org/~fatsal/linux-on-qualcomm-s-msm/linux-msm-kovsky.git <--- new onces
4.c. cd kernel
4.d. git checkout -b htc-msm-2.6.27 origin/htc-msm-2.6.27
5. Download and decompress the arm toolchain (64mb)
5.a. cd /home/<username>/kovsky-dev
5.b. wget http://www.codesourcery.com/gnu_too...-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 -O arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
5.c. tar xjf arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
6. Generate the default .config for the kernel(ARCH is case sensitive)
6.a. cd /home/<username>/kovsky-dev/kernel
6.b. make htckovsky_defconfig ARCH=arm
6.c. pico .config
7. Let's tweak kernel
7.a. pico .config
-----------------------------------------------------------------------
A MUST CHANGES IN KERNEL CONFIG
-----------------------------------------------------------------------
UNCOMMENT CONFIG BELOW :
# CONFIG_FB_MSM_REFRESH is not set -> CONFIG_FB_MSM_REFRESH=y
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set -> CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y (use for fbcon:2 in our startup.txt)
IMPORTANT FOR WIFI :
# CONFIG_CFG80211 is not set --> CONFIG_CFG80211=m (this is for our wifi module)
# CONFIG_WIRELESS_EXT is not set --> CONFIG_WIRELESS_EXT=y
# CONFIG_WIRELESS_EXT_SYSFS is not set --> CONFIG_WIRELESS_EXT_SYSFS=y
# CONFIG_MAC80211 is not set --> CONFIG_MAC80211=m
# CONFIG_IEEE80211 is not set --> CONFIG_IEEE80211=y
# CONFIG_IEEE80211_DEBUG is not set --> CONFIG_IEEE80211_DEBUG=y
# CONFIG_IEEE80211_CRYPT_WEP is not set --> CONFIG_IEEE80211_CRYPT_WEP=y
# CONFIG_IEEE80211_CRYPT_CCMP is not set --> CONFIG_IEEE80211_CRYPT_CCMP=y
# CONFIG_IEEE80211_CRYPT_TKIP is not set --> CONFIG_IEEE80211_CRYPT_TKIP=y
FOR QUICK BOOTING :
# CONFIG_HTC_FB_CONSOLE is not set --> CONFIG_HTC_FB_CONSOLE=y
# CONFIG_HTC_FB_CONSOLE_BOOT is not set --> CONFIG_HTC_FB_CONSOLE=y
FILE SYSTEM SUPPORT FOR OUR KERNEL :
# CONFIG_CRAMFS is not set --> CONFIG_CRAMFS=y
# CONFIG_SQUASHFS is not set --> CONFIG_SQUASHFS=y this is for supporting system.sqsh (squash, for android 2.0.1 ONLY support squash FS)
ADD THIS IN OUR CONFIG
CONFIG_SQUASHFS_EMBEDDED=y
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
ADD THIS ON YOUR CONFIG :
CONFIG_RTC_DRV_MSM7X01A=y --> This is for getting update date in our kernel. thanks to vdelf for the patch it's cool man.
notes :
if the compiler ask some this just answer with Y or follow the compiler default answer.
8. Compile
8.a. cd /home/<username>/kovsky-dev/kernel
8.b. export PATH=/home/<username>/kovsky-dev/arm-2008q1/bin:$PATH
8.c. make zImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
9. Play and have fun!!! Now you can copy the compressed kernel image to your blackstone
cp /home/<username>/kovsky-dev/kernel/arch/arm/boot/zImage /wherever your boot files are stored
references :
http://wiki.xda-developers.com/index.php?pagename=Kovsky Linux
LET'S MAKE WIFI WL1251 WORKING :
1. LET SETUP ENVIRONMENT :
1.a. mkdir /home/<username>/kovsky-wifi
1.b. cd /home/<username/kovsky-wifi
1.c. git clone git://gitorious.org/linux-on-qualcomm-s-msm/compat-wireless-msm.git
1.d. cd compat-wireless-msm
2. LET SETUP BUILDER :
2.a. sudo chmod -R 755 builder.sh
2.b. pico builder.sh
2.c. changes KERNEL_PATH=/home/<username>/kovsky-dev/kernel
2.d. ./builder.sh
2.e. cd mods/
2.f. you must see our wifi modules (horeee....we've got working wifi for our xperia).
reserved
CALLING KOVSKY DEVELOPER
Hi Guys,
lets unite for build android working perfect on kovsky.
i already create repo on gitorious :
Clone kernel :
git clone git://gitorious.org/~fatsal/linux-on-qualcomm-s-msm/linux-msm-kovsky.git
if anyone want to join with me, PM me your ssh-rsa of your PC. and i will added into my repo.
thanks,
Fatsal
reserved for me...for next info
How To Use XPEROID
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Details :
Button 1 : Menu
Button 2 : Accept Calls
Button 3 : Menu
Button 4 : Back
Button 5 : [press] End Calls
[hold] Shutdown The Phone
Revolutionary..!
So all android apps works you say?
Login says Pin Incorrect ? its my right Pin (card pin)
try disabling PIN in Settings first and then start Linux again, thats known problem
can enter pin
Hi, I'm om T-Mobile NL and after android is booted and I try to enter my pin it does not recognise it. Did not try to enter PUK from android, did that from WinMo.
Any ideas on whats going on here?
Edit: I had the page open too long I guess, answer above was given before I saw it... Thanks for the tip.
good to see a single post's been opened in this section. now keep working up man, you did a great job.
BTW: there is a file named startup.txt in root folder, it contains some expresstion and parameters. has it got some thing to do for individual devices?
y is everything upside down...
circleofomega said:
y is everything upside down...
Click to expand...
Click to collapse
YUP for now...soon will be...
Wow, that is very nice! How's the performance? Too bad we don't have capacitive touch.
I've not messed with Android much, but it'll be nice to have a direct means of syncing Outlook stuff without using 3rd party software or pushing stuff to Google, and then back to the phone.
fatsal said:
YUP for now...soon will be...
Click to expand...
Click to collapse
Are you near a breaktrough or somethin?
Wow! That sir is amazing!!! Please keep up the good work, I for one would surely use it once the remaining bugs have been ironed out
all xperia screen is installed upside down thats why its upside down its hardware.
Yes I know that, but I was wondering if fatsal has found some kind of software fix to rotate the screen.
Can't wait for the day that I can ditch wm and move on to android! Good work =D
Nice progress, especially the new 2.0.1 version. Making receiving a call is not a problem using the slide to answer/reject as well as hardware send and end buttons. GPRS/HSPA data works nice on Rogers network in Canada too. WiFi works as well (tested on WPA2 network).
However the thing feels like lacking memory BIG time. Looks like it constantly swaps to mem card. If you get more than one app running, things get really slow. Slow to a point you can't do anything anymore. X1 has a not bad amount of RAM, wondering if OS can run from RAM somehow..
Fantastic work fatsal. Thanks for the info on building a kernel!
being waiting for such a long time for this! thanks chef! really a hard work! happy new year!

[Q] Nexus one and serial port

Hi,
First, I am new as a poster on this forum, but I read it often for info (specially on CM 6 & 7) !
(And second "first" thing, sorry for my bad English, French is not a good situation for that !)
As an engineer student, I am very interested by two things : Android and µC !
So why not combine them !
So I would like to communicate via the USB/Serial port of my N1 (CM7, Build 33) with µControler (in this case Cortex M3 on mbed plateform or arduino like).
So after some research, I found a few informations and condition for that :
- rooted (no problem for that)
- Serial enable Kernel (no info for the CM7 Kernel...if someone know !)
- Chmod the Serial port (possibly the ttyMSM0 ?)
- Something to control the port !
I decided to use this combo :
SL4A + Python (module for SL4A)
And wrote this piece of code to test :
Code:
import android
import os
import serial
import time
droid = android.Android()
try:
arduino = serial.Serial('/dev/ttyMSM0', 9600)
except:
print "Failed to connect on /dev/ttyttyMSM0"
a = 0
while (a < 10):
arduino.write('e')
os.system("echo 'a' > /dev/ttyMSM0")
a = a + 1
print "ok"
time.sleep(2)
But it doesn't work !
The "arduino" object did not exist, because he cant access the port (and I don't know why !)
The line
Code:
os.system("echo 'a' > /dev/ttyMSM0")
was just something like that, without real hope !
All ideas are welcome ! everything !
Thanks,
Pacemk

[Guide] How to compile stock LG2X kernel from scratch

For some weeks I've been trying to set up an environment in which I'm able to compile the stock kernel for my LG2X on my own. Following various tips and hints were unsuccessful and several restarts were required until a kernel which was compiled on my own box was running on my phone. Since I had to patch together all the information because there was no complete guide available/findable, I'd like to list here all the steps from the beginning which I had to perform to boot my own compiled kernel. Maybe this is also useful for others. Note: again, this approach is for compiling STOCK kernel sources which are based on the public sources from LG. (The build process for CM is different and cannot be applied to stock kernels)
I began with a freshly installed Ubuntu 11.10 32bit (http://www.ubuntu.com/download/ubuntu/download) running in a VMware virtual machine. In it I entered a shell and switched to root to be able to perform the required actions:
Code:
sudo su -
The next step was to add the package-sources for the cross-compiler toolchain (see next step) and to bring the system up to the latest state.
Code:
add-apt-repository ppa:linaro-maintainers/toolchain
apt-get update
apt-get upgrade
This takes some time but after it's finished I installed the cross-compiler toolchain to be able to compile applications for the LGs ARM platform
Code:
apt-get install gcc-linaro
apt-get install gcc-linaro-arm-linux-gnueabi
After this I've been ready to begin with the source-works. I closed the root-shell and opened up a new one (required to make sure that all paths are correctly set and recognized again). Test it by executing
Code:
arm-linux-gnueabi-gcc --version
When this executed without error I started with downloading the sources for version 20q from http://www.lg.com/global/support/opensource/opensource-detail.jsp?detailCustomerModelCode=LGP990 into a new directory.
When the file 'LGP990_Android_Gingerbread_V20Q.zip' had finished downloading I unzipped the complete package by
Code:
unzip LGP990_Android_Gingerbread_V20Q.zip
resulting in three files. A README, one .tar.gz with the ROM sources and finally one .tar.gz with the kernel sources. To unpack the kernel sources I issued
Code:
tar xvzf P990_Stardop_IFX_GingerBread_V20Q_KERNEL.tar.gz
and the complete LG 20q kernel sources were finally located in a new 'kernel' subdirectory.
The kernel sources themselves are not yet ready to be compiled. This is because LG most probably has a different/special build environment and our standard environment produces errors and unbootable kernels. Some patching is required to succeed to a running kernel.
Firstly the compilation options for the wireless module have to be tweaked as the default settings break compilation at some unused variables in the source. This is set to be just treated as warnings for the wireless-module by applying following patch:
Code:
diff -u -r original/kernel/drivers/net/wireless/bcm4329/Makefile kernel/drivers/net/wireless/bcm4329/Makefile
--- original/kernel/drivers/net/wireless/bcm4329/Makefile 2012-01-31 04:36:22.000000000 -0800
+++ kernel/drivers/net/wireless/bcm4329/Makefile 2012-02-14 11:41:59.972467559 -0800
@@ -53,7 +53,7 @@
-DBCMLXSDMMC \
-DBCMPLATFORM_BUS \
-DSDIO_ISR_THREAD \
- -Wall -Wstrict-prototypes -Werror \
+ -Wall -Wstrict-prototypes -Werror -Wno-unused-but-set-variable -Wno-array-bounds \
-I$(SRCROOT) \
-I$(SRCROOT)/include \
-I$(SRCROOT)/shared \
Also the main Makefile requires tuning to contain the proper compilation options to produce code which correctly runs on the phone (thanks to spica1234 for providing me with the correct options).
Code:
diff -u -r original/kernel/Makefile kernel/Makefile
--- original/kernel/Makefile 2012-01-31 04:36:21.000000000 -0800
+++ kernel/Makefile 2012-02-28 13:21:20.038003539 -0800
@@ -323,12 +323,12 @@
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
-Wbitwise -Wno-return-void $(CF)
-MODFLAGS = -DMODULE
-CFLAGS_MODULE = $(MODFLAGS)
+MODFLAGS = -DMODULE -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a9 -march=armv7-a -fno-common -fsingle-precision-constant -fno-gcse -funsafe-math-optimizations -ffinite-math-only -fgcse-las -fgcse-sm -fivopts -fbtr-bb-exclusive -fvect-cost-model -fmodulo-sched -fmodulo-sched-allow-regmoves
+CFLAGS_MODULE = $(MODFLAGS)
AFLAGS_MODULE = $(MODFLAGS)
LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds
-CFLAGS_KERNEL =
-AFLAGS_KERNEL =
+CFLAGS_KERNEL = -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a9 -march=armv7-a -fno-common -fsingle-precision-constant -fno-gcse -funsafe-math-optimizations -ffinite-math-only -fgcse-las -fgcse-sm -fivopts -fbtr-bb-exclusive -fvect-cost-model -fmodulo-sched -fmodulo-sched-allow-regmoves
+AFLAGS_KERNEL = -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a9 -march=armv7-a -fno-common -fsingle-precision-constant -fno-gcse -funsafe-math-optimizations -ffinite-math-only -fgcse-las -fgcse-sm -fivopts -fbtr-bb-exclusive -fvect-cost-model -fmodulo-sched -fmodulo-sched-allow-regmoves
CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
# 20100705, [email protected],[LGE_START]
@@ -544,7 +544,8 @@
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os
else
-KBUILD_CFLAGS += -O2
+KBUILD_CFLAGS += -Ofast
+KBUILD_CFLAGS += $(call cc-option, -Wno-unused-but-set-variable)
endif
We're not finished yet. We've to create the correct kernel configuration and (again) apply some patches. I'm not so sure about these changes but the kernel refused to boot on my phone without them. It is again provided by spica1234 and contains a number of changes. I did not research which of these changes allowed to boot since most of them are generally useful and I didn't do the work trying them out one-by-one.
Code:
make ARCH=arm star_ifx_defconfig
Code:
--- .config.orig 2012-02-28 13:22:09.322001449 -0800
+++ .config.spica_working 2012-03-02 08:41:21.757696988 -0800
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.32.9-HP_2X_Xtreme_RC12-RevOTF
-# Tue Feb 28 13:22:09 2012
+# Tue Feb 28 13:24:15 2012
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -56,16 +56,16 @@
CONFIG_LOG_BUF_SHIFT=18
CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
-# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_RT_GROUP_SCHED=y
# CONFIG_USER_SCHED is not set
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
# CONFIG_CGROUP_NS is not set
-CONFIG_CGROUP_FREEZER=y
-CONFIG_CGROUP_DEVICE=y
+# CONFIG_CGROUP_FREEZER is not set
+# CONFIG_CGROUP_DEVICE is not set
# CONFIG_CPUSETS is not set
-CONFIG_CGROUP_CPUACCT=y
+# CONFIG_CGROUP_CPUACCT is not set
# CONFIG_RESOURCE_COUNTERS is not set
# CONFIG_SYSFS_DEPRECATED_V2 is not set
CONFIG_RELAY=y
@@ -121,7 +121,8 @@
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
-# CONFIG_SLOW_WORK is not set
+CONFIG_SLOW_WORK=y
+# CONFIG_SLOW_WORK_DEBUG is not set
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
@@ -146,10 +147,10 @@
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_DEFAULT_AS is not set
-# CONFIG_DEFAULT_DEADLINE is not set
-CONFIG_DEFAULT_CFQ=y
+CONFIG_DEFAULT_DEADLINE=y
+# CONFIG_DEFAULT_CFQ is not set
# CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="cfq"
+CONFIG_DEFAULT_IOSCHED="deadline"
CONFIG_FREEZER=y
#
@@ -1676,16 +1677,25 @@
# File systems
#
CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
-# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT2_FS_XATTR=y
+# CONFIG_EXT2_FS_POSIX_ACL is not set
+# CONFIG_EXT2_FS_SECURITY is not set
+CONFIG_EXT2_FS_XIP=y
CONFIG_EXT3_FS=y
CONFIG_EXT3_DEFAULTS_TO_ORDERED=y
CONFIG_EXT3_FS_XATTR=y
# CONFIG_EXT3_FS_POSIX_ACL is not set
# CONFIG_EXT3_FS_SECURITY is not set
-# CONFIG_EXT4_FS is not set
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_FS_XATTR=y
+# CONFIG_EXT4_FS_POSIX_ACL is not set
+# CONFIG_EXT4_FS_SECURITY is not set
+# CONFIG_EXT4_DEBUG is not set
+CONFIG_FS_XIP=y
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=y
+# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
@@ -1769,7 +1779,22 @@
# CONFIG_ROMFS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
-# CONFIG_NETWORK_FILESYSTEMS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_UPCALL is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_DFS_UPCALL is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
#
# Partition Types
After these patches, were finally ready to compile the kernel
Code:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- STAR_TMUS_REV=TMUS_10 TARGET_STAR_HWREV=TMUS_E TARGET_MODEM=ifx
Now go grab some coffee. This takes a while. When it's finished, the compressed kernel-image is found in
arch/arm/boot/zImage
For the experienced kernel-hackers this might be enough. It wasn't for me and I wanted to have it easily installable like other kernels from the forum. So I downloaded a kernel zip package, eg. the one from spica1234 at http://forum.xda-developers.com/showpost.php?p=18253696&postcount=1
Any version will do as long as the kernel is contained in a .zip archive and installable via CWM. In my case I downloaded the kernel zip in a new directory 'build' and unpacked it.
Code:
unzip HP_2x_RC12-RevOTF-PRO.zip
This creates the subdirectories 'data', 'kernel', 'META-INF' and 'system'. Here we now have to replace the kernel and the kernel-modules with our self-compiled versions.
Code:
cd ~build/kernel
rm zImage
cp ~kernel/arch/arm/bootzImage ./zImage
cd ../system/lib/modules
rm *.ko
find ~kernel/ -name "*.ko" -exec cp '{}' . \;
cd ../../..
One last step, creating the zip which carries the new kernel:
Code:
zip -r -FS new_kernel.zip data/ kernel/ META-INF/ system/
This new_kernel.zip can now be flashed with CWM and should boot without problems.
For easier usage, I've attached the three patched files in the build_set.zip attachment so you don't have to patch the stock files by hand. Just extract it in the kernel directory and overwrite the existing files.
I hope I did not make any error in the compilation of this information and that it can be helpful for the interested reader.
Thanks goes especially to spica1234 and the material which he provided me to come through to a successful boot.
Very good explanation. I wish such useful info available b4 an year for me while i published 1st kernel at samdroid for my older device
Sent from my LG-P990 using Tapatalk
Bloody hell! I never realised it took so much to simply compile!!!! (I build JEE systems at work, but we scripted most of it, stuff that used to take a day and half now takes a few minutes).
Excellent guide Kosi! I'm a linux and kernel n00b and I understand your instructions pretty well.
Ubuntu 11 is not the best choice though I currently use it myself. v11 can cause problems, especially when not compiling kernels but compiling Android ROMs.
Ubuntu 10 is the better choice.
Also there is a VMware Android Developer Environment available for download, providing nearly all the necessary tools for compilation preinstalled and set-up.
http://forum.xda-developers.com/showthread.php?t=1386918
You can compile your kernel directly in the virtual machine p.ex. on your Windows 7 PC. That's the way I do it for my kernel. VMware Player is available for free, so you can just run the image.
Also install VMware tools, so you can set up a directory for exchanging files between your Windows Host and the virtual Machine Ubuntu. In this directory I usually paste the compiled kernel for further use under Win7 (making the CWM update ZIPs).
Just note that you should have a dual/quadcore CPU strong enough to host the linux and compile the kernel in an acceptable time (usually it takes me 1-2 minutes for complete kernel compilation under virtual machine ubuntu using -j24 option on make).
Can u guys add a bit in this tutorial, example, at which file / folder need to edit for OCUV, add swap function, enable ext4, etc.. seriously like this thread..
Sent from my LG-P990 using XDA
ghadap said:
Can u guys add a bit in this tutorial, example, at which file / folder need to edit for OCUV, add swap function, enable ext4, etc.. seriously like this thread..
Click to expand...
Click to collapse
As the topic of this thread is just how to get the stock kernel compiling I won't step into modifying it. Please open a separate thread for that.
Small hints though, OCUV requires deeper code changes, swap and ext4 can just be enabled in the kernel config.
Hey,
I follow the guide, but ubuntu (11.04 64 bit) doesn't find the pack
Code:
apt-get install gcc-linaro
so I can't install the pack
Code:
apt-get install gcc-linaro-arm-linux-gnueabi
Edit: With Ubuntu 11.10, it works.
Has anyone compiled and booted a kernel successfully with this guide? Can't get mine to boot, so before I look any further I'd thought I'd check if anyone else has gotten a workable kernel out of it.
TrymHansen said:
Has anyone compiled and booted a kernel successfully with this guide? Can't get mine to boot, so before I look any further I'd thought I'd check if anyone else has gotten a workable kernel out of it.
Click to expand...
Click to collapse
Which version it shows "arm-linux-gnueabi-gcc --version"
If its 4.6.2?
Sent from my LG-P990 using Tapatalk
Stefan Gündhör said:
Ubuntu 11 is not the best choice though I currently use it myself. v11 can cause problems, especially when not compiling kernels but compiling Android ROMs.
Ubuntu 10 is the better choice.
Also there is a VMware Android Developer Environment available for download, providing nearly all the necessary tools for compilation preinstalled and set-up.
http://forum.xda-developers.com/showthread.php?t=1386918
You can compile your kernel directly in the virtual machine p.ex. on your Windows 7 PC. That's the way I do it for my kernel. VMware Player is available for free, so you can just run the image.
Also install VMware tools, so you can set up a directory for exchanging files between your Windows Host and the virtual Machine Ubuntu. In this directory I usually paste the compiled kernel for further use under Win7 (making the CWM update ZIPs).
Just note that you should have a dual/quadcore CPU strong enough to host the linux and compile the kernel in an acceptable time (usually it takes me 1-2 minutes for complete kernel compilation under virtual machine ubuntu using -j24 option on make).
Click to expand...
Click to collapse
Ubuntu 11.xx is still a good choise if you want to build ROMs it is very easy to set it up (it is just one step more then on 10.xx)
i also use ubuntu 11.10 and it is working fine for me with building android ROMs
and of course it can take 1-2 minutes but it also can take up to an hour for a kernel to compile
it all depends on how good your computer is
on my home computer i build a kernel in a matter of seconds (clobber builds)
but when i am at my girlfriend my build (also clobber) on her craptop will take up to 20 minutes
nice guide kosi2801!
spica1234 said:
Which version it shows "arm-linux-gnueabi-gcc --version"
If its 4.6.2?
Click to expand...
Click to collapse
Yap. This
Code:
arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.6.2-14ubuntu2~ppa1) 4.6.2
to be specific.
Trymhanson, Try to downgrade with 4.5.3. 4.6.2 is causing this unable to boot issue which was not happening earlier with 4.6.1
try this
apt-get install gcc-4.5-arm-linux-gnueabi
apt-get install g++-4.5-arm-linux-gnueabi
rm /usr/bin/arm-linux-gnueabi-gcc
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.5 /usr/bin/arm-linux-gnueabi-gcc
Thanks, that did it. I also had to change the -Ofast flag back to -O2 as -Ofast wasn't recognized by the 4.5.3 version. So now I'm thinking maybe the -Ofast flag was to blame, so I'll try a fresh 4.6.2 install with -O2. Thanks again.
TrymHansen said:
Thanks, that did it. I also had to change the -Ofast flag back to -O2 as -Ofast wasn't recognized by the 4.5.3 version. So now I'm thinking maybe the -Ofast flag was to blame, so I'll try a fresh 4.6.2 install with -O2. Thanks again.
Click to expand...
Click to collapse
no may be ofast is not to blame but 4.6.2. Ofast was introduced with 4.6.0 and doesnt work with < 4..6. 4.6.2 doesnt even work with o2. And IMHO kernel compiled with 4.5.3 ismore stable
Sent from my LG-P990 using Tapatalk
http://db.tt/jN4fU9Vz
Thisis my recent sr3r2 patch created against original v20Q sourceswith Full OTF V2.0. Anybody interested can use it. It will transform to fully noo oc version of SR3r2
It wont work with CM but only stock v20q
Sent from my LG-P990 using Tapatalk
For anyone interested, currently I'm building with
arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.6.1-7ubuntu2) 4.6.1
For my usage patterns the kernel works pretty well, but YMMV.
Thanks spica for the updated patch!
kosi2801 said:
For anyone interested, currently I'm building with
arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.6.1-7ubuntu2) 4.6.1
For my usage patterns the kernel works pretty well, but YMMV.
Thanks spica for the updated patch!
Click to expand...
Click to collapse
Use my recent cflags its most stable and used in sr3r2
As you are using gnueabihf relace mfloat-abi=softfp with mfloat-abi=hard
Sent from my LG-P990 using xda premium
spica1234 said:
Use my recent cflags its most stable and used in sr3r2
As you are using gnueabihf relace mfloat-abi=softfp with mfloat-abi=hard
Click to expand...
Click to collapse
Thanks for the tip. I already thought about that some time ago but forgot again. Gained some additional performance points
Can someone upload a compiled stock v20q kernel flashable zip? Thanks!

DeskCast + VB.NET Source

this is a little project I have been working on to cast videos from my desktop pc with hard drives mapped from my server
it works much like fling did but built with vb.net not java
you will need .Net Framework 4.6.1 installed to run or compile this application
the VB source was built Visual Studio 2013
the C# source was built Visual Studio 2017
if you have multiple network adapters this might not work for you as it might not resolve your local ip address correctly
ffmpeg is used to transcode videos that are not mp4, when transcoding you cannot seek/select play position
when streaming from harddrive mp4 files should have the ability to seek/select play position
you can drag and drop video files onto application to play them(like Fling)
it also has the option to play files from urls
it should be pretty simple to use for you
just open the program and it should find chromecasts on the network then select the chromecast you want to cast to then click "Connect CC" then drag and drop video onto it and it should start playing
it should work for rooted and non rooted chromecasts
when using a rooted chromecast the receiver is hosted by DeskCast its self
when using a non rooted chromecast the receiver is one of the apps in the google whitelist
the receiver files deskcast sends to the rooted chromecast are in the "data" folder of the application, so you can edit these too
I did play with the idea of the chromecast its self hosting the receiver files but the www folder in the chromecast is locked/read only so that might be something for team eureka to add to the webpanel they have
this works for me very well, but I cant say that it will work for you at all
im really only posting the source so other people can use it for information or ideas to make something better than I ever could
I hope this is useful to someone
VB .NET Source
https://github.com/stooged/DeskCast
C# Source
https://github.com/stooged/DeskCastC
stooged said:
this is a little project I have been working on to cast videos from my desktop pc with hard drives mapped from my server
it works much like fling did but built with vb.net not java
you will need .Net Framework 4.5 installed to run or compile this application
it was built Visual Studio 2012 so you will need that to compile it
if you have multiple network adapters this wont work for you as it wont resolve your local ip address
ffmpeg is used to transcode videos that are not mp4, when transcoding you cannot seek/select play position
when streaming from harddrive mp4 files should have the ability to seek/select play position
you can drag and drop video files onto application to play them(like Fling)
it also has the option to play files from urls
it should be pretty simple to use for you
just open the program and it should find chromecasts on the network then select the chromecast you want to cast to then click "Connect CC" then drag and drop video onto it and it should start playing
it should work for rooted and non rooted chromecasts
when using a rooted chromecast the receiver is hosted by DeskCast its self
when using a non rooted chromecast the receiver is one of the apps in the google whitelist
the receiver files deskcast sends to the rooted chromecast are in the "data" folder of the application, so you can edit these too
I did play with the idea of the chromecast its self hosting the receiver files but the www folder in the chromecast is locked/read only so that might be something for team eureka to add to the webpanel they have
this works for me very well, but I cant say that it will work for you at all
im really only posting the source so other people can use it for information or ideas to make something better than I ever could
I hope this is useful to someone
Click to expand...
Click to collapse
You can start your own webserver if you like. You got one built into /bin/busybox
in shell you can start it with:
/bin/busybox httpd -p 8000 -h /data/www -c /data/httpd.conf
httpd.conf contains:
A:*
/cgi-bin:a:a
echo "It's working!" > /data/www/index.html
open <chromecastip>:8000 and you got your self a webserver =)
if it not working, try a newer busybox binary, the one in /bin is a bit old.
I've been looking a way to use CC as a host for casting so this was fun to see =)
Mape0661 said:
You can start your own webserver if you like. You got one built into /bin/busybox
in shell you can start it with:
/bin/busybox httpd -p 8000 -h /data/www -c /data/httpd.conf
httpd.conf contains:
A:*
/cgi-bin:a:a
echo "It's working!" > /data/www/index.html
open <chromecastip>:8000 and you got your self a webserver =)
if it not working, try a newer busybox binary, the one in /bin is a bit old.
I've been looking a way to use CC as a host for casting so this was fun to see =)
Click to expand...
Click to collapse
yeah I did try that with a new busybox binary installed to the chromecast
the webserver worked and the receiver files were hosted by the chromecast in the /data/www folder but the receiver wouldn't allow a connection to the websocket
I think it had issues with the domain/ip being the same as the chromecast
it might be something that can be changed in the rom by team eureka.
the idea of a whitelist and a receiver being on the chromecast its self might make it possible to use offline when streaming media from your pc or tablet, Netflix and hulu and apps like that we know wont work offline
I guess I will just keep playing around with it to see if I can get it to work
stooged said:
yeah I did try that with a new busybox binary installed to the chromecast
the webserver worked and the receiver files were hosted by the chromecast in the /data/www folder but the receiver wouldn't allow a connection to the websocket
I think it had issues with the domain/ip being the same as the chromecast
it might be something that can be changed in the rom by team eureka.
the idea of a whitelist and a receiver being on the chromecast its self might make it possible to use offline when streaming media from your pc or tablet, Netflix and hulu and apps like that we know wont work offline
I guess I will just keep playing around with it to see if I can get it to work
Click to expand...
Click to collapse
I was experimenting with this few weeks ago, I installed Google CastVideo from github
https://github.com/googlecast/CastVideos-chrome
Got a page working, hosted by chromecast, but I was never able to remove the DEMO text all over the videos. But it worked nicely to stream mp4 files from a samba share.
I travel a lot and my plan was/is to use a travel router and mount a samba share to my linux server with ssh
something like this on chromecast
ssh -C -f -N -p 22 -L 440:127.0.0.1:445 <username>@<serveradress>
sudo mount -t cifs //127.0.0.1/<share> <mountpoint> -o port=440,user="<user>",password="<password>"
you need a new dropbearmulti, got a working one (armv61) from
http://landley.net/aboriginal/downloads/binaries/extras/
Did you try with lighttpd?
-----------------------------------
cp /system/etc/httpd.conf /data (change port and webroot in httpd.conf, 3000 and /data/www worked for me)
mkdir /data/www
lighttpd -m /system/usr/lib -f /data/httpd.conf
Mape0661 said:
Did you try with lighttpd?
-----------------------------------
cp /system/etc/httpd.conf /data (change port and webroot in httpd.conf, 3000 and /data/www worked for me)
mkdir /data/www
lighttpd -m /system/usr/lib -f /data/httpd.conf
Click to expand...
Click to collapse
no I just tried busybox httpd
but I will give lighttpd a go
I did find one way to make the chromecast host the receiver or any html content
in the post to the chromecast to loadup the receiver if you use the data uri scheme for the post data you can make the chromecast launch html
so as the url for the receiver you can use something like data:text/html;base64,html_encoded_in_base64
I did a test with the receiver.html file from the Fling source and it worked fine
here is a php script that should allow you to play a mp4 file on the chromecast using this method with a single post
Code:
<?php
$ChromeCastIP = "192.168.1.102";
$ChromeCastApp = "Fling";
$VideoURL = "://commondatastorage.googleapis.com/gtv-videos-bucket/big_buck_bunny_1080p.mp4";
$htmldata = base64_encode("
<html>
<head>
<title></title>
</head>
<body bgcolor=#000000 topmargin=0 leftmargin=0 bottommargin=0 rightmargin=0 marginwidth=0 marginheight=0>
<video width='100%' height='100%' autoplay>
<source src='http$VideoURL' type='video/mp4'>
</video>
</body>
</html>
");
$postdata = "data:text/html;base64,$htmldata";
$fp = fsockopen($ChromeCastIP, 8008, $errno, $errstr, 30);
$out = "POST /apps/$ChromeCastApp/ HTTP/1.1\r\n";
$out .= "Accept-Language: en-us\r\n";
$out .= "Accept: */*\r\n";
$out .= "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36\r\n";
$out .= "Host: $ChromeCastIP:8008\r\n";
$out .= "Content-Type: application/x-www-form-urlencoded\r\n";
$out .= "Origin: chrome-extension://boadgeojelhgndaghljhdicfkmllpafd\r\n";
$out .= "Content-Length: ".strlen($postdata)."\r\n";
$out .= "Connection: Close\r\n\r\n$postdata";
fwrite($fp, $out);
sleep(2);
fclose($fp);
?>
stooged said:
I did find one way to make the chromecast host the receiver or any html content
in the post to the chromecast to loadup the receiver if you use the data uri scheme for the post data you can make the chromecast launch html
so as the url for the receiver you can use something like data:text/html;base64,html_encoded_in_base64
I did a test with the receiver.html file from the Fling source and it worked fine
here is a php script that should allow you to play a mp4 file on the chromecast using this method with a single post
Code:
<?php
$ChromeCastIP = "192.168.1.102";
$ChromeCastApp = "Fling";
$VideoURL = "://commondatastorage.googleapis.com/gtv-videos-bucket/big_buck_bunny_1080p.mp4";
$htmldata = base64_encode("
<html>
<head>
<title></title>
</head>
<body bgcolor=#000000 topmargin=0 leftmargin=0 bottommargin=0 rightmargin=0 marginwidth=0 marginheight=0>
<video width='100%' height='100%' autoplay>
<source src='http$VideoURL' type='video/mp4'>
</video>
</body>
</html>
");
$postdata = "data:text/html;base64,$htmldata";
$fp = fsockopen($ChromeCastIP, 8008, $errno, $errstr, 30);
$out = "POST /apps/$ChromeCastApp/ HTTP/1.1\r\n";
$out .= "Accept-Language: en-us\r\n";
$out .= "Accept: */*\r\n";
$out .= "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36\r\n";
$out .= "Host: $ChromeCastIP:8008\r\n";
$out .= "Content-Type: application/x-www-form-urlencoded\r\n";
$out .= "Origin: chrome-extension://boadgeojelhgndaghljhdicfkmllpafd\r\n";
$out .= "Content-Length: ".strlen($postdata)."\r\n";
$out .= "Connection: Close\r\n\r\n$postdata";
fwrite($fp, $out);
sleep(2);
fclose($fp);
?>
Click to expand...
Click to collapse
Got it working =), Very cool.
I tryed to make php work on Chromecast. At the moment I only got a test page working with some old php binaries. But the php-cli are working fine!
Can you host this in github? I'd like to contribute to this project
Giswald said:
Can you host this in github? I'd like to contribute to this project
Click to expand...
Click to collapse
I have never used github before but I think this worked
https://github.com/stooged/DeskCast
What's the main difference between the chrome extension "VideoStream for Google Chromecast" ?
Seems it can do the same job.
lancillotto said:
What's the main difference between the chrome extension "VideoStream for Google Chromecast" ?
Seems it can do the same job.
Click to expand...
Click to collapse
you don't need the chrome browser which I don't use, its junk imo.
no ads.
its free.
open source.
the main point of this is to just encourage more people to develop more things for rooted chromecasts, not everyone codes in languages that make chrome browser extensions or android apps etc.
if you look at fling its open source and is a good source of information for anyone that wants to develop standalone applications for the chromecast.
I think things like videostream are great for people who just want something that will play a file, but charging money for things and closed source projects don't really help other developers.
videostream is a good extension it has playlist support, a custom tv part, can be controlled from your phone etc.
but its transcoding is done using ffmpeg and x264 projects which are opensource and free, without those people doing amazing work on those open source projects we wouldn't be able to transcode videos.
without team eureka we wouldn't have rooted chromecasts and thats open source and free.
I made this project for my own personal use to cast media to my projector and TV's around my house, I started using fling but that stopped working so I used the source as a guide to create deskcast in a language I could understand so I could maintain it and keep it working.
I decided to share it here because this is where I found fling and the team eureka rom, its not intended to compete with other projects or extensions its more of a source code dump for anyone out there that uses vb.net.
This app Always crash no Windows 8.1 x64:crying:
---------- Post added at 07:05 AM ---------- Previous post was at 06:40 AM ----------
Play movie for 3 seconds and then crash. Always.
Crash solved
mute_man said:
This app Always crash no Windows 8.1 x64:crying:
---------- Post added at 07:05 AM ---------- Previous post was at 06:40 AM ----------
Play movie for 3 seconds and then crash. Always.
Click to expand...
Click to collapse
Before i was on windows 8 64 bits she was crashing !! Now i am on windows 8.1 64 bits she's crashing again !
I have dl the src and debug and I found where search ask on the web and i solve..
The problème is with french pc, where locale Fr is used.
Because the programme for show us the current_time and de total duration of the cast, receive data and parse them.
The programe receive data in string like "0.145666" or "46.613333" .
And later we try to convert this decimal number in string to double.
But on US pc :
(4.5).ToString() send "4.5"
Convert.ToDouble("4.5") send 4.5
Convert.ToDouble("4,5") send an exception
On FR pc :
(4.5).ToString() send "4,5"
Convert.ToDouble("4.5") send an exception
Convert.ToDouble("4,5") send 4.5
I dont find this alone but i was searching help here http://openclassrooms.com/forum/sujet/la-conversion-de-la-chaine-46-6133-en-type-double
and somebody send me here http://www.developpez.net/forums/d530200/dotnet/langages/csharp/convert-todouble-ne-gere-points/
Where i found the solution.
So you can download the src http://forum.xda-developers.com/attachment.php?attachmentid=2958209&d=1412304466
open in visual studio go to Form1.vb
At the beginning of the file under
Code:
Option Strict Off
Option Explicit On
Imports System.IO
Imports System.Net
Imports System.Threading
add
Code:
Imports System.Globalization
and search for
Code:
If Spl2(0) = "null" Then Spl2(0) = 0
You will find 3 occurance. But only 2 are interesting on line 288 and line 295.
Add before these 2 lines
Code:
If CultureInfo.CurrentCulture.TwoLetterISOLanguageName = "fr" Then Spl2(0) = Spl2(0).Replace(".", ",")
at final you will have
Code:
If InStr(StrMessage, Chr(34) & "duration" & Chr(34) & ":") <> 0 Then
Spl1 = Split(StrMessage, Chr(34) & "duration" & Chr(34) & ":")
Spl2 = Split(Spl1(1), ",")
' If Spl2(0).Contains(".") Then Spl2(0) = Spl2(0).Replace(".", ",")
If CultureInfo.CurrentCulture.TwoLetterISOLanguageName = "fr" Then Spl2(0) = Spl2(0).Replace(".", ",")
If Spl2(0) = "null" Then Spl2(0) = 0
pDuration = Fix(Spl2(0))
End If
If InStr(StrMessage, Chr(34) & "current_time" & Chr(34) & ":") <> 0 Then
Spl1 = Split(StrMessage, Chr(34) & "current_time" & Chr(34) & ":")
Spl2 = Split(Spl1(1), ",")
' If Spl2(0).Contains(".") Then Spl2(0) = Spl2(0).Replace(".", ",")
If CultureInfo.CurrentCulture.TwoLetterISOLanguageName = "fr" Then Spl2(0) = Spl2(0).Replace(".", ",")
If Spl2(0) = "null" Then Spl2(0) = 0
pTime = Fix(Spl2(0))
TrackTime(pDuration, pTime)
End If
Instead of
Code:
If InStr(StrMessage, Chr(34) & "duration" & Chr(34) & ":") <> 0 Then
Spl1 = Split(StrMessage, Chr(34) & "duration" & Chr(34) & ":")
Spl2 = Split(Spl1(1), ",")
If Spl2(0) = "null" Then Spl2(0) = 0
pDuration = Fix(Spl2(0))
End If
If InStr(StrMessage, Chr(34) & "current_time" & Chr(34) & ":") <> 0 Then
Spl1 = Split(StrMessage, Chr(34) & "current_time" & Chr(34) & ":")
Spl2 = Split(Spl1(1), ",")
If Spl2(0) = "null" Then Spl2(0) = 0
pTime = Fix(Spl2(0))
TrackTime(pDuration, pTime)
End If
well compile & run and enjoy !
Great, thanks !
But may I ask to publish somewhere the compiled version because I don't think that everybody has visual studio.
Thanks in advance
Inf3rnus187 said:
Before i was on windows 8 64 bits she was crashing !! Now i am on windows 8.1 64 bits she's crashing again !
I have dl the src and debug and I found where search ask on the web and i solve..
The problème is with french pc, where locale Fr is used.
Because the programme for show us the current_time and de total duration of the cast, receive data and parse them.
The programe receive data in string like "0.145666" or "46.613333" .
And later we try to convert this decimal number in string to double.
But on US pc :
(4.5).ToString() send "4.5"
Convert.ToDouble("4.5") send 4.5
Convert.ToDouble("4,5") send an exception
On FR pc :
(4.5).ToString() send "4,5"
Convert.ToDouble("4.5") send an exception
Convert.ToDouble("4,5") send 4.5
I dont find this alone but i was searching help here http://openclassrooms.com/forum/sujet/la-conversion-de-la-chaine-46-6133-en-type-double
and somebody send me here http://www.developpez.net/forums/d530200/dotnet/langages/csharp/convert-todouble-ne-gere-points/
Where i found the solution.
So you can download the src http://forum.xda-developers.com/attachment.php?attachmentid=2958209&d=1412304466
open in visual studio go to Form1.vb
At the beginning of the file under
Code:
Option Strict Off
Option Explicit On
Imports System.IO
Imports System.Net
Imports System.Threading
add
Code:
Imports System.Globalization
and search for
Code:
If Spl2(0) = "null" Then Spl2(0) = 0
You will find 3 occurance. But only 2 are interesting on line 288 and line 295.
Add before these 2 lines
Code:
If CultureInfo.CurrentCulture.TwoLetterISOLanguageName = "fr" Then Spl2(0) = Spl2(0).Replace(".", ",")
at final you will have
Code:
If InStr(StrMessage, Chr(34) & "duration" & Chr(34) & ":") <> 0 Then
Spl1 = Split(StrMessage, Chr(34) & "duration" & Chr(34) & ":")
Spl2 = Split(Spl1(1), ",")
' If Spl2(0).Contains(".") Then Spl2(0) = Spl2(0).Replace(".", ",")
If CultureInfo.CurrentCulture.TwoLetterISOLanguageName = "fr" Then Spl2(0) = Spl2(0).Replace(".", ",")
If Spl2(0) = "null" Then Spl2(0) = 0
pDuration = Fix(Spl2(0))
End If
If InStr(StrMessage, Chr(34) & "current_time" & Chr(34) & ":") <> 0 Then
Spl1 = Split(StrMessage, Chr(34) & "current_time" & Chr(34) & ":")
Spl2 = Split(Spl1(1), ",")
' If Spl2(0).Contains(".") Then Spl2(0) = Spl2(0).Replace(".", ",")
If CultureInfo.CurrentCulture.TwoLetterISOLanguageName = "fr" Then Spl2(0) = Spl2(0).Replace(".", ",")
If Spl2(0) = "null" Then Spl2(0) = 0
pTime = Fix(Spl2(0))
TrackTime(pDuration, pTime)
End If
Instead of
Code:
If InStr(StrMessage, Chr(34) & "duration" & Chr(34) & ":") <> 0 Then
Spl1 = Split(StrMessage, Chr(34) & "duration" & Chr(34) & ":")
Spl2 = Split(Spl1(1), ",")
If Spl2(0) = "null" Then Spl2(0) = 0
pDuration = Fix(Spl2(0))
End If
If InStr(StrMessage, Chr(34) & "current_time" & Chr(34) & ":") <> 0 Then
Spl1 = Split(StrMessage, Chr(34) & "current_time" & Chr(34) & ":")
Spl2 = Split(Spl1(1), ",")
If Spl2(0) = "null" Then Spl2(0) = 0
pTime = Fix(Spl2(0))
TrackTime(pDuration, pTime)
End If
well compile & run and enjoy !
Click to expand...
Click to collapse
Windows 8.1 x64 NO CRASHES! Finally some good PC software for Chromecast, I don't like using Chrome to cast videos, and TorrentTV app stopped working for me. I'm downloading the source, can I compile using VS 2012? I'll be using it for studying purposes only. But I'll try to add subtitles option (perfect for offline movies).
Absolutely amazing, thanks man!
I know this is an old thread, but I hope someone see's this.
I want to make an app in VB.NET that will send one window to ChromCast and have another window on the desktop. Is this possible? Any guidance or starter tips on how to do it?
started tinkering with my chrome cast again and added C# source for deskcast as I have moved away from vb.net.
https://github.com/stooged/DeskCastC
Visual Studio 2017 RC
Net Framework 4.6.1
Thank @stooged, both project VB and C# work on windows 10 64 bit, but only .mp4 files .

[WIP!][KERNEL] Razer Phone 2 Kernel (+exfat module, TWRP device tree, and more!)

Hi all!
What is this?
This is my mostly-working Razer Phone 2 Kernel and TWRP device tree!
I've been reading threads where people are having issues compiling the Razer-provided source for the RP2 and figured I should post what I have so others can use it to help achieve a fully working source-built kernel.
I'm also including a set of scripts to repack a Magisk-patched boot.img so you can iterate on building a new kernel rapidly, and am including a prebuilt magisk-patched boot.img with the custom kernel so we can QA other features while focusing on the known-broken things.
Also also, I'm including an exfat kernel module (not built into kernel for now) so that can be tested too!
Click to expand...
Click to collapse
Why is this mostly-working?
I've tested many features on this kernel and so far the only feature *not* working is the microphone. (Audio recording, haven't tested in-call audio)
This kernel is a mashup of Razer's source and a few other OSS repos from CAF - specifically the TFA98XX driver, and the audio-kernel repositories, so there's a bit of integration left to do to get all the audio features working.
I also had to edit the defconfig to get the DTB to build, and have to build with some special flags to use the prebuilt DTB compiler (dtc) since the one included in the source isn't capable of compiling the FIH DTBs inside the Razer-provided source (correct me if I'm doing something wrong here, but this was how I ended up getting it to work).
The kernel parameter skip_initramfs has also been renamed to skip__initramfs to break the silly bootloader skipping the ramdisk (and thereby breaking Magisk). This means you don't need to run Magisk's binary patch to rename that kernel argument to make Magisk or TWRP work.
Keep in mind, though, that this means if you use this kernel with a 100% stock ramdisk, you'll only ever get recovery since new Android ramdisks only contain recovery! (Thanks Dees_Troy for the refresher course!)
If you're familiar with the new audio-kernel CAF stuff, please let me know! I could use your assistance getting the microphone working.
It seems like the microphone isn't working because of some mismatches between the in-kernel msm audio drivers and the Razer customized drivers in the vendor partition.
I get errors like
Code:
[31269.485217] send_afe_cal_type cal_block not found!!
in dmesg when attempting to record audio. This seems isolated to the q6afe drivers in the kernel (specifically here: https://github.com/thecubed/android_kernel_razer_sdm845/blob/master/techpack/audio/dsp/q6afe.c#L1593 ) not playing nice with the prebuilt snd_soc_sdm845 kernel module.
Click to expand...
Click to collapse
Where do I get this?
See here for the TWRP device tree (and detailed instructions on how to set up your build tree): https://github.com/thecubed/android_device_razer_cheryl2
See here for just the kernel source: https://github.com/thecubed/android_kernel_razer_sdm845
See here for a kernel-less boot.img skeleton that you can drop your newly minted kernel into and repack with mkbootimg: http://downloads.codefi.re/thecubed/aura2/kernel/magisk_custom_kernel_skel.tar.gz
See here for a prebuilt boot.img with this custom kernel which includes Magisk: http://downloads.codefi.re/thecubed/aura2/kernel/boot_magisk_custom_9.img
See here for an exfat module you can insmod from a booted phone with custom kernel to try mounting exfat SD cards: http://downloads.codefi.re/thecubed/aura2/kernel/exfat_module.tar.gz
See here for a stock Magisk-patched boot.img for when you're done playing with this: http://downloads.codefi.re/thecubed/aura2/kernel/boot_magisk.img
Click to expand...
Click to collapse
How do I use this?
First off, this isn't for the average user. This kernel is *under development* and is not fully working yet. This means don't try this kernel on your mom's phone, your neighbor's phone, or any device that you aren't comfortable developing for.
Secondly, to test this, you'll need to be oem unlocked. There's plenty of guides to do this, but be aware that it erases all data on your phone when doing so. You could try using adb backup first, but I didn't have much success with that.
I'd suggest looking at the first link in the Where do I get this section and reading the README for the device tree as it'll have the most detailed instructions.
The gist is you'll need to download a minimal OmniROM manifest, add some lines to a file in .repo/local_manifests/cheryl2.xml, and run mka kernel to get a kernel image.
After that, you'll want to use mkbootimg to build a bootable magisk-patched boot.img, which you'll flash to your device with fastboot flash boot_X path/to/boot.img (where X is the active boot partition).
Once you've got the Image.gz-dtb file from your $OUT/obj/KERNEL_OBJ/arch/arm64/boot/Image.gz-dtb you'll want to repack it into a magisk-patched boot.img
Repacking the boot.img can be done with this command:
Code:
mkbootimg \
--kernel Image.gz-dtb \
--ramdisk boot_magisk.img-ramdisk.gz \
--cmdline 'console=ttyMSM0,115200n8 earlycon=msm_geni_serial,0xA84000 androidboot.hardware=qcom androidboot.console=ttyMSM0 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=2048 androidboot.configfs=true androidboot.usbcontroller=a600000.dwc3 buildvariant=user' \
--base 0x00000000 \
--pagesize 4096 \
--kernel_offset 0x00008000 \
--ramdisk_offset 0x01000000 \
--second_offset 0x00f00000 \
--tags_offset 0x00000100 \
--os_version 8.1.0 \
--os_patch_level 2018-10 \
-o ../boot_magisk_custom.img
Click to expand...
Click to collapse
FAQ
Does this have TWRP?
No. This does not have TWRP. The device tree is for TWRP eventually, and to make compiling the kernel easier (since Android kernels don't like compiling outside of Android's makefile system anymore)​
Does this have Magisk?
Yes! It's "pre-patched" too, as long as you're using my prebuilt one above.​
Do I need the custom kernel to use the exfat module?
Yes. This is because the Razer stock kernel has module signing forced. I don't have Razer's kernel module signing key so I can't compile kernel modules for the stock kernel. My kernel has module signing set to allow mismatched signatures, so both the Razer modules in /vendor/lib/modules (required for sound) and my exfat module can coexist.​
Why is exfat not compiled into the kernel?
Laziness, primarily. Actually, in this case I just didn't want to add extra variables to testing the kernel. If adding exfat into the kernel directly causes other issues it could potentially derail my quest to get this kernel up to par with the stock kernel.​
Why did other kernels not boot?
Most likely due to incompatible audio-kernel revisions, or dtb issues. I'm not sure, but getting this kernel to compile required a bit more hacking than it should have.​
Are you working on TWRP for Razer Phone 2?
Yep. Look for another post once the kernel is good to go. I aim to get encryption support working too, unless Dees_Troy beats me to it ​
Is audio still not working?
I'll update the post to remove the WIP tag and the section about audio as soon as it's working.​
Is anything else not working?
Feel free to download and test to let me know what else isn't working and I'll add it to the OP.​
Click to expand...
Click to collapse
Acknowledgements
Special thanks to Rashed97 and Dees_Troy for all their help.
Click to expand...
Click to collapse
y u quote OP?
Thanks for your work! Looking forward for a stable version. Wanna help but RP2 is currently my only working phone..
u sir,deserve a beer,thanks for working rp2 and not to forget other devs who help u along the way,we will wait patiently,cheers!!!!
Thank you.
Interesting discovery just now, seems that the stock kernel gives the same 'error' in dmesg when recording audio (but obviously audio recording still works).
Code:
[ 1365.950315] send_afe_cal_type cal_block not found!!
This could mean that Razer doesn't have a calibration profile for the microphone anyway (interesting, wonder if there's an opportunity to improve recording quality here?) and that I'm barking up the wrong tree re: calibration mismatches.
I've also confirmed that I get the same 'ASoC: no backend DAIs enabled for [backend name here]' messages in the stock kernel when brute force trying all PCM inputs with:
Code:
for f in `seq 1 80`; do tinycap /sdcard/wavs/device-$f.wav -D 0 -d $f -r 48000; done
It's also (very) possible that I don't understand how tinycap works.
I dumped the list of PCM inputs/outputs with:
Code:
for f in `ls -d /proc/asound/sdm845tavilsndc/** | grep pcm`; do echo "$f : `grep 'id' $f/info`"; done
and
Code:
cat /proc/asound/pcm
on both kernels (stock and custom) and they seem to match.
I'm thinking I should figure out how to record sound outside of android (from adb only) from stock kernel, and use that same test to try in the custom kernel. If I can find a test like that, I should be able to determine if I need to rename one of my DAI links to match whatever's baked into the XML files in /vendor/etc .
Any ideas?
Are you using the audio.a2dp.default.so driver?
Warrior1988: A2DP isn't in play here, and I'm using the stock /system and /vendor partitions, so any razer-customized tweaks are still present.
Currently, I've been working on figuring out the codec mappings to make sure that when audio is being recorded in the custom kernel that all the appropriate routing is set to enable audio from the tfa98xx chip (NXP amplifier, apparently supports digital microphones too?) or the wcd934x codec.
I'm not sure where the microphones are physically connected internally, so I'm working backwards from what gets enabled/disabled when recording audio in the stock kernel.
So far I have observed a few things (pardon my potentially incorrect terminology, the whole linux ASOC sound layer is new to me):
1. Audio in the stock and custom kernels is being captured by the mixer device called "SDM845 Media1", and it is capturing from SLIMBUS_0_TX input.
Code:
[Recording]
aura:/sys/module # cat /sys/kernel/debug/asoc/sdm845-tavil-snd-card/SDM845\ Media1/state
[SDM845 Media1 - Playback]
State: new
Backends:
No active DSP links
[SDM845 Media1 - Capture]
State: start
Hardware Params: Format = S16_LE, Channels = 1, Rate = 16000
Backends:
- SLIMBUS_0_TX
State: start
Hardware Params: Format = S16_LE, Channels = 1, Rate = 48000
2. You can also see when recording and not recording that in both kernels the SLIMBUS_0_TX input is wired correctly to the right mixer:
Code:
[Not recording]
aura:/sys # cat ./kernel/debug/asoc/sdm845-tavil-snd-card/platform:soc:qcom,msm-pcm-routing/dapm/SLIMBUS_0_TX
SLIMBUS_0_TX: Off in 2 out 0 - R0(0x0) mask 0x1
stream Slimbus Capture inactive
out "static" "SLIM0_UL_HL"
in "static" "Slimbus Capture"
in "static" "BE_IN"
[Recording]
aura:/sys # cat ./kernel/debug/asoc/sdm845-tavil-snd-card/platform:soc:qcom,msm-pcm-routing/dapm/SLIMBUS_0_TX
SLIMBUS_0_TX: On in 2 out 1 - R0(0x0) mask 0x1
stream Slimbus Capture inactive
out "static" "SLIM0_UL_HL"
out "SLIM_0_TX" "MultiMedia1 Mixer"
in "static" "Slimbus Capture"
in "static" "BE_IN"
Now that I've observed those things, I need to do a bit more research on how audio can get enabled/disabled on each of the chips that touch it.
For instance, in the custom kernel, I noticed that during recording sounds the DMIC* lines on the second tfa98xx aren't enabled. I haven't checked in the stock kernel yet - but if the tfa98xx chip is providing mic bias, it's possible that everything is wired right for input but since the mic bias isn't on, the mic isn't powered and thus we get no sound.
(Updated side note, why is Razer Phone 2 is using two TFA9888 chips? The tfa98xx.cnt firmware references TFA9892 which is mono only, too. I need to see a disassembly to figure out what chips it's actually using...)
Code:
aura:/sys # cat ./kernel/debug/asoc/sdm845-tavil-snd-card/codec:tfa98xx.4-0034/dapm/DMIC*
DMIC1: Off in 1 out 0
out "static" "AIF OUT"
DMIC2: Off in 1 out 0
out "static" "AIF OUT"
DMIC3: Off in 1 out 0
out "static" "AIF OUT"
DMIC4: Off in 1 out 0
out "static" "AIF OUT"
aura:/sys # cat ./kernel/debug/asoc/sdm845-tavil-snd-card/codec:tfa98xx.4-0035/dapm/DMIC*
DMIC1: Off in 1 out 0
out "static" "AIF OUT"
in "static" "MIC BIAS1"
DMIC2: Off in 1 out 0
out "static" "AIF OUT"
DMIC3: Off in 1 out 0
out "static" "AIF OUT"
in "static" "MIC BIAS3"
DMIC4: Off in 1 out 0
out "static" "AIF OUT"
Update: just noticed that this path doesn't exist on stock kernel. So the TFA driver I have doesn't match the one Razer is using. Interesting!
Also, I'm not sure why SLIMBUS_2 playback/capture aren't shown as 'dynamic DAI' linked (the '(*)' means it's a dynamic DAI)... Probably not important though.
Code:
aura:/proc/asound # cat pcm
00-00: MultiMedia1 (*) : : playback 1 : capture 1
00-01: MultiMedia2 (*) : : playback 1 : capture 1
00-02: VoiceMMode1 (*) : : playback 1 : capture 1
00-03: VoIP (*) : : playback 1 : capture 1
00-04: MultiMedia3 (*) : : playback 1
00-05: SLIMBUS_0 Hostless (*) : : playback 1 : capture 1
00-06: AFE-PROXY RX msm-stub-rx-6 : : playback 1
00-07: AFE-PROXY TX msm-stub-tx-7 : : capture 1
00-09: AUXPCM Hostless (*) : : playback 1 : capture 1
00-10: SLIMBUS_1 Hostless (*) : : playback 1 : capture 1
00-11: SLIMBUS_3 Hostless (*) : : playback 1 : capture 1
00-12: SLIMBUS_4 Hostless (*) : : playback 1 : capture 1
00-13: MultiMedia5 (*) : : playback 1 : capture 1
00-14: Listen 1 Audio Service (*) : : capture 1
00-16: MultiMedia10 (*) : : playback 1 : capture 1
00-17: MM_NOIRQ (*) : : playback 1 : capture 1
00-18: HDMI_RX_HOSTLESS (*) : : playback 1
00-19: VoiceMMode2 (*) : : playback 1 : capture 1
00-20: Listen 2 Audio Service (*) : : capture 1
00-21: Listen 3 Audio Service (*) : : capture 1
00-22: Listen 4 Audio Service (*) : : capture 1
00-23: Listen 5 Audio Service (*) : : capture 1
00-24: Listen 6 Audio Service (*) : : capture 1
00-25: Listen 7 Audio Service (*) : : capture 1
00-26: Listen 8 Audio Service (*) : : capture 1
00-27: MultiMedia9 (*) : : playback 1 : capture 1
00-33: MM_NOIRQ_2 (*) : : playback 1 : capture 1
00-34: SLIMBUS8_HOSTLESS Capture (*) : : capture 1
00-35: Slimbus4 Capture tavil_vifeedback-35 : : capture 1
00-36: SLIMBUS_2 Hostless Playback tavil_rx2-36 : : playback 1
00-37: SLIMBUS_2 Hostless Capture tavil_tx2-37 : : capture 1
00-38: MultiMedia6 (*) : : playback 1 : capture 1
00-39: USB Audio Hostless (*) : : playback 1 : capture 1
00-80: QUAT_MI2S_RX Hostless (*) : : playback 1
Meanwhile, we've reached out to Razer to see if they'll bless us with the full and complete kernel source this time
I doubt it. They won't even answer simple questions as to an estimate of when we're getting Pie
blackknightavalon said:
I doubt it. They won't even answer simple questions as to an estimate of when we're getting Pie
Click to expand...
Click to collapse
>simple question
>eta
pick one
Any progress on this kernel? I'm really curious now that we have pie.
No progress as of yet, I've been busy with work recently and Razer hasn't dropped source for the new kernel version (still 4.9 but a different patch level).
I'm hopeful that Razer will drop the complete source for Pie's kernel and I can backport that to the Oreo kernel for those who want to keep the old OS.
I haven't updated my RP2 to Pie yet so I can test out any changes once the source for the new kernel is out. I'll be sure to post here when I have any updates
Audio-kernel source is out! https://s3.amazonaws.com/cheryl-factory-images/audio-kernel-aura-2009.tar.gz
I'll be rebuilding my kernel very soon and testing.
https://s3.amazonaws.com/cheryl-factory-images/
Warrior1988 said:
https://s3.amazonaws.com/cheryl-factory-images/
Click to expand...
Click to collapse
Yup, I'm building it right now!
Yup, it works! I have fully working audio and microphone now. Seems like there's a bunch of DAI changes and some offset changes to calibration stuff that FIH added (ugh).
Please hold while I get the commit up on my Github, and I'll get a build with exfat going here in just a minute after.
Plan is:
- Github updates (readme changes, etc) UPDATE: done
- Upload this current build I just tested for anyone that wants it
- Add exfat module to kernel and rebuild / test UPDATE: exfat support works, BUT I need to recompile vold to support exfat. I can mount the SD card just fine, but Android doesn't understand that it's mounted because vold isn't tracking it
Also, <3 u razer, thanks
I'm bummed to hear about the layoffs, and I really appreciate whomever uploaded the source even after that. Hopefully Razer's phone team will grow again and get to make us a Razer Phone 3 at some point in the future.
For anyone that's still running 8.1 and wants to try my custom kernel (no, no exfat support yet until I get vold fixed), here's a link: http://downloads.codefi.re/thecubed/aura2/kernel/boot_magisk_custom_10.img
Github has been updated as well.
I'll be sure to update the OP tomorrow when it's not 2AM.
EDIT: Fixed link, 2AM is not kind to my typing skills
Awesome work! Very excited to try it out tomorrow.
Also sad to see your post about their layoffs. Pretty fun phone with much potential for future.
I think some of the reviews are pretty harsh given the penchant of Pixel / Samsung / Apple worship out there.
Anyway, thanks so much for this.
thecubed said:
For anyone that's still running 8.1 and wants to try my custom kernel (no, no exfat support yet until I get vold fixed), here's a link: http://downloads.codefi.re/thecubed/aura2/boot_magisk_custom_10.img
Github has been updated as well.
I'll be sure to update the OP tomorrow when it's not 2AM.
Click to expand...
Click to collapse
Thank you for this!
It's showing up "Not found" on the download link though.
jal3223 said:
Thank you for this!
It's showing up "Not found" on the download link though.
Click to expand...
Click to collapse
Fixed the link in my previous post - sorry about that!
I'll be updating the OP tonight too when I get home from work.
Looking good! Is the sound as good as stock (or maybe better, considering the low volume crackling we get)?
Hoping to give this a shot soon, as soon as I figure out rooting on 9.0. I saw a thread about it, but nobody answered my question there, and light digging through threads didn't turn up an answer, so trying this kernel will have to wait a bit. Makes me miss the HTC root days, when finding out about root was a simple yes or no situation... lol.

Categories

Resources