[DEV-Only] 3.x Kernel for Xperia X10 - XPERIA X10 Android Development

As some may know, I'm getting headaches since months (I'm not a professional dev ...) to port 3.0.8 kernel on x10.
I'm opening a new thread to talk about progress on 3.x kernel ported to the
ES209RA..
I'd like to share the work I've made since last year and involve as much people as it's possible.
I'll try to keep this thread updated with "what is working" and a "to do" or "to fix list" ...
You've been warned : this a development thread, and until kernel is "officialy" relased, flashing stuff or adding changes in kernel and flashing it on your device without knowing what you do may damage your phone.
Important notice :
This is not a thread to teach "how to port" or else ...
However when the time will come, testers will be needed, posts will be make to have report etc ...
Don't ask for ETA ...
Thanks a lot for understanding

Kernel 3.0.8 porting
Ported on X10 from msm7x30-3.0.x-nAa
Thanks to :
nAa for his sources and his thread to get serial console,
Fxp, Doomlord, Androxyde for there answer to my annoying questions about serial console ,
Achotjan, Feravolt, Scritch and all other who helped me a lot since I started this project.
The link to my repo : Tof37-Github
For now this kernel is just made to be used as a base.
What is working :
Kernel is built with almost all ES209RA drivers (I think ar6000 are missing, nothing else)
it boots
Display is (finally) working
Rom (tested with an old CM9) is booting. Also booting on CM10.1 and 4.2.2 aosp (strange display problem with aosp)
ADB is working (dmesg and logcat can be done)
Battery chatging is working, data and led color are ok too
Got rom display. (Cm10.1 maybe others) ... for a stock configuration it's not so bad ...
Bug list :
QDSP6 has to be disabled, smsm modem is reseting
Recovery key access mismatch (it works only when it wants ...)
Added needed files and lines in defconfig to build ar6000.ko.
Have to port some codes in msm_sdcc.c for plat_disable_wlan_slot and plat_enable_wlan_slot ... seems to be needed to turn wifi on and off ...
Added lines in defconfig to enable bluetooth ... still not working
maybe more I don't even know ...
To do:
Fix known bugs
Had necessary changes in ramdisk

Kernel 3.4.0
WIP ... don't fully build

Thanks Nice work

reserved :
thanks tof you are definitly change the future ofxperia x10
cheers
Achotjan

i'm ready for testing

Log for qdsp crash
Here is the log I got with qdsp6 enabled :
PHP:
[ 12.548407] ------------[ cut here ]------------
[ 12.548533] WARNING: at drivers/gpio/gpiolib.c:101 gpio_ensure_requested+0x4c/0xfc()
[ 12.548695] autorequest GPIO-149
[ 12.548766] Modules linked in:
[ 12.548864] [<c0047010>] (unwind_backtrace+0x0/0xf0) from [<c0089af4>] (warn_slowpath_common+0x4c/0x64)
[ 12.549893] [<c0089af4>] (warn_slowpath_common+0x4c/0x64) from [<c0089b8c>] (warn_slowpath_fmt+0x2c/0x3c)
[ 12.559441] [<c0089b8c>] (warn_slowpath_fmt+0x2c/0x3c) from [<c0270708>] (gpio_ensure_requested+0x4c/0xfc)
[ 12.569079] [<c0270708>] (gpio_ensure_requested+0x4c/0xfc) from [<c0270928>] (gpio_direction_output+0x74/0x158)
[ 12.579157] [<c0270928>] (gpio_direction_output+0x74/0x158) from [<c00728ec>] (analog_init+0x18/0x28)
[ 12.588348] [<c00728ec>] (analog_init+0x18/0x28) from [<c0070e40>] (q6audio_init+0x214/0x2e4)
[ 12.596855] [<c0070e40>] (q6audio_init+0x214/0x2e4) from [<c0072490>] (q6audio_open_pcm+0x20/0x200)
[ 12.605883] [<c0072490>] (q6audio_open_pcm+0x20/0x200) from [<c0072b8c>] (pcm_ioctl+0x1d0/0x3f4)
[ 12.614658] [<c0072b8c>] (pcm_ioctl+0x1d0/0x3f4) from [<c01153a8>] (do_vfs_ioctl+0x508/0x584)
[ 12.623158] [<c01153a8>] (do_vfs_ioctl+0x508/0x584) from [<c0115458>] (sys_ioctl+0x34/0x54) MODEM/AMSS has CRASHED
[ 12.631502] [<c0115458>] (sys_ioctl+0x34/0x54) from [<c0042480>] (ret_fast_syscall+0x0/0x30)
[ 12.639903] ---[ end trace 47a718f49542dde2 ]---
[ 12.690778]
[ 12.690789] SMSM: Modem SMSM state changed to SMSM_RESET.
[ 12.691454] Notify: start reset
[ 14.336724]
[ 14.337405] smem: CRASH LOG
[ 14.337410] 'ERR crash log report. Version 2.
In analog_audio.c adding (like KTG .32 kernel)
PHP:
gpio_request(GPIO_HEADSET_AMP, NULL)
solved the warning ...but not the crash still having :
PHP:
[ 17.020205] [pcm_out.c:pcm_open] open
<6>[ 17.020852] [q6audio.c:q6audio_init] codecs
<6>[ 17.021094] [q6audio.c:q6audio_init] attach ADSP
<6>[ 17.128602] [dal.c:dal_attach] status = 0, name = 'DAL_AQ_AUD' dal_client d5c24000
<6>[ 17.128795] [q6audio.c:q6audio_init] INIT
<6>[ 17.130021] [q6audio.c:q6audio_init] OPEN control
<6>[ 17.540540] [q6audio.c:q6audio_init] attach ACDB
<6>[ 17.644275] [dal.c:dal_attach] status = 0, name = 'DAL_AM_AUD' dal_client d5eb5800
<6>[ 17.644442] [q6audio.c:q6audio_init] attach ADIE
<6>[ 17.644841] [dal.c:dal_attach] status = 0, name = 'DAL_AM_AUD' dal_client d5eb5400
<3>[ 17.665947]
<3>[ 17.665958] SMSM: Modem SMSM state changed to SMSM_RESET.
<3>[ 17.666632] Notify: start reset
nothing more for now

Try this in config:
Code:
CONFIG_MSM_QDSP6=y
CONFIG_MSM_AUDIO_QDSP6=y //this one wants - SND_SOC_MSM_QDSP6_INTF
# CONFIG_MSM_QDSP6_APR is not set
# CONFIG_QSD_AUDIO is not set
p.s. can you send me your 51-android.rules file.. I messed up usb permissions and adb says:
error: insufficient permissions for device
I have this:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", MODE="0777"
EDIT>nvm.. fixed changing device permissions to 666

FeraVolt said:
Try this in config:
Code:
CONFIG_MSM_QDSP6=y
CONFIG_MSM_AUDIO_QDSP6=y //this one wants - SND_SOC_MSM_QDSP6_INTF
# CONFIG_MSM_QDSP6_APR is not set
# CONFIG_QSD_AUDIO is not set
p.s. can you send me your 51-android.rules file.. I messed up usb permissions and adb says:
error: insufficient permissions for device
I have this:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", MODE="0777"
EDIT>nvm.. fixed changing device permissions to 666
Click to expand...
Click to collapse
Will try
BTW think where something is messing ... qdsp6 needs "ac" (qs6audio.c line 971)
PHP:
pr_info("[%s:%s] attach ADIE\n", __MM_FILE__, __func__);
adie = dal_attach(ADIE_DAL_DEVICE, ADIE_DAL_PORT, 0, 0, 0);
if (!adie) {
pr_err("[%s:%s] cannot attach to adie\n",
__MM_FILE__, __func__);
res = -ENODEV;
goto done;
}
if (analog_ops->init)
analog_ops->init();
res = 0;
ac_control = ac;
but ... if you look at the log on google drive (log 3.0.8 ... boot sur cm9, sans qdsp6)
you'll see that
PHP:
sysfs: cannot create duplicate filename '/class/power_supply/ac'
I think the problem is there ... if I revert this commit
it doesn't work either cause mx17040 doesn't probe as it should...
let's sleep now

How about this <mach/msm_qdsp6_audio.h>:
Code:
/* arch/arm/mach-msm/include/mach/msm_qdsp6_audio.h
*
* Copyright (C) 2009 Google, Inc.
* Author: Brian Swetland <[email protected]>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _MACH_MSM_QDSP6_Q6AUDIO_
#define _MACH_MSM_QDSP6_Q6AUDIO_
#define AUDIO_FLAG_READ 0
#define AUDIO_FLAG_WRITE 1
#define AUDIO_FLAG_INCALL_MIXED 2
#include <linux/wait.h>
struct audio_buffer {
dma_addr_t phys;
void *data;
uint32_t size;
uint32_t used; /* 1 = CPU is waiting for DSP to consume this buf */
uint32_t actual_size; /* actual number of bytes read by DSP */
};
struct audio_client {
struct audio_buffer buf[2];
int cpu_buf; /* next buffer the CPU will touch */
int dsp_buf; /* next buffer the DSP will touch */
int running;
int session;
wait_queue_head_t wait;
struct dal_client *client;
int cb_status;
uint32_t flags;
};
/* Obtain a 16bit signed, interleaved audio channel of the specified
* rate (Hz) and channels (1 or 2), with two buffers of bufsz bytes.
*/
struct audio_client *q6audio_open_pcm(uint32_t bufsz, uint32_t rate,
uint32_t channels, uint32_t flags,
uint32_t acdb_id);
struct audio_client *q6voice_open(uint32_t flags);
struct audio_client *q6audio_open_mp3(uint32_t bufsz, uint32_t rate,
uint32_t channels, uint32_t acdb_id);
struct audio_client *q6audio_open_dtmf(uint32_t rate, uint32_t channels,
uint32_t acdb_id);
int q6audio_play_dtmf(struct audio_client *ac, uint16_t dtmf_hi,
uint16_t dtmf_low, uint16_t duration, uint16_t rx_gain);
struct audio_client *q6audio_open_aac(uint32_t bufsz, uint32_t samplerate,
uint32_t channels, uint32_t bitrate,
uint32_t stream_format, uint32_t flags,
uint32_t acdb_id);
struct audio_client *q6audio_open_qcp(uint32_t bufsz, uint32_t min_rate,
uint32_t max_rate, uint32_t flags,
uint32_t format, uint32_t acdb_id);
struct audio_client *q6audio_open_amrnb(uint32_t bufsz, uint32_t enc_mode,
uint32_t dtx_enable, uint32_t flags,
uint32_t acdb_id);
int q6audio_close(struct audio_client *ac);
int q6voice_close(struct audio_client *ac);
int q6audio_mp3_close(struct audio_client *ac);
int q6audio_read(struct audio_client *ac, struct audio_buffer *ab);
int q6audio_write(struct audio_client *ac, struct audio_buffer *ab);
int q6audio_async(struct audio_client *ac);
int q6audio_do_routing(uint32_t route, uint32_t acdb_id);
int q6audio_set_tx_mute(int mute);
int q6audio_reinit_acdb(char* filename);
int q6audio_update_acdb(uint32_t id_src, uint32_t id_dst);
int q6audio_set_rx_volume(int level);
int q6audio_set_stream_volume(struct audio_client *ac, int vol);
int q6audio_set_stream_eq_pcm(struct audio_client *ac, void *eq_config);
struct q6audio_analog_ops {
void (*init)(void);
void (*speaker_enable)(int en);
void (*headset_enable)(int en);
void (*receiver_enable)(int en);
void (*bt_sco_enable)(int en);
void (*int_mic_enable)(int en);
void (*ext_mic_enable)(int en);
};
void q6audio_register_analog_ops(struct q6audio_analog_ops *ops);
/* signal non-recoverable DSP error so we can log and/or panic */
void q6audio_dsp_not_responding(void);
#endif

rom is not usable (EGL part in userspace has to be updated)
Click to expand...
Click to collapse
Disable MSM_ION.. I just ported it and got similar thing.. No bootanimation.. All openGles2 apps crashes.. UI glitches.. I'd like to look at how Achotjan ported it.. Maybe its foolish me..

FeraVolt said:
Disable MSM_ION.. I just ported it and got similar thing.. No bootanimation.. All openGles2 apps crashes.. UI glitches.. I'd like to look at how Achotjan ported it.. Maybe its foolish me..
Click to expand...
Click to collapse
Spent nearly the whole day with qddp problem... still crashing...
About display I think memory allocation is not perfect... disabling triple buffer ended with no display but booting rom...
will see that tonight...
Sent from my XT890 using xda app-developers app

Some news ...
Have just made a new build with latest adreno drivers ... and voilà !!!
Rom still not usable (flickering, ... ) but things are going on the good way

Tof37 said:
Some news ...
Have just made a new build with latest adreno drivers ... and voilà !!!
Rom still not usable (flickering, ... ) but things are going on the good way
Click to expand...
Click to collapse
Very nice . Can we have latest dmesg & logcat? And.. maybe you can somehow capture how it's flickering.. To undrstand where the dog lies.. :good:

FeraVolt said:
Very nice . Can we have latest dmesg & logcat? And.. maybe you can somehow capture how it's flickering.. To undrstand where the dog lies.. :good:
Click to expand...
Click to collapse
I'll upload the ftf file tonight and the logs as well.
Sent from my XT890 using xda app-developers app

This is awesome work Tof!
RE: this flickering issue.. I recall Scritch had similar issues when first porting CM10..
http://forum.xda-developers.com/showpost.php?p=34720912&postcount=32
Not sure what Rom you're loading, but perhaps this needs implementing or reversing if you've already included it?
Also: http://forum.xda-developers.com/showpost.php?p=34770510&postcount=37 for slightly more detail.

FeraVolt said:
Very nice . Can we have latest dmesg & logcat? And.. maybe you can somehow capture how it's flickering.. To undrstand where the dog lies.. :good:
Click to expand...
Click to collapse
Here is a link to the ftf file with 3.0.8 kernel booting on cm9 rom : here (to flash at your own risk on unlocked bootloader only )
Got a log and dmesg in google drive (check your gmail )
EDIT : don't mind about ro.config.disable_hw_accel=false in build.prop ... just something I thought it should be useful ... but no
blueowl0708 said:
This is awesome work Tof!
RE: this flickering issue.. I recall Scritch had similar issues when first porting CM10..
http://forum.xda-developers.com/showpost.php?p=34720912&postcount=32
Not sure what Rom you're loading, but perhaps this needs implementing or reversing if you've already included it?
Also: http://forum.xda-developers.com/showpost.php?p=34770510&postcount=37 for slightly more detail.
Click to expand...
Click to collapse
I have to check that ... I remember this patch ... but took the same msm diplay drivers ... will look Thanks

Tof37 said:
Here is a link to the ftf file with 3.0.8 kernel booting on cm9 rom : here
I have to check that ... I remember this patch ... but took the same msm diplay drivers ... will look Thanks
Click to expand...
Click to collapse
I thought the patch was for CM10 specifically - so if you're running CM9 while testing......... worth a look anyway!

blueowl0708 said:
I thought the patch was for CM10 specifically - so if you're running CM9 while testing......... worth a look anyway!
Click to expand...
Click to collapse
if you look at kernel .29 git in cmx10 repo, we managed to use the same kernel on ics and JB ......

Tof37 said:
if you look at kernel .29 git in cmx10 repo, we managed to use the same kernel on ics and JB ......
Click to expand...
Click to collapse
Fair does... just a thought

Related

[WIP] GL Enabled CM9 ICS

I am posting here because I do not have permission to post in the android dev forum. Thanks to j00m who helped post my ROM earlier in the dev forum, but I thought I should build up my posts to be able to post stuff myself too Here is another smaller system.img file that should work with stock hboot or blackrose (not tested) and has the home button working. The ROM should be considered alpha quality at best as is with other CM9 ROMs.
(system.img)
http://www.mediafire.com/?9lcz59qq8s1qgvb
boot.img (if you have one from drewis' alphas, you do not need to flash this.)
http://www.mediafire.com/?kilz59rjc8kug1m
Be sure to wipe data/cache before reboot. You should be able to use the google apps from userdata.img from one of drewis's alphas.
The ROM is built from CM9, with my changes to make use of the adreno GL drivers. Credits are due to the CM team and all whose code is included in CM9. There should be many to name and I do not want to miss out anyone who deserves credit.
Will post code changes soon. Need to clean it up. Hence the delay.
I hope that when I have enough posts to be privileged, this thread can be moved into the dev forum.
Enjoy!!
Here is the source patch.
diff --git a/frameworks/base/libs/gui/SurfaceTexture.cpp b/frameworks/base/libs/gui/SurfaceTexture.cpp
index c72a45b..9e425e3 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -246,6 +246,8 @@ status_t SurfaceTexture::requestBuffer(int slot, sp<GraphicBuffer>* buf) {
return NO_ERROR;
}
+#define MAX_SLEEPTIMEOUTS (5)
+
status_t SurfaceTexture::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
uint32_t format, uint32_t usage) {
ST_LOGV("SurfaceTexture::dequeueBuffer");
@@ -262,6 +264,9 @@ status_t SurfaceTexture::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
int found, foundSync;
int dequeuedCount = 0;
bool tryAgain = true;
+ int sleepTimeouts = 0;
+ bool eglWorkAround = true;
+
while (tryAgain) {
if (mAbandoned) {
ST_LOGE("dequeueBuffer: SurfaceTexture has been abandoned!");
@@ -342,6 +347,21 @@ status_t SurfaceTexture::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
// clients are not allowed to dequeue more than one buffer
// if they didn't set a buffer count.
if (!mClientBufferCount && dequeuedCount) {
+ LOGV("SurfaceTexture::dequeue: Not allowed to dequeue more than a "
+ "buffer\n");
+ if (eglWorkAround) {
+ if (sleepTimeouts++ < MAX_SLEEPTIMEOUTS) {
+ LOGD("SurfaceTexture::dequeue: Not allowed to dequeue more "
+ "than a buffer SLEEPING\n");
+ usleep(100000);
+ } else {
+ mClientBufferCount = mServerBufferCount;
+ LOGD("SurfaceTexture::dequeue: Not allowed to dequeue more "
+ "than a buffer RETRY mBufferCount:%d mServerBufferCount:%d\n",
+ mBufferCount, mServerBufferCount);
+ }
+ continue;
+ }
return -EINVAL;
}
@@ -353,6 +373,13 @@ status_t SurfaceTexture::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
// than allowed.
const int avail = mBufferCount - (dequeuedCount+1);
if (avail < (MIN_UNDEQUEUED_BUFFERS-int(mSynchronousMode))) {
+ if (eglWorkAround && mClientBufferCount != 0) {
+ mBufferCount++;
+ mClientBufferCount = mServerBufferCount = mBufferCount;
+ LOGD("SurfaceTexture::dequeuebuffer: MIN EXCEEDED "
+ "mBuffer:%d bumped\n", mBufferCount);
+ continue;
+ }
ST_LOGE("dequeueBuffer: MIN_UNDEQUEUED_BUFFERS=%d exceeded "
"(dequeued=%d)",
MIN_UNDEQUEUED_BUFFERS-int(mSynchronousMode),
@@ -700,8 +727,8 @@ status_t SurfaceTexture::updateTexImage() {
ST_LOGW("updateTexImage: clearing GL error: %#04x", error);
}
- glBindTexture(mTexTarget, mTexName);
- glEGLImageTargetTexture2DOES(mTexTarget, (GLeglImageOES)image);
+ glBindTexture(getCurrentTextureTarget(), mTexName);
+ glEGLImageTargetTexture2DOES(getCurrentTextureTarget(), (GLeglImageOES)image);
bool failed = false;
while ((error = glGetError()) != GL_NO_ERROR) {
@@ -736,7 +763,7 @@ status_t SurfaceTexture::updateTexImage() {
mDequeueCondition.signal();
} else {
// We always bind the texture even if we don't update its contents.
- glBindTexture(mTexTarget, mTexName);
+ glBindTexture(getCurrentTextureTarget(), mTexName);
}
return OK;
@@ -762,6 +789,9 @@ bool SurfaceTexture::isExternalFormat(uint32_t format)
}
GLenum SurfaceTexture::getCurrentTextureTarget() const {
+ if (mTexTarget == GL_TEXTURE_EXTERNAL_OES) {
+ return GL_TEXTURE_2D;
+ }
return mTexTarget;
}
diff --git a/frameworks/base/services/surfaceflinger/Layer.cpp b/frameworks/base/services/surfaceflinger/Layer.cpp
index 317cc3b..9e92e81 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -40,6 +40,8 @@
#include "SurfaceTextureLayer.h"
#define DEBUG_RESIZE 0
+#define GL_TEXTURE_EXTERNAL_OES GL_TEXTURE_2D
+
namespace android {
diff --git a/device/htc/passion-common/BoardConfigCommon.mk b/device/htc/passion-common/BoardConfigCommon.mk
index b86c580..e17da36 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -73,7 +73,7 @@ BOARD_VENDOR_USE_AKMD := akm8973
## Hardware rendering
## doesn't actually work until we have hwcomposer
-USE_OPENGL_RENDERER := true
+USE_OPENGL_RENDERER := false
BOARD_EGL_CFG := device/htc/passion-common/egl.cfg
## for rmcc egl hack
COMMON_GLOBAL_CFLAGS += \
On Media fire:
http://www.mediafire.com/?dxzyyfzzp9m6fu8
It works with OPENGL_RENDERER := true as well, but is quite slow and crashes often, with OPENGL_RENDERER := false things are much more stable and usable as is the ROM posted above.
Thanks.
Good job guy.Keep it up ,waiting for next version
mori90 said:
Good job guy.Keep it up ,waiting for next version
Click to expand...
Click to collapse
+1 Agreed. Cant wait to see what you and texasice does next.
Confirm it is working with blackrose. But what i noticed:
-Superuser crashes when trying to update the su binary.
-My USM App is corrupted. Filesize is 12 kb, instead of 38. When trying to use it (activate UMS) it prompts a toast saying "Superuser permission denied", but it doesn't even promt the request popup before; though there is no entry in the Superuser App list.
EDIT: After rm Superuser.apk and flashing the signed Superuser zip via recovery, using su works now.
That made it possible to use the UMS App again and also to use Titanium to restore all Gapps (incl. Account Setup).
Could you check the permissions on the actual su binary itself?
rapmv78 said:
Could you check the permissions on the actual su binary itself?
Click to expand...
Click to collapse
not any longer. :/ (see edited post above) btw: did you made any changes to my ums app? noticed the smaller file size and seems like some notifications are not there any longer!?
Most likely that the permission got fixed when you flashed the Superuser zip file. Good to know it is resolved. Have you seen any other issues pertaining to graphics? I am just curious to know how GL works for others
rapmv78 said:
Have you seen any other issues pertaining to graphics? I am just curious to know how GL works for others
Click to expand...
Click to collapse
So far not. Everything is fine. Played a few videos with diefferent formats without any issues amd now i'm populating the system with apps and restoring settings.. One thing (not gl related) i'm struggeling with, is to get the market running. for whatever reason every version i installed opens fine, let me connect to my google account but then says network error (in wifi and also mobile data mode). Same error with Maps.. I'll post updates as soon as i have some. But beside this, everything looks really good. Meanwhile i can offer a system report if that helps you to get any information: http://www.nahklick.de/user/stephan/android_report.html
Bexton said:
So far not. Everything is fine. Played a few videos with diefferent formats without any issues amd now i'm populating the system with apps and restoring settings.. One thing (not gl related) i'm struggeling with, is to get the market running. for whatever reason every version i installed opens fine, let me connect to my google account but then says network error (in wifi and also mobile data mode). Same error with Maps.. I'll post updates as soon as i have some. But beside this, everything looks really good. Meanwhile i can offer a system report if that helps you to get any information: http://www.nahklick.de/user/stephan/android_report.html
Click to expand...
Click to collapse
Regarding the market, did you try clearing the cache for the app and reboot (the usual method iirc) ? System report looks fine. Thanks.
rapmv78 said:
Regarding the market, did you try clearing the cache for the app and reboot (the usual method iirc) ?
Click to expand...
Click to collapse
yep, didn't solved it!? but stopped trying now.
at the moment i'm watching spiderman 3 in 720p x264 mkv format. trailer worked fine. full movie judderes a bit from time to time but it is running for 15 minutes now without hanging up or whatever.
edit: 1080p also works but is really slow and the judder effect is much bigger.
Thread moved to dev section and link to mediafire ok
What's working and what's not?
imfloflo said:
Thread moved to dev section and link to mediafire ok
Click to expand...
Click to collapse
second post, the link to media fire is not ok!
@j00m Fix
Thread moved in General Section to allow OP to respond for the moment
This ROM enables hardware acceleration for most of the tasks as used to be in gingerbread. Am interested in knowing the experience of others using this mod.
Thanks.
Trackball wakeup will have next next... version,right ???
Why this ver. is working perfect on wifi(Static IP) but texasice version is not ??
I am not sure about the difference with static IP working in this ROM v/s texas ice's. Also since I posted the source code and is in CM9, you should just be able to get more features out of the other ROMs than you would from me This ROM was more of a proof of concept to see if openGL acceleration patch was usable and looks like it does. Thanks for your help in testing it. I do not have any plans to release new ROMs, as all I would be doing is pull the code and compiling it, without any value add from my side (now that the code has already been merged).
The mod can actually close this thread if need be.
Thanks.
what's working and what's not?

[Q] {Q} How can I unpack Boot.img

I want to unpack a Boot.img file to have a look at the Kernel coding. I have been at Google-ing this for about an hour and need some help. I am using windows but could use Ubuntu if need be.
Help would be much appreciated!!!
first of all by unpacking boot.img you won't see actual kernel coding.. it will merely 0.05% give you some idea about coding stuff here..
ketut released some tools which you can find in his kernel thread [not cf-root thread]..
if you wan't code then you will have to download kernel sources from github or samsung site.. and play at own risks
Okay, it looks like I am going to install Ubuntu. I was just hoping there was some way to do it within Windows without running a V.M. or Dual boot.
yes there are two ways of installing it with wubi installer to install within windows.. and one creating separate partition of ext4 to dual boot..
wubi installer seems to be what you are looking for
I am currently looking here https://github.com/ilarrain/kernel_galaxyace/blob/gingerbread/arch/arm/mach-msm/acpuclock.c and trying to understand the references to the frequency table. I want to understand why the table goes to 1036800 (like the CM7 Kernel) but is limited to 902400. It would help if I had the CM7 Kernel source for reference. Do you know where that can be found?
I am pretty sure this is what I need to be looking at:
#ifdef CONFIG_CPU_FREQ_MSM
static struct cpufreq_frequency_table freq_table[20];
static void __init cpufreq_table_init(void)
{
unsigned int i;
unsigned int freq_cnt = 0;
/* Construct the freq_table table from acpu_freq_tbl since the
* freq_table values need to match frequencies specified in
* acpu_freq_tbl and acpu_freq_tbl needs to be fixed up during init.
*/
for (i = 0; acpu_freq_tbl.a11clk_khz != 0
&& freq_cnt < ARRAY_SIZE(freq_table)-1; i++) {
if (acpu_freq_tbl.use_for_scaling) {
freq_table[freq_cnt].index = freq_cnt;
freq_table[freq_cnt].frequency
= acpu_freq_tbl.a11clk_khz;
freq_cnt++;
}
}
/* freq_table not big enough to store all usable freqs. */
BUG_ON(acpu_freq_tbl.a11clk_khz != 0);
freq_table[freq_cnt].index = freq_cnt;
freq_table[freq_cnt].frequency = CPUFREQ_TABLE_END;
pr_info("%d scaling frequencies supported.\n", freq_cnt);
}
#endif
-SGA- said:
I am currently looking here https://github.com/ilarrain/kernel_galaxyace/blob/gingerbread/arch/arm/mach-msm/acpuclock.c and trying to understand the references to the frequency table. I want to understand why the table goes to 1036800 (like the CM7 Kernel) but is limited to 902400. It would help if I had the CM7 Kernel source for reference. Do you know where that can be found?
I am pretty sure this is what I need to be looking at:
#ifdef CONFIG_CPU_FREQ_MSM
static struct cpufreq_frequency_table freq_table[20];
static void __init cpufreq_table_init(void)
{
unsigned int i;
unsigned int freq_cnt = 0;
/* Construct the freq_table table from acpu_freq_tbl since the
* freq_table values need to match frequencies specified in
* acpu_freq_tbl and acpu_freq_tbl needs to be fixed up during init.
*/
for (i = 0; acpu_freq_tbl.a11clk_khz != 0
&& freq_cnt < ARRAY_SIZE(freq_table)-1; i++) {
if (acpu_freq_tbl.use_for_scaling) {
freq_table[freq_cnt].index = freq_cnt;
freq_table[freq_cnt].frequency
= acpu_freq_tbl.a11clk_khz;
freq_cnt++;
}
}
/* freq_table not big enough to store all usable freqs. */
BUG_ON(acpu_freq_tbl.a11clk_khz != 0);
freq_table[freq_cnt].index = freq_cnt;
freq_table[freq_cnt].frequency = CPUFREQ_TABLE_END;
pr_info("%d scaling frequencies supported.\n", freq_cnt);
}
#endif
Click to expand...
Click to collapse
Why not cooper_initramfs ?
Herpderp Adreno + Tegra.
Well..For the history,To unpack boot.img,you need to use cygwin.Here is complete instruction on doing this thing freeyourandroid.com

[Q] Need help hijacking/hooking/wrapping kernel function

I've made some modifications to drivers/usb/otg/msm_otg.c in order to support usb host mode for the Nexus 4: http://forum.xda-developers.com/showthread.php?t=2181820
So far, I've been building off Franco's sources, since I was using his kernel anyway. But this has its problems. I'm not looking to have to constantly keep up with Franco's nightlies. A good amount of posts from people are asking if I could compile a different kernel with the otg modifications, or if they could flash a different kernel on top. Franco's been getting requests to implement the modifications, and I didn't mean to put any onus on him.
I've been trying to do some research on creating a kernel module that could somehow hijack/hook/wrap the static functions I've made changes to in msm_otg.c. This is all way, way over my head though, and I could really use some help here. I've done some reading so far, but it hasn't gotten me anywhere. I got some good help on IRC, but am stuck again.
To get things rolling, I've manually found the address from /proc/kallsyms of static function msm_chg_detect_work to be 0xc03b4950. I'm trying to make a jump from here to my own function. I was provided make_jump_op for this purpose, although I have no understanding of how it works. Here is more or less what I've got so far (relevant bits..):
Code:
// max distance: 0x02000000
unsigned int make_jump_op(unsigned int src, unsigned int dst) {
unsigned int o;
int distance;
distance = (int)( ((long long)dst) - (((long long)src) + 8) );
if (distance > 32*1024*1024 || distance < -32*1024*1024) {
printk(KERN_ERR "distance too big!\n");
return 0; // crash, BOOOOM!
}
distance = distance / 4; // read: ">>2"
o = *((unsigned int *)(&distance)); // is there a proper way to do this, too?
o = (o & 0x00ffffff) + 0xea000000;
return o;
}
static void msm_chg_detect_work_MOD(struct work_struct *w) {
printk(KERN_INFO "TEST\n");
}
static int ziddey_otg_init(void) {
unsigned int *origcall;
printk(KERN_INFO "Loading kernel module '%s'\n", MODULE_NAME);
// 0xc03b4950: msm_chg_detect_work
origcall = (unsigned int *) 0xc03b4950;
preempt_disable();
*origcall = make_jump_op(0xc03b4950, (unsigned int)(void*)msm_chg_detect_work_MOD);
preempt_enable();
printk(KERN_INFO "Loaded kernel module '%s'\n", MODULE_NAME);
return 0;
}
Can anyone make sense of this? I get an Oops error and kernel panic.
Thank you
Code:
$ grep msm_chg_detect_work /proc/kallsyms
c03b4950 t msm_chg_detect_work

Need Helping understand sysfs, write from kernel, read from app

Hello,
I'm trying to get raw data from light sensor via sysfs, and transfer to app to show on chart.
I've been looking at the kernel driver sources and found this:
https://android.googlesource.com/ke...-bullhead-3.10-nougat/drivers/misc/apds993x.c
which contains
Code:
static ssize_t apds993x_show_ch0data(struct device *dev,
struct device_attribute *attr, char *buf)
and
static ssize_t apds993x_show_ch1data(struct device *dev,
struct device_attribute *attr, char *buf)
I have flash ElementalX:
https://forum.xda-developers.com/nexus-5x/orig-development/kernel-elementalx-n5x-t3240537
which have the apds993x.c in source.
But I'm so new to kernel development that I don't know how to read these values.
So can somebody help me with this:
Are these value been write to sysfs, if yes, where are they in the /sys/.. ?
How can I read these value out?
Thank you so much!

How to go about patching the kernel to get EHCI(USB 2.0) devices to behave like xHCI?

Basically, there has been an app ported to Android that allows even unrooted(stock) devices to deliver a bootrom exploit to the Nintendo Switch via USB-OTG and a USB cable (or C-to-C). USB 3.0 (xHCI) devices have no issues and deliver the exploit just fine. Apparently it is not even a USB 2.0 problem but rather how the EHCI performs, as certain USB 2.0 phones actually have the xHCI controller and can run the exploit just fine. What happens is that although it can detect the connected Switch in Tegra Recovery Mode, it just doesn't do anything and gives an error in the logs, "SUMBITURB failed".
On Linux desktop systems it is similar, but the exploit can still work with a kernel patch provided by a hacking group that discovered the exploit in the first place:
Code:
--- linux-4.14.27/drivers/usb/host/ehci-hcd.c.old 2018-04-17 18:00:00.000000000 +0000
+++ linux-4.14.27/drivers/usb/host/ehci-hcd.c 2018-04-17 18:00:00.000000000 +0000
@@ -873,14 +873,6 @@
INIT_LIST_HEAD (&qtd_list);
switch (usb_pipetype (urb->pipe)) {
- case PIPE_CONTROL:
- /* qh_completions() code doesn't handle all the fault cases
- * in multi-TD control transfers. Even 1KB is rare anyway.
- */
- if (urb->transfer_buffer_length > (16 * 1024))
- return -EMSGSIZE;
- /* FALLTHROUGH */
- /* case PIPE_BULK: */
default:
if (!qh_urb_transaction (ehci, urb, &qtd_list, mem_flags))
return -ENOMEM;
The author of the Android port had also written a Python "hotpatch" script for desktop Linux systems:
Code:
#!/usr/bin/env python3
import os
"""
Cursed Code.
This code literally patches your kernel memory, proceed at your own risk.
Tested on Ubuntu 17.10 and Arch, x86_64. Should work on other distros, maybe even other architectures!
Run fusee-launcher.py with the "--override-checks" argument.
If you'd rather patch your drivers properly:
https://github.com/fail0verflow/shofel2/blob/master/linux-ehci-enable-large-ctl-xfers.patch
"""
ksyms = {
line[2]: int(line[0], 16)
for line in
map(lambda l: l.strip().split(),
open("/proc/kallsyms", "r").readlines())}
print(hex(ksyms["ehci_urb_enqueue"]))
patch_c = """
#include <linux/module.h>
#include <linux/kernel.h>
#include <asm/pgtable.h>
static u32 ORIG_MAX = 16*1024;
static u32 NEW_MAX = 0x1000000;
/* borrowed from MUSL because I'm lazy AF */
static char *fourbyte_memmem(const unsigned char *h, size_t k, const unsigned char *n)
{
uint32_t nw = n[0]<<24 | n[1]<<16 | n[2]<<8 | n[3];
uint32_t hw = h[0]<<24 | h[1]<<16 | h[2]<<8 | h[3];
for (h+=3, k-=3; k; k--, hw = hw<<8 | *++h)
if (hw == nw) return (char *)h-3;
return 0;
}
static pte_t* (*lookup_addr)(unsigned long, unsigned int*) = (void *) PLACE2;
static void set_addr_rw(unsigned long addr) {
unsigned int level;
pte_t *pte = lookup_addr(addr, &level);
set_pte_atomic(pte, pte_mkwrite(*pte));
}
int init_module(void) {
void * ehci_urb_enqueue_start = (void *) PLACEHOLDER;
u32 * patch_addr;
printk(KERN_INFO "Patch module loaded\\n");
patch_addr = (u32 *) fourbyte_memmem(ehci_urb_enqueue_start, 0x400, (void *)&ORIG_MAX);
if (patch_addr == NULL) {
printk(KERN_INFO "Failed to find patch site :(\\n");
return -1;
}
printk(KERN_INFO "patch_addr: 0x%px\\n", patch_addr);
set_addr_rw((unsigned long)patch_addr);
*patch_addr = NEW_MAX;
printk(KERN_INFO "Patching done!\\n");
return -1;
}
""".replace("PLACEHOLDER", hex(ksyms["ehci_urb_enqueue"])).replace("PLACE2", hex(ksyms["lookup_address"]))
makefile = """
obj-m += patch.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
"""
with open("patch.c", "w") as patchfile:
patchfile.write(patch_c)
with open("Makefile", "w") as mf:
mf.write(makefile)
os.system("make")
print("About to insert patch module, 'Operation not permitted' means it probably worked, check dmesg output.")
os.system("insmod patch.ko")
I tried to see if running it in Termux would do anything but I got the following error:
Code:
0x0
Traceback (most recent call last):
File "ehci_patch.py", line 70, in <module>
" " ".replace("PLACEHOLDER", hex(ksyms["ehci_urb_enqueue"])).replace("PLACE2" hex(ksyms["lookup_address"]))
KeyError: 'lookup_address'
I know that script isn't meant for use on Android anyway but maybe it can lead to a solution. The author of it does not know how to go about it at this time either, but believes an entire recompile of the kernel would be necessary. I am hoping that something like a systemless Magisk module would be the easiest solution for users but do not know if that is possible. I am only guessing it might be possible to create a Magisk module because of audio drivers like VIPER4Android. If indeed a custom kernel is needed, does anyone know how to go about it? It could be difficult to implement for everyone because not everyone has a device where the source to the kernel is available, etc. I am willing, however, to test anything on my tablet which is USB 2.0 and gives the error in the app. Any advice for how to go about this will be greatly appreciated.
I feel ya man, i need this stuff too. NXLoader doesn't work on my Galaxy Grand Prime (G530T) and i really need it to Dx

Categories

Resources