[DEV-only][WIP] ALSA BCM21553 Audio libs built from source - BroadcomCM - Galaxy Ace S5830i Android Development

I've created this thread to join developers into the final audio fix for android 2.3.7. Although the prupose of this thread is to fix Audio on Android 4.0.4 we first need audio drivers source.
On all our based Android 2.3.7 ROMs we fixed audio using some AOSP Alcatel .so files (to remove Samsung lib dependency) and some Samsung .so libraries too, this is the whole list:
# Samsung audio libs
acoustics.default.so
alsa.default.so
libaudiopolicy.so
# Alcatel audio libs
libaudio.so
libaudioflinger.so
libaudioeffect_jni.so
libmediaplayerservice.so
Click to expand...
Click to collapse
Our device uses ALSA audio system, which is also used on stock ROM. This is related to software more than hardware, although we are not planning at the momnt to "change" this audio way. To activate ALSA audio some changes need to be done on kernel, that samsung provide to us on their kernel sources. Mostly we need to enable ALSA on device .config file:
Code:
CONFIG_BRCM_SOUND_ALSA=y
CONFIG_BRCM_SOUND_ATHENA_ALSA=y
That's not an issue as prebuilt alsa libs work, so new libs should work too. Ramdisk needs some edit too, as ALSA audio system is stored on dev/snd, and this is well defined too on our ramdisk, ueventd.rc
Code:
/dev/snd/* 0660 system audio
We realised after that that actually CyanogenMod 7.2 Sources include ALSA lib sources, what we didn't know if those sources could work with our devices. This sources build the following libs, as releated to its Android.mk files:
We can found inside hardware/sound_alsa the following sources to build
libaudio
libaudioflinguer
hw/alsa.default
hw/acoustics.default
On external/alsa-lib we can found the sources of anoher lib
libasound
And apart from that, some other audio libs such as libaudiopolicy are built inside framework/base repository, but they doesn't make any conflict. Other libs are included on Android source files.
To enable the build of those libs, using ALSA software instead af "Android default (not sure about that)". I've enabled on Boardconfig.mk the following configs:
Code:
# Audio
BOARD_USES_GENERIC_AUDIO := false
BOARD_USES_ALSA_AUDIO := true
BOARD_PREBUILT_LIBAUDIO := false # even not writted.
BUILD_WITH_ALSA_UTILS := true
This configs enable the building of those libs on their Android.mk files.
Also, I've added on device_cooperve.mk the following lines to build those hw modules releated to audio:
Code:
# Audio
PRODUCT_PACKAGES += \
alsa.default \
acoustics.default
After the build finished, and fixed some errors, AUDIO WAS WORKING, but not as expected. There were issues on Audio Routing:
Headphones are detected through system, but audio is not reproduced on headphones (speakers does)
When you make a call, sometimes you can't and phone freezes, or when you hangout the call, phone freezes.
Everything else apart from that seems to be working, even microphone, although this bugs are pretty weird, I took a look to logcat.
Code:
[COLOR="Gray"]D/AndroidRuntime( 1419): CheckJNI is OFF
I/ ( 1420): ServiceManager: 0xad50[/COLOR]
[COLOR="Red"]E/ALSALib ( 1420): external/alsa-lib/src/control/control.c:882:(snd_ctl_open_noupdate) Invalid CTL AndroidOut[/COLOR]
W/AudioHardwareALSA( 1420): Unable to attach mixer to device AndroidOut: No such file or directory
[COLOR="Red"]E/ALSALib ( 1420): external/alsa-lib/src/control/control.c:882:(snd_ctl_open_noupdate) Invalid CTL AndroidIn[/COLOR]
W/AudioHardwareALSA( 1420): Unable to attach mixer to device AndroidIn: No such file or directory
D/AudioHardwareALSA( 1420): openOutputStream called for devices: 0x00000002
D/ALSAModule( 1420): open called for devices 00000002 in mode 0...
I/ALSAModule( 1420): Initialized ALSA PLAYBACK device AndroidPlayback_Speaker_normal
I/AudioHardwareALSA( 1420): buffer size (bytes) to AF = 16384
D/AudioFlinger( 1420): setParameters(): io 1, keyvalue routing=2, tid 1593, calling tid 1420
I/AudioFlinger( 1420): AudioFlinger's thread 0x1d978 ready to run
D/ALSAModule( 1420): route called for devices 00000002 in mode 0...
I managed to fix those errors (E/) by moddifying asound.conf, found on system/etc, adding this lines on the top and deleting old ones:
Code:
ctl.AndroidOut {
type hw
card 0 # Can replace with drivers name from /proc/asound/cards
}
ctl.AndroidIn {
type hw
card 0
}
Now logcat shows this at the moment
Code:
[COLOR="Gray"]D/AndroidRuntime( 1425): CheckJNI is OFF
I/ ( 1426): ServiceManager: 0xad50[/COLOR]
D/AudioHardwareALSA( 1426): openOutputStream called for devices: 0x00000002
D/ALSAModule( 1426): open called for devices 00000002 in mode 0...
I/ALSAModule( 1426): Initialized ALSA PLAYBACK device AndroidPlayback_Speaker_normal
I/AudioHardwareALSA( 1426): buffer size (bytes) to AF = 16384
D/AudioFlinger( 1426): setParameters(): io 1, keyvalue routing=2, tid 1604, calling tid 1426
I/AudioFlinger( 1426): AudioFlinger's thread 0x1d960 ready to run
D/ALSAModule( 1426): route called for devices 00000002 in mode 0...
Actually that's the actual logcat, using headphones, and sound goes through speakers:
Code:
D/dalvikvm( 1926): GC_EXTERNAL_ALLOC freed 324K, 49% free 3317K/6471K, external 571K/579K, paused 58ms
V/HeadsetObserver( 1607): Headset UEVENT: {SUBSYSTEM=switch, SWITCH_STATE=2, DEVPATH=/devices/virtual/switch/h2w, SEQNUM=1335, ACTION=change, SWITCH_NAME=h2w}
W/Vold ( 1415): Ignoring unknown switch 'h2w'
V/HeadsetObserver( 1607): Intent.ACTION_HEADSET_PLUG: state: 1 name: h2w mic: 0
I/HeadsetService( 1907): Headset plugged: true
I/Effect-DRC( 2115): Compression factor set to: 1.000000
I/Effect-BassBoost( 2115): New strength: 0
D/SurfaceFlinger( 1607): Layer[1c62e0] [2] non-RGB565 reloads
I/Effect-Equalizer( 2115): Setting band 2 to 0
I/Effect-Equalizer( 2115): Setting band 2 to 1
I/Effect-Equalizer( 2115): Setting band 2 to 2
I/Effect-Equalizer( 2115): Setting band 2 to 3
I/Effect-Equalizer( 2115): Setting band 2 to 4
I/Effect-Equalizer( 2115): Setting loudness correction reference to 100.000000 dB
D/AudioFlinger( 2115): setParameters(): io 1, keyvalue routing=8, tid 2117, calling tid 2115
D/ALSAModule( 2115): route called for devices 00000008 in mode 0...
D/ALSAModule( 2115): open called for devices 00000008 in mode 0...
I/ALSAModule( 2115): Initialized ALSA PLAYBACK device AndroidPlayback
D/dalvikvm( 1926): GC_EXTERNAL_ALLOC freed 323K, 49% free 3327K/6471K, external 571K/579K, paused 44ms
We must take a look if that is kernel relevant or not, as we really need this libs to work, to then start working on CyanogenMod 9.1 / Android 4.0.4 audio. Any suggestions are welcomed, although if they are from newbie or developer, don't want this thread to be spammed as others

Why this is helpfull ?
Currently we based it upon cm7.2 GB
this is because our device uses to run GB as stock.
When we figure the sources out and figure out what is part 1 or such we can adapt and try to port to CM9 so in that we can have new libs aswell.
(W.I.P Post;P )

to me

Sorry for intrusion Biel and spacecaker But can i have the output of cat /proc/asound/cards ???

4dead said:
Sorry for intrusion Biel and spacecaker But can i have the output of cat /proc/asound/cards ???
Click to expand...
Click to collapse
Sure, here it is:
Code:
# cat /proc/asound/cards
0 [ALSA ]: Broadcom - Broadcom ALSA
Broadcom ALSA PCM 0

I can help
bieltv.3 said:
Sure, here it is:
Code:
# cat /proc/asound/cards
0 [ALSA ]: Broadcom - Broadcom ALSA
Broadcom ALSA PCM 0
Click to expand...
Click to collapse
give me any link - any guide i got linux want to help i will do my best

at myaser
for this
there are no guides.
Sent from my S500 using xda app-developers app

SpaceCaker said:
at myaser
for this
there are no guides.
Sent from my S500 using xda app-developers app
Click to expand...
Click to collapse
I will try using my mind
Sorry for non-useful comments

u need tiny alsa not alsa sources to work with bcm21553 modules , Android 4.0.4 introduced tiny alsa replacing alsa

percy_g2 said:
u need tiny alsa not alsa sources to work with bcm21553 modules , Android 4.0.4 introduced tiny alsa replacing alsa
Click to expand...
Click to collapse
We are fixing on 2.3.7 at the moment. Tinyalsa gives support for msm8960 chips as I can see on their sources, so we should start from 2.3.7.
Enviado desde mi C5303 mediante Tapatalk

The sound will work after 3 months?
The sound will work after 3 months?

bieltv.3 said:
We are fixing on 2.3.7 at the moment. Tinyalsa gives support for msm8960 chips as I can see on their sources, so we should start from 2.3.7.
Enviado desde mi C5303 mediante Tapatalk
Click to expand...
Click to collapse
What about CyanMobile eXperience Biel ??
Are you will starting the build ??

@bieltv.3
Look At ur inbox

jeko99 said:
The sound will work after 3 months?
Click to expand...
Click to collapse
Maybe... Be patient bro, it's so hard to fixing audio issue

jeko99 said:
The sound will work after 3 months?
Click to expand...
Click to collapse
No ETA's, please.
Can't you see that this thread is a Dev thread? No discussion here, please.
Enviado de meu XT1032 usando Tapatalk

I think you should really take a look on the stock asound.conf

4dead said:
I think you should really take a look on the stock asound.conf
Click to expand...
Click to collapse
We are using stock asound.conf
Enviado desde mi C5303 mediante Tapatalk

Are the drivers initialized in the kernel?
check here ---> http://seasonofcode.com/posts/using-alsa-audio-drivers-in-android.html
and here ----> http://code.paulk.fr/article3/tinyalsa-audio

faZevoLv said:
Are the drivers initialized in the kernel?
check here ---> http://seasonofcode.com/posts/using-alsa-audio-drivers-in-android.html
and here ----> http://code.paulk.fr/article3/tinyalsa-audio
Click to expand...
Click to collapse
Biel already said in the op that he added /dev/snd in the Ramdisk and i dont think our device use tinyalsa because With Alsa Drivers biel got sound working.

No Way To Use Audio files from other devices
Not booting at all
BroadcomCM Team \o/
Good luck It seems to be hard

Related

Android 4.4.3

Dear developers,
Considering Android 4.4.3 is now available in AOSP, when can we expect to get nightlies based on it?
Thanks!
Answered in the FAQ: http://forum.xda-developers.com/showthread.php?t=2738971
​
PonsAsinorem said:
Answered in the FAQ: http://forum.xda-developers.com/showthread.php?t=2738971
Click to expand...
Click to collapse
I hope we can use android 4.4.3 ASAP on galaxy s2.
I made a homemade Build for Tab 2,
Code:
I/CameraService( 117): CameraService started (pid=117)
I/SurfaceFlinger( 114): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
I/CameraService( 117): Loaded "Espresso Camera Wrapper" camera module
V/CameraWrapper( 117): camera_get_number_of_cameras
V/CameraWrapper( 117): check_vendor_module
E/HAL ( 117): load: module=/system/lib/hw/vendor-camera.piranha.so
E/HAL ( 117): dlopen failed: cannot locate symbol "FindSection" referenced by "vendor-camera.piranha.so"...
E/CameraWrapper( 117): failed to open vendor camera module
camera isn´t working there.
Full logcat: http://pastebin.com/gCtfG2aH
Meight also happen on other devies.
patrickph said:
​
I hope we can use android 4.4.3 ASAP on galaxy s2.
Click to expand...
Click to collapse
Now available.
http://dl.omnirom.org/i9100/omni-4.4.3-20140606-i9100-NIGHTLY.zip

[Q&A] [WIP][Kernel][3.0.31]+

Q&A for [WIP][Kernel][3.0.31]+
Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer.
Before posting, please use the forum search and read through the discussion thread for [WIP][Kernel][3.0.31]+. If you can't find an answer, post it here, being sure to give as much information as possible (firmware version, steps to reproduce, logcat if available) so that you can get help.
Thanks for understanding and for helping to keep XDA neat and tidy!
It's miracast working with this kernell? And if it's., are some guide or anything witch say how to install it? thanks
divisorxx said:
It's miracast working with this kernell? And if it's., are some guide or anything witch say how to install it? thanks
Click to expand...
Click to collapse
I don't know if miracast works, but to install kernel, just download kernel_24.07.2014.zip and install in safestrap after rom is installed
JBX Kernel Droid 4
I've been using Lucize's modded JBX kernel for a while, but the old versions have bugs (ie: trying to use most governors crash the phone fairly quickly).
When I use dtrail's JBX kernel for motorola razr, trying out other governors no longer crash the phone, but the cell radio never reads anything other than -120snr / 99asu, which means it has no bars at all times. Anyone know a fix for this, or what make's lucize's jbx builds different from dtrails on the cell radio?
umts_spyder
Hi,
Will this kernel work with XT910 (umts_spyder) CM12?
If not could anyone point me to the right thread, I can't find any thread
2-way call recording not work with vxrec enabled kernel 3.0.21
I have tested enablecmcallrec_v125(xposed module) on my cm11(m12) with 0309 kernel and it didn't work.
In the logcat there are some related information:
Code:
D/AudioPolicyManagerBase( 695): getInput() inputSource 4, samplingRate 8000, format 1, channelMask 10, acoustics 0
W/AudioPolicyManagerBase( 695): getInput() could not find device for inputSource 4
E/AudioRecord( 695): Could not get audio input for record source 4
D/AudioSource( 695): Start autoramp from 500000
E/StagefrightRecorder( 695): audio source is not initialized
E/MediaRecorder( 1230): start failed: -2147483648
W/CallRecorderService( 1230): Could not start recording for file /storage/sdcard0/CallRecordings/callrecorder_20150317205617701.amr
W/CallRecorderService( 1230): java.lang.RuntimeException: start failed.
W/CallRecorderService( 1230): at android.media.MediaRecorder.start(Native Method)
inputSource 4 means voice_call, and this xposed module call standard android api to record. Maybe more work need to be done for it to work.
callrecorder with standard api mode return the same error.
I can record call using tinymix and tinycap using adb.
kidault said:
I have tested enablecmcallrec_v125(xposed module) on my cm11(m12) with 0309 kernel and it didn't work.
In the logcat there are some related information:
Code:
D/AudioPolicyManagerBase( 695): getInput() inputSource 4, samplingRate 8000, format 1, channelMask 10, acoustics 0
W/AudioPolicyManagerBase( 695): getInput() could not find device for inputSource 4
E/AudioRecord( 695): Could not get audio input for record source 4
D/AudioSource( 695): Start autoramp from 500000
E/StagefrightRecorder( 695): audio source is not initialized
E/MediaRecorder( 1230): start failed: -2147483648
W/CallRecorderService( 1230): Could not start recording for file /storage/sdcard0/CallRecordings/callrecorder_20150317205617701.amr
W/CallRecorderService( 1230): java.lang.RuntimeException: start failed.
W/CallRecorderService( 1230): at android.media.MediaRecorder.start(Native Method)
inputSource 4 means voice_call, and this xposed module call standard android api to record. Maybe more work need to be done for it to work.
callrecorder with standard api mode return the same error.
I can record call using tinymix and tinycap using adb.
Click to expand...
Click to collapse
Hello!
How you manage to record calls on Droid 4?

[ROM][5.1.1][T710][UNOFFICIAL] CyanogenMod 12.1 for Tab S2 8.0 [BETA]

{
"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"
}
This ROM is BETA at the moment​
CyanogenMod is based on the Android Open Source Project with extra contributions from many people within the Android community
First I would like to thank the following developers :
@moonbutt74
@yeshwanthvshenoy
@gladiac
@RaymanFX
@sub77
@T_I
@hennymcc
@Sarum4n - for Donating XDA add free
Each of them helped me with this project so a big thanks goes to them!
Before you start
THIS ROM IS ONLY FOR THE SM-T710
A T810 port of this rom by @T_I is available here
Code:
*
* Your warranty will be voided !
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*
About the ROM
Current state of ROM : BETA
What is Fixed
Camera
Sound
Wifi
Storage
Headphones
External sdcard
Screen Rotation
Bluetooth shows note 4 instead of tab s2
Resolution
What is not working
Important
MTP
Minor
Microphone
Minor graphical glitches
Lag after trying to send a text via sms app (Just don't do it and disable the app. It will try to reach RIL even tough its wifi only)
Instructions
How to install CM12.1
If you don't have TWRP yet, get it from here : TWRP by ashyx
Download the ROM and the Gapps that are located below to your device
Reboot into TWRP by holding VOL UP + POWER + HOME on boot
In case things go wrong make a backup
After the backup has completed return to home and select Wipe and then Advanced Wipe
Now ONLY tick Dalvik Cache, System, Data and Cache
After ticking those, Swipe below to wipe
Once the wipe has completed return to home and select the ROM
After you selected the ROM swipe below to install it
After the ROM has installed flash the Gapps
When all of this is done, reboot into system, wait, and enjoy CM12.1
How to ROOT
In CM 12.1, enable the developer options
Select Root access
Select Apps Only
Done
Questions and bug reporting
The following questions will be ignored
Inappropriate questions
Requests for other devices
Forced orders, EX. : "PLS FIX!!!!!!"
ETA's
Often repeated questions usually by the same user
Requests that are out of CM's framework (Ex. Adding Samsung Apps)
How to report a bug/issue
Explain exactly what happens
Mention a log if you can (Please use hastebin or any other paste site to keep the thread clean)
If you can't mention a log, explain as precise as possible when, why and where it occurs!
Changelog
Code:
18/4/2016 - Fixed Camera (Yes I'm still alive)
**********
27/1/2016 - Fixed Headphones not working
**********
30/12/2015 - Fixed External sdcard
**********
28/12/2015 - Fixed Sound
- Removed Calling option from lockscreen
- Added missing OMX formats
- ROM is now BETA
**********
21/12/2015 - Fixed Storage problems
**********
19/12/2015 - ROM is now ALPHA
- Fixed Wifi
**********
15/12/2015 - Fixed Rotation/Orientation
- Lowered to 320 DPI
- Updated Screenshots
**********
12/12/2015 - Fixed Bluetooth showing note 4
- Fixed bad resolution
- Updated Screenshots
**********
11/12/2015 - CM12.1 Booted for the first time
**********
Downloads
Latest CM 12.1 build : Android File Host
All CM 12.1 releases can be found here : Android File Host
Recommended GAPPS Open Gapps
Source
Special Thanks to @RaymanFX for releasing his Exynos 5433 source, without him this ROM would most likely not be possible!
All my sources can be found here : https://github.com/Galaxy-Tab-S2
Screenshots
XDA:DevDB Information
CyanogenMod 12.1 for Samsung Galaxy Tab S2 8.0 T710, ROM for the Samsung Galaxy Tab S2
Contributors
CTXz, Sub77, Moonbutt74, RaymanFX, Hennymcc
Source Code: https://github.com/Galaxy-Tab-S2
ROM OS Version: 5.1.x Lollipop
Based On: CyanogenMod
Version Information
Status: Beta
Created 2015-12-11
Last Updated 2016-04-18
Q&A
Q : Why does it say Galaxy Tab S2 9.7 on Android File Host if this is for the 8.0 version ?
A : Android File Host doesn't feature the 8.0 version in their devices. Because of that, all is located under a folder called 8.0
Q : Why is everything so small?
A : The DPI rate is 320 which is the same as on the Stock rom. However, Samsung has made everything bigger. Since this is personal preference, you may always higher your DPI to make things bigger or lower your DPI to make things smaller under Settings > Display > DPI
Q : Will you ever work on CM13?
A : Yes, once we feel like CM12 is good enough, we will move to CM13
Reserved 2
New build 12/12/2015
- Fixed Bluetooth bug showing Galaxy note 4 instead of tab s2
- Fixed bad resolution
- Updated Screenshots
Great work!
Can't wait to use this once it reaches a point where it's functional for everyday use! Excellent work so far!
Good job man!!! Will test this as soon as the WiFi works
Sent from my SM-T710 using Tapatalk
good news for all T810 users! @T_I is working on a port of my ROM. It came to the CM setup wizzard however had some problems with the touchscreen. Should hopefully be a easy fix.
So the sensor module just isn't loading.
Code:
I/ ( 3857): System server: starting sensor init.
D/SensorService( 3857): nuSensorService starting...
E/HAL ( 3857): load: module=/system/lib/hw/sensors.exynos5.so
E/SensorService( 3857): couldn't load sensors module (Invalid argument)
I/ ( 3857): System server: sensor init done.
Tried to use the note 4 ones. They did load up successfully but use different drivers.
Ex the gyroscope uses ICM20610 where mine uses LSM6DS3. I really only came this far. My nightmare would be to make my own sensor libs. That would mean that I would have to learn lot's of lot's of coding!
CTXz said:
So the sensor module just isn't loading.
Code:
I/ ( 3857): System server: starting sensor init.
D/SensorService( 3857): nuSensorService starting...
E/HAL ( 3857): load: module=/system/lib/hw/sensors.exynos5.so
E/SensorService( 3857): couldn't load sensors module (Invalid argument)
I/ ( 3857): System server: sensor init done.
Tried to use the note 4 ones. They did load up successfully but use different drivers.
Ex the gyroscope uses ICM20610 where mine uses LSM6DS3. I really only came this far. My nightmare would be to make my own sensor libs. That would mean that I would have to learn lot's of lot's of coding!
Click to expand...
Click to collapse
I really dont know but doea this help:
https://github.com/STMemsLinuxDrivers/lsm6ds3-input
Sent from my SM-G928I using Tapatalk
Beukhof1 said:
I really dont know but doea this help:
https://github.com/STMemsLinuxDrivers/lsm6ds3-input
Sent from my SM-G928I using Tapatalk
Click to expand...
Click to collapse
Sadly those are for the kernel.
However,
I found this open source sensor for the s3 I9300 that uses a , what I believe, older version of the gyro found in our device. I will see what I can decompile/reverse out of the current module for the tab and will compare it with the open source ones for the I9300. This will be hard and I would be very thankfull if you could redict any expierienced dev you know, here
Suprise!
Turns out I was just missing a shared libary. That caused the module not to load. Sooo.... all that s3 sensor work for nothing
Hey.... atleast I learned something.
Also, build will be released in about 1-2h
CTXz said:
Suprise!
Turns out I was just missing a shared libary. That caused the module not to load. Sooo.... all that s3 sensor work for nothing
Hey.... atleast I learned something.
Also, build will be released in about 1-2h
Click to expand...
Click to collapse
Nice! Good job mate!
Did you have time to look at wifi yet? I would love to try it if that works!
Sent from my SM-T710 using Tapatalk
Beukhof1 said:
Nice! Good job mate!
Did you have time to look at wifi yet? I would love to try it if that works!
Sent from my SM-T710 using Tapatalk
Click to expand...
Click to collapse
Not yet, but I will take a look at it soon!
New build is out !
**********
15/12/2015 - Fixed Rotation/Orientation
- Lowered to 320 DPI
- Updated Screenshots
**********
Links have been updated!
Ok so to wifi :
I know most of you want as number 1. priority a working WIFI connection, but this doesn't seem to be that easy to fix, at least not for my empty brain. As you've probably already noticed, my debugging skills are still quite bad (Yes I'm still learning... Yes I'm not perfect.... well maybe yes... ok no just kidding). The current issue i'm facing has probably to do something with the api drivers and wpa_supplicant. I've noticed that the KMSG doesn't even show a tiny trace of the cfg80211 driver and the nl80211 driver. If any developer out there knows what to do with the following log output when trying to access the wifi HAL / Enabling WIFI please tell me.
Code:
D/SoftapController( 3507): Softap fwReload - Ok
W/CommandListener( 3507): Failed to retrieve HW addr for wlan0 (No such device)
D/CommandListener( 3507): Setting iface cfg
E/WifiStateMachine( 3901): Unable to change interface settings: java.lang.IllegalStateException: command '90 interface setcfg wlan0 0.0.0.0 0 down' failed with '400 90 Failed to set address (No such device)'
E/WifiMonitor( 3901): killSupplicant p2ptrue init.svc.wpa_supplicant=unknown init.svc.p2p_supplicant=unknown
I/wpa_supplicant( 7883): Successfully initialized wpa_supplicant
I/wpa_supplicant( 7883): rfkill: Cannot open RFKILL control device
E/wpa_supplicant( 7883): Could not read interface wlan0 flags: No such device
I/wpa_supplicant( 7883): nl80211: Driver does not support authentication/association or connect commands
E/wpa_supplicant( 7883): Could not read interface wlan0 flags: No such device
E/wpa_supplicant( 7883): wlan0: Failed to initialize driver interface
E/WifiStateMachine( 3901): Failed to start supplicant!
D/WifiService( 3901): setWifiEnabled: false pid=5956, uid=1000
E/WifiService( 3901): Invoking mWifiStateMachine.setWifiEnabled
D/SoftapController( 3507): Softap fwReload - Ok
W/CommandListener( 3507): Failed to retrieve HW addr for wlan0 (No such device)
D/CommandListener( 3507): Setting iface cfg
E/WifiStateMachine( 3901): Unable to change interface settings: java.lang.IllegalStateException: command '93 interface setcfg wlan0 0.0.0.0 0 down' failed with '400 93 Failed to set address (No such device)'
E/WifiMonitor( 3901): killSupplicant p2ptrue init.svc.wpa_supplicant=unknown init.svc.p2p_supplicant=unknown
I/wpa_supplicant( 7915): Successfully initialized wpa_supplicant
I/wpa_supplicant( 7915): rfkill: Cannot open RFKILL control device
E/wpa_supplicant( 7915): Could not read interface wlan0 flags: No such device
I/wpa_supplicant( 7915): nl80211: Driver does not support authentication/association or connect commands
E/wpa_supplicant( 7915): Could not read interface wlan0 flags: No such device
E/wpa_supplicant( 7915): wlan0: Failed to initialize driver interface
E/WifiStateMachine( 3901): Failed to start supplicant!
D/WifiService( 3901): setWifiEnabled: true pid=5956, uid=1000
E/WifiService( 3901): Invoking mWifiStateMachine.setWifiEnabled
D/WifiController( 3901): WifiController msg { when=0 what=155656 target=com.android.internal.util.StateMachine$SmHandler } deferred for 313ms
D/WifiService( 3901): setWifiEnabled: false pid=5956, uid=1000
E/WifiService( 3901): Invoking mWifiStateMachine.setWifiEnabled
D/WifiController( 3901): DEFERRED_TOGGLE handled
D/WifiService( 3901): setWifiEnabled: true pid=5956, uid=1000
E/WifiService( 3901): Invoking mWifiStateMachine.setWifiEnabled
D/SoftapController( 3507): Softap fwReload - Ok
And then.... all of a sudden a wild google appeared!
Big thanks to @gladiac
Build coming soon!
CTXz said:
And then.... all of a sudden a wild google appeared!
Big thanks to @gladiac
Build coming soon!
Click to expand...
Click to collapse
Thanks a lot for the effort you're putting into this.
New build 19/12/2015
This build is no longer PRE-ALPHA but ALPHA
**********
19/12/2015 - ROM is now ALPHA
- Fixed Wifi
**********
CTXz said:
And then.... all of a sudden a wild google appeared!
Big thanks to @gladiac
Build coming soon!
Click to expand...
Click to collapse
Ok, this convinced me, sdcard 4th, wifi 3rd. Build on the T810 stack is running.

[ROM][p6800][p6810][i815]LineageOS CM-13.0 [UNOFFICIAL]

{
"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"
}
This is an unofficial port of LineageOS cm-13.0. I'm a beginner in building custom roms, so please be patient with me. This rom is based on the device tree of DanielHK with small modifications to run smooth with its low memory.
Code:
#include <std_disclaimer.h>
/*
* Your warranty is now void.
*
* We are not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, we will laugh at you.
*
*/
Release Notes
2017-10-23: Update to current cm-13 including fixes to avoid WPA2 KRACK for p6800, p6810, i815.
2017-09-12: Finally, I managed to compile a version for i815 but telephony/mobile data does not work
2017-08-23: Stabilized the new Browser, alias Gello - it formerly crashed, e.g. when opening our XDA page; Deactivated bluetooth again, since it is not done and crashed. It is still a long way: I assume I have to adopt the current Lineageos bluetooth app like Daniel did before: https://github.com/danielhk/android_packages_apps_Bluetooth. Daniels is outdated, unfortunately, cannot be used right away.
2017-07-27: Optimizations ZRAM, ISM and read_ahead also for P6810. Tried to activate bluetooth following danielhks guide. Succeeded with 3.1 in the guide - testing on command line. But in ROM it crashes when I try to activate BT via Settings.
2017-07-24: Video streaming and playback fixed with help from Bauner - native media codecs work now - meaning Youtube in preinstalled browser works now and also playing local mp4 files. I found that some optimizations (e.g. ZRAM) are not yet applied in P6810, because of a separate init.rc (-wifi) -> will be fixed in next release
2017-07-15: Auto-rotation fixed! And GPS works again, too. (got lost again in last build)
2017-07-13: Changed default orientation to Portrait. Deactivated DRM again on P6800, since mediaserver crashed in libwvdrmengine.so - and by that Youtube also broke in playing - now Youtube runs fine, but Play Movies does still not. On P6810 hopefully both works (Could not find a difference yet). Still the rotation issue is there, not from the beginning but during usage the orientation freezes somewhen...
2017-07-10: Further speed improvements, deactivating swipe in AOSP keyboard, what crashed
2017-07-09: GPS fixed, thanks to p3dboard - I was able to add a NON_PIE_SUPPORT
2017-07-07: Add several tweaks for memory usage and disk r/w speed, changed dpi to 202
2017-06-28: first release
Installation
Download the ROM and optionally GApps (ARM-6.0-pico) onto your device
Reboot tablet into TWRP recovery. I use version 3.0.2-0 here.
Wipe data, cache, dalvik/art-cache and system. Coming from stock rom, also wipe internal sd.
Flash ROM and GApps.
Reboot System. (First boot takes 5-6 minutes. Be patient.)
Root
Download SuperSU version BETA-SuperSU-v2.52.zip and install via TWRP recovery, newer releases will not work.
Not working
Bluetooth - crash when activating via Settings
DRM playback (google play movies) crashes. But after the crash starts playing on P6810!?! Currently, playback on P6810 is not smooth anymore, caused by the new codecs setup. Will investigate further.
Recent Amazon Kindle app crashes -> use an older one 4.24.0.27 or just delete libunwind.so in /data/app/...kindle directory
Internal mount of sd-card does not work -> use portable mode
Source
See source information on androidfilehost, too
XDA:DevDB Information
LineageOS CM-13.0, ROM for the Samsung Galaxy Tab 7.7
Contributors
frami2, danielhk, p3dboard, bauner
ROM OS Version: 6.0.x Marshmallow
Version Information
Status: Beta
Created 2017-06-29
Last Updated 2017-10-25
thank you, downloaded & now it is under testing.
Great job, i will check back on my notes, i definitely have information on a drm playback fix, and should have notes on Bluetooth from what Daniel told me, you have to use an external Bluetooth library, and remove one of the built-in Bluetooth apks from memory via the manifest.xml...i might have a chance later today to dig out the information. I think i had the notes in the build notes on my androidfilehost area.
Actually for Drm we needed newer blob files from memory. If you know the files that need updating from my notes, grab newer copies of the files from the Galaxy s2 lineageos builds, as i think we got the l3 drm Widevine library from the android one google devices
Edit:
Just looking back at old posts to do with the Galaxy s2 phone, this is the url where they got updated widevine L3 blobs for drm Google play movies to work.
Nougat / cm 14.1
https://github.com/RonGokhale/proprietary_vendor_sony/tree/nougat/nicki
Cm 13
https://github.com/RonGokhale/proprietary_vendor_sony/tree/cm-13.0/nicki
Look under the /proprietary/vendor/lib area for the files
Original Source for the WideVine blobs
https://github.com/TheMuppets/proprietary_vendor_sony/tree/cm-13.0/nicki/proprietary/vendor/lib
Just flashed it on my P6810, its feeling quite smooth. So far apart from the bugs noted above, I noticed that the Recent Apps view isn't showing a little image of the application, but that's not a major issue, you can still see the applications to swap between via the title bar it shows.
I've attached the Widevine L3 files from the cm13 repository link, from the Muppets github, if we replace the ones in your current build with these, that should fix the DRM playback
Edit: I just tested Google Play Movies with the existing Widevine L3 files in your build, and the Flash Season 3 played fine, the film Independance Day also played fine, so I think your Rom is fine as far as DRM playback goes.
Edit: Removed the .ZIP file, as that wasn't actually the .SO files, but html files (so if anyone downloaded the .ZIP - don't use those files). Anyway, it looks like it isn't needed
Edit: Re-uploaded ZIP with the real .SO files - Just incase you need them for testing.
p3dboard said:
Just flashed it on my P6810, its feeling quite smooth. So far apart from the bugs noted above, I noticed that the Recent Apps view isn't showing a little image of the application, but that's not a major issue, you can still see the applications to swap between via the title bar it shows.
I've attached the Widevine L3 files from the cm13 repository link, from the Muppets github, if we replace the ones in your current build with these, that should fix the DRM playback
Edit: I just tested Google Play Movies with the existing Widevine L3 files in your build, and the Flash Season 3 played fine, the film Independance Day also played fine, so I think your Rom is fine as far as DRM playback goes.
Edit: Removed the .ZIP file, as that wasn't actually the .SO files, but html files (so if anyone downloaded the .ZIP - don't use those files). Anyway, it looks like it isn't needed
Edit: Re-uploaded ZIP with the real .SO files - Just incase you need them for testing.
Click to expand...
Click to collapse
Many thanks Peter! Just wanted to ask you regarding DRM since you are the expert
I already tried different approaches - media/drm always crashed...will try to integrate your suggestions once I have time to.
Currently, I still struggle with lagging once all Google apps are installed and switching between those - playing around with all these low-ram optimization hints.
Hi Peter,
just tried to integrate the DRM blobs (libMc* would'nt be needed really, right?):
Code:
# drm blobs
PRODUCT_COPY_FILES += \
vendor/samsung/smdk4210-tab/props/system/lib/libMcClient.so:system/lib/libMcClient.so \
vendor/samsung/smdk4210-tab/props/system/lib/libMcRegistry.so:system/lib/libMcRegistry.so \
vendor/samsung/smdk4210-tab/props/system/lib/libMcVersion.so:system/lib/libMcVersion.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/libdrmdecrypt.so:system/lib/libdrmdecrypt.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/libwvm.so:system/vendor/lib/libwvm.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/drm/libdrmwvmplugin.so:system/vendor/lib/drm/libdrmwvmplugin.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/libwvdrm_L3.so:system/vendor/lib/libwvdrm_L3.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/libWVStreamControlAPI_L3.so:system/vendor/lib/libWVStreamControlAPI_L3.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/mediadrm/libwvdrmengine.so:system/vendor/lib/mediadrm/libwvdrmengine.so \
additionally, I already had in the init.smdk4210.rc:
# for DRM
symlink -s /vendor /system/vendor
Again, it fails when I try to play any movie in Google Play Movies:
Code:
07-04 20:04:22.675 14454 14487 F libc : Fatal signal 4 (SIGILL), code 1, fault addr 0x434038a4 in tid 14487 (Binder_1)
07-04 20:04:22.692 3398 3410 I art : Background partial concurrent mark sweep GC freed 5950(463KB) AllocSpace objects, 10(1528KB) LOS objects, 19% free, 13MB/16MB, paused 2.001ms total 116.753ms
07-04 20:04:22.720 1830 1830 I DEBUG : property debug.db.uid not set; NOT waiting for gdb.
07-04 20:04:22.720 1830 1830 I DEBUG : HINT: adb shell setprop debug.db.uid 100000
07-04 20:04:22.720 1830 1830 I DEBUG : HINT: adb forward tcp:5039 tcp:5039
07-04 20:04:22.866 3398 5723 D WifiService: New client listening to asynchronous messages
07-04 20:04:22.878 1830 1830 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-04 20:04:22.878 1830 1830 F DEBUG : LineageOS Version: '13.0-20170703-UNOFFICIAL-p6800'
07-04 20:04:22.878 1830 1830 F DEBUG : Build fingerprint: 'samsung/GalaxyTab/GT-P6800:6.0.0/MDB08M:userdebug/release-keys'
07-04 20:04:22.878 1830 1830 F DEBUG : Revision: '0'
07-04 20:04:22.878 1830 1830 F DEBUG : ABI: 'arm'
07-04 20:04:22.878 3398 5818 W NativeCrashListener: Couldn't find ProcessRecord for pid 14454
07-04 20:04:22.878 1830 1830 F DEBUG : pid: 14454, tid: 14487, name: Binder_1 >>> /system/bin/mediaserver <<<
07-04 20:04:22.878 1830 1830 E DEBUG : AM write failed: Broken pipe
07-04 20:04:22.878 1830 1830 F DEBUG : signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x434038a4
07-04 20:04:22.880 14423 14491 W ResourceType: No package identifier when getting value for resource number 0x00000000
07-04 20:04:22.925 3398 5731 E AudioService: Media server started.
07-04 20:04:22.935 1830 1830 F DEBUG : r0 00000056 r1 00000034 r2 00000020 r3 434038a5
07-04 20:04:22.935 1830 1830 F DEBUG : r4 4349ebe8 r5 40133000 r6 406e384c r7 4013301e
07-04 20:04:22.935 1830 1830 F DEBUG : r8 40133000 r9 434532af sl 00008e64 fp 0019660d
07-04 20:04:22.935 1830 1830 F DEBUG : ip 43446020 sp 43143fb8 lr 40113045 pc 434038a4 cpsr 200f0030
07-04 20:04:22.938 1830 1830 F DEBUG :
07-04 20:04:22.938 1830 1830 F DEBUG : backtrace:
07-04 20:04:22.938 1830 1830 F DEBUG : #00 pc 000c78a4 /system/vendor/lib/mediadrm/libwvdrmengine.so
07-04 20:04:22.938 1830 1830 F DEBUG : #01 pc 00000043 <unknown>
Is there anything I'm missing?
Best regards,
Frank
frami2 said:
Hi Peter,
just tried to integrate the DRM blobs (libMc* would'nt be needed really, right?):
additionally, I already had in the init.smdk4210.rc:
# for DRM
symlink -s /vendor /system/vendor
Again, it fails when I try to play any movie in Google Play Movies:
Is there anything I'm missing?
Best regards,
Frank
Click to expand...
Click to collapse
Hi Frank,
Your line for the libdrmdecrypt.so was sending it to the /system/lib folder, it should go to /system/vendor/lib, and I don't think the libMc* files are needed as you say, as I have never needed them before. I've attached a flashable version of the Widevine L3 blobs for CM13, which works fine on my p6810.
so your code should read as
Code:
# drm blobs
PRODUCT_COPY_FILES += \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/libdrmdecrypt.so:system/vendor/lib/libdrmdecrypt.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/libwvm.so:system/vendor/lib/libwvm.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/drm/libdrmwvmplugin.so:system/vendor/lib/drm/libdrmwvmplugin.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/libwvdrm_L3.so:system/vendor/lib/libwvdrm_L3.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/libWVStreamControlAPI_L3.so:system/vendor/lib/libWVStreamControlAPI_L3.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/mediadrm/libwvdrmengine.so:system/vendor/lib/mediadrm/libwvdrmengine.so \
Regards,
Peter
p3dboard said:
Hi Frank,
Your line for the libdrmdecrypt.so was sending it to the /system/lib folder, it should go to /system/vendor/lib, and I don't think the libMc* files are needed as you say, as I have never needed them before. I've attached a flashable version of the Widevine L3 blobs for CM13, which works fine on my p6810.
so your code should read as
Code:
# drm blobs
PRODUCT_COPY_FILES += \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/libdrmdecrypt.so:system/vendor/lib/libdrmdecrypt.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/libwvm.so:system/vendor/lib/libwvm.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/drm/libdrmwvmplugin.so:system/vendor/lib/drm/libdrmwvmplugin.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/libwvdrm_L3.so:system/vendor/lib/libwvdrm_L3.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/libWVStreamControlAPI_L3.so:system/vendor/lib/libWVStreamControlAPI_L3.so \
vendor/samsung/smdk4210-tab/props/system/vendor/lib/mediadrm/libwvdrmengine.so:system/vendor/lib/mediadrm/libwvdrmengine.so \
Regards,
Peter
Click to expand...
Click to collapse
I again put the files from your zip into the device tree and updated the /vendor/samsung/smdk4210-tab/blobs.mk accordingly. Building, flashing - still it crashes when trying to play any movie with the above logcat. Any idea? Is p6800 any different in these terms to p6810? Or is it depending on the media I try to play? I have some free movies like "BIG" or "BLANK" in my collection which I test with.
frami2 said:
I again put the files from your zip into the device tree and updated the /vendor/samsung/smdk4210-tab/blobs.mk accordingly. Building, flashing - still it crashes when trying to play any movie with the above logcat. Any idea? Is p6800 any different in these terms to p6810? Or is it depending on the media I try to play? I have some free movies like "BIG" or "BLANK" in my collection which I test with.
Click to expand...
Click to collapse
Hi Frank,
I also have those free movies, big and blank, and on my P6810 they play fine. Your original Widevine L3 blobs in your p6810 rom also worked fine for me under LineageOS 13, so I think your original files were fine.
I can see from my original Slim Rom build notes, that I had put libdrmdecrypt.so in the /system/lib folder, so I think it can work from either location.
Did you try just flashing the flashable version of the Blob's I attached in the previous post after flashing your Rom? It would be interesting to see if that makes any difference, it sets the permissions on the blob files as well to 644, which they need to be to work.
There's an app called "DRM Info" that I use from the play store to confirm that it can load the Widevine DRM libraries fine.
What changes do you make between the two Rom builds (for P6810 and P6800)?
Is it just this change?
Code:
FILE: /device/samsung/smdk4210-tab/device.mk
# **************************************
# * modify file and add these contents *
# **************************************
#adjust to wifi only for p6810 - modify according to device type, p6800, i815 - same as CM 12.1 build format - check CM 12.1 library for references
# common_full_tablet_wifionly.mk - p6810
# common_full_tablet_lte.mk - p6800
Btw, I believe (but haven't tested it), that you can flash the p6810 rom on a p6800 (but you won't have Mobile Data support), and you can probably test to see if the Google Play movies works over Wifi with your p6810 build, as the original build you made for me works without the updated Widevine L3 package.
Edit: Just looked over Daniels Repository - https://github.com/danielhk/proprie...10/tree/cm-13.0/smdk4210-tab/props/system/lib
Looks like he has two files in the /system/lib, libdrmdecrypt.so and libwvm.so - so change the code to update these two files, as it could be that you have a duplicate file, one old and one new, and this is causing the issue.
Hi,
Just installed your ROM for tests. Looks promising
I have only issue with GPS. I don't see any NMEA messages.
Regards,
test_user7 said:
Hi,
Just installed your ROM for tests. Looks promising
I have only issue with GPS. I don't see any NMEA messages.
Regards,
Click to expand...
Click to collapse
I just tried the gps on my p6810 and see its not working. It's probably because the non-pie blob support hasn't been enabled in the linker library as the gps blob/driver is old and needs this enabled.
Frank, there's notes in my slim rom compile notes on how to do this in linker.cpp from memory, the line numbers will probably be slightly different, but the code additions should help you locate the bits that need updating.
p3dboard said:
Hi Frank,
I also have those free movies, big and blank, and on my P6810 they play fine. Your original Widevine L3 blobs in your p6810 rom also worked fine for me under LineageOS 13, so I think your original files were fine.
I can see from my original Slim Rom build notes, that I had put libdrmdecrypt.so in the /system/lib folder, so I think it can work from either location.
Did you try just flashing the flashable version of the Blob's I attached in the previous post after flashing your Rom? It would be interesting to see if that makes any difference, it sets the permissions on the blob files as well to 644, which they need to be to work.
There's an app called "DRM Info" that I use from the play store to confirm that it can load the Widevine DRM libraries fine.
What changes do you make between the two Rom builds (for P6810 and P6800)?
Is it just this change?
Code:
FILE: /device/samsung/smdk4210-tab/device.mk
# **************************************
# * modify file and add these contents *
# **************************************
#adjust to wifi only for p6810 - modify according to device type, p6800, i815 - same as CM 12.1 build format - check CM 12.1 library for references
# common_full_tablet_wifionly.mk - p6810
# common_full_tablet_lte.mk - p6800
Btw, I believe (but haven't tested it), that you can flash the p6810 rom on a p6800 (but you won't have Mobile Data support), and you can probably test to see if the Google Play movies works over Wifi with your p6810 build, as the original build you made for me works without the updated Widevine L3 package.
Edit: Just looked over Daniels Repository - https://github.com/danielhk/proprie...10/tree/cm-13.0/smdk4210-tab/props/system/lib
Looks like he has two files in the /system/lib, libdrmdecrypt.so and libwvm.so - so change the code to update these two files, as it could be that you have a duplicate file, one old and one new, and this is causing the issue.
Click to expand...
Click to collapse
The zip file is not flashable in TWRP, anyhow, the chmod 644 even 777 does not help. DRM Info shows that Widevine is missing. I checked for differences between p6800 and p6810. This is in /device/samsung/p80XX/ and actually in the kernel too, the
/kernel/samsung/smdk4210/arch/arm/configs/cyanogenmod_p68XX_defconfig. Every change I made is same for both, only difference is regarding RIL. Anyhow, the defconfig files differ in many areas, maybe also due to RIL - here I try a strange hack now - use the P6810 defconfig for p6800. Let's see.
Furthermore, I found a workaround for the Amazon Kindle startup crash issue. In its crash stack I found libunwind.so. Replacing libunwind.so in /data/app/com.amazon.kindle-1/lib/arm/ with the one from /system/lib -> Kindle works
Just read this thread and start play again
My P6800 flash rom with Pico Gapp but seems running not smooth and found out some common issues:
- flash SuperSU 2.82 zip through TWRP successful but not get rooted can not use Kernel app.
- play YouTube: all have stopped with black screen just few seconds after running then replay. All clips get same problem.
Have no idea but seems it needs fix more.
One more thing the brightness of screen very low even manual with brightness maximum.
p3dboard said:
I just tried the gps on my p6810 and see its not working. It's probably because the non-pie blob support hasn't been enabled in the linker library as the gps blob/driver is old and needs this enabled.
Frank, there's notes in my slim rom compile notes on how to do this in linker.cpp from memory, the line numbers will probably be slightly different, but the code additions should help you locate the bits that need updating.
Click to expand...
Click to collapse
Thanks! But the changes cannot directly applied to cm13.0 there were some changes. I at least found that in cm14.1 the ENABLE_NON_PIE_SUPPORT is included in the standard. Will investigate further.
Harrison Le said:
Just read this thread and start play again
My P6800 flash rom with Pico Gapp but seems running not smooth and found out some common issues:
- flash SuperSU 2.82 zip through TWRP successful but not get rooted can not use Kernel app.
- play YouTube: all have stopped with black screen just few seconds after running then replay. All clips get same problem.
Have no idea but seems it needs fix more.
One more thing the brightness of screen very low even manual with brightness maximum.
Click to expand...
Click to collapse
- SuperSU 2.82 will not work, I updated the details on page 1
- YouTube plays fine on my P6800, tried different videos, e.g. the 4k demo videos (playing in 720p on our device ) <- do the installation with a full wipe, as described, then you should get it working - use the new version I uploaded yesterday, but it worked on the first version already.
- I also don't see the brightness thing. It is the same brightness like in TWRP recovery (auto brightness also working ... in slow steps) - maybe also due to wrong flashing method
frami2 said:
- SuperSU 2.82 will not work, I updated the details on page 1
Click to expand...
Click to collapse
We can install version 2.52 (https://download.chainfire.eu/743/supersu) from recovery and then update to 2.82 from Play store.
Hi Frank @frami2,
Just tested the latest build, 10/7, seems to be smoother, I seem to have more free Ram at boot, according to the program diskinfo, I have 370mb free ram, I think the last builds I had 280mb free ram. Also I tested the GPS and its working fine now on the p6810 Glad my notes helped you.
Hopefully my notes on how Daniel got the Bluetooth going (and how I got it going) might help you to fix that. From memory Daniel was working on a way under CM13 / LineageOS 13 to still have the normal Android Bluetooth stack going, along with the Bluez bluetooth stack - some sort of Compile switch from memory, a build directive. The method under CM 12.1 was to disable / remove the libraries the ASOP bluetooth stack and just enable the Bluez stack. This method probably still works, and might be the quickest way to get it going.
I've attached a screenshot of DRM info on my p6810 - this is what you should see on the p6800 when DRM is working. I know that DRM is a bit tricky, once you have all the bits in place, it just works. If it was broken on my p6810, that might make it easier for me to figure out what is wrong, but its working
Edit: tested your latest build, from July 13th, drm is still working fine on the p6810.
Just clean flash LOS build jul-13th incl. SuperSU-V2.52 and pico gapp, it is smooth than before a lot but still have some issues as below:
1. SuperSU updated to V.2.82 but poplock at SuperSU binary need to be updated.
2. Pull down status bar make screen turn to black and lock screen always black too
3. Set up screen at vertical but after reset the screen always turn to horizontal at black screen.
4. For video play: last ROMs issue are YouTube app be stopped awhile after start, YouTube and clip in browsers play OK but this ROM up side down: YouTube app play OK but video in browsers have crashed.
5. Bluetooth not active
6. ...........
Attached is video play in browsers be crashed
Edited: can not up picture from XDA app...
Harrison Le said:
Just clean flash LOS build jul-13th incl. SuperSU-V2.52 and pico gapp, it is smooth than before a lot but still have some issues as below:
1. SuperSU updated to V.2.82 but poplock at SuperSU binary need to be updated.
2. Pull down status bar make screen turn to black and lock screen always black too
3. Set up screen at vertical but after reset the screen always turn to horizontal at black screen.
4. For video play: last ROMs issue are YouTube app be stopped awhile after start, YouTube and clip in browsers play OK but this ROM up side down: YouTube app play OK but video in browsers have crashed.
5. Bluetooth not active
6. ...........
Attached is video play in browsers be crashed
Edited: can not up picture from XDA app...
Click to expand...
Click to collapse
Hi, thanks for testing!
1. Right, install SuperSU-V2.52 and then try to update and finally update binary. The last step takes a while but always returned on my device, with success or unsuccessful - trying again after reboot it finally succeeded
2. Yes, this and the screenshots in app-drawer are missing - this is intended by the "LOW_RAM" configuration I set (https://source.android.com/devices/tech/config/low-ram)
3. I will upload a new version with fixed auto-rotation soon - still, the picture change comes with a black screen sometimes
4. Have to check the youtube in browser issue - this sounds more serious. Do you have a P6800 or P6810? Could you check the youtube app? This should play fine - and will even rotate on next version
5. Sure, had no time yet to implement ( a guide how to is there by p3dboard)
frami2 said:
Hi, thanks for testing!
1. Right, install SuperSU-V2.52 and then try to update and finally update binary. The last step takes a while but always returned on my device, with success or unsuccessful - trying again after reboot it finally succeeded
2. Yes, this and the screenshots in app-drawer are missing - this is intended by the "LOW_RAM" configuration I set (https://source.android.com/devices/tech/config/low-ram)
3. I will upload a new version with fixed auto-rotation soon - still, the picture change comes with a black screen sometimes
4. Have to check the youtube in browser issue - this sounds more serious. Do you have a P6800 or P6810? Could you check the youtube app? This should play fine - and will even rotate on next version
5. Sure, had no time yet to implement ( a guide how to is there by p3dboard)
Click to expand...
Click to collapse
About 4. again - I'm currently running Youtube in Chrome without issues (on P6800 with deactivated DRM). it works in fullscreen and window mode.

[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