Search This thread

Entropy512

Senior Recognized Developer
Aug 31, 2007
14,088
25,086
Owego, NY
Sadly; vendor/samsung/galaxys2/proprietary/audio/lib/*
Yup... As mentioned... proprietary blob.

One possible trick might be to put a wrapper around this library to see what Touchwizz does differently from CM9. See camera/CameraWrapper.cpp and gpswrapper/gps.c as examples. This won't work if the TW firmware uses some additional nonstandard "backchannel" interface though. (I suspect that's the case for why some of the GPS functionality doesn't quite work right - it's clear that TW firmware has a way to feed extra parameters to the GPS engine, such as sensor aiding data, the interfaces for this aren't documented anywhere.)

If it's like the camera, the binary blob is probably not accessing the hardware directly but through some driver in the kernel, so it might be worthwhile to find out which one and add traces in it to see what the binary blob actually ask the driver to do.
Looking for /dev/something strings in the binaries might be a good start.

For a long-term goal of reimplementing libaudio this would be benificial - but it would be nice to figure out why our existing libaudio doesn't like to play nice with CM9 in this instance.

It's possible to enable verbose driver debug info for the MC1N2 in the kernel defconfig - it's how I reverse engineered the mic swap situation on I777. I really need to rewrite the path dumping code so it's easier to read. In its current state reading through all the stuff the kernel dumps is painful.
 

sorg

Senior Member
Sep 5, 2006
1,059
1,136
台灣
codeworkx,
do u know how to fix wrong wired headset button behaviour?
currently, when phone is in sleep and i press button then nothing happens. I have to quickly press it again to get action (start music playback).
It looks like system just wake up upon first key press, but doesn't pass key.

I've looked into kernel code and android, but can't find the place to fix.
i'm using CM9 source code as reference, but my goal is to fix it in samsung ROM.
 

Entropy512

Senior Recognized Developer
Aug 31, 2007
14,088
25,086
Owego, NY
codeworkx,
do u know how to fix wrong wired headset button behaviour?
currently, when phone is in sleep and i press button then nothing happens. I have to quickly press it again to get action (start music playback).
It looks like system just wake up upon first key press, but doesn't pass key.

I've looked into kernel code and android, but can't find the place to fix.
i'm using CM9 source code as reference, but my goal is to fix it in samsung ROM.

Look in the kernel in terms of GPIO interrupts. However, considering how long it takes for the kernel to wake up from suspend, I'm not sure if keypresses in deep sleep get treated as anything other than "trigger wakeup from suspend".
 

czesiu

Senior Member
Apr 13, 2010
336
38
Warsaw
twitter.com
codeworkx,
do u know how to fix wrong wired headset button behaviour?
currently, when phone is in sleep and i press button then nothing happens. I have to quickly press it again to get action (start music playback).
It looks like system just wake up upon first key press, but doesn't pass key.

I've looked into kernel code and android, but can't find the place to fix.
i'm using CM9 source code as reference, but my goal is to fix it in samsung ROM.

While looking into that problem you could also see if maybe this:
http://xdaforums.com/showthread.php?t=1555018
is easy to fix
(prevent disconnect when headset button (with code 240) is held or make the phone think that code 240 is 226)
Thanks

PS: It seems the phone treats media button presses as if WAKE_DROPPED was set in keylayout

WAKE_DROPPED: The key should wake the device when it is asleep but the key itself should be dropped when the wake-up occurs. In a sense, the key's action was to wake the device, but the key itself is not processed.
 

akas84

Member
Jul 25, 2011
36
6
Hello guys,

I am a Developer and would love to have catalan as corrector and keyboard languages, can I help in the code to be able to have this?

Which corrector does Android use? Something like ispell?? Can this be possible?

Thanks,
 
  • Like
Reactions: CDTI

sorg

Senior Member
Sep 5, 2006
1,059
1,136
台灣
While looking into that problem you could also see if maybe this:
http://xdaforums.com/showthread.php?t=1555018
is easy to fix
(prevent disconnect when headset button (with code 240) is held or make the phone think that code 240 is 226)
Thanks

PS: It seems the phone treats media button presses as if WAKE_DROPPED was set in keylayout

WAKE_DROPPED: The key should wake the device when it is asleep but the key itself should be dropped when the wake-up occurs. In a sense, the key's action was to wake the device, but the key itself is not processed.

Yes, WAKE_DROPPED is exactly how headset button works which is wrong for this type of button.

What i suddenly discovered is when phone in sleep then i don't need to press twice quickly actually, just need press it and hold for couple of seconds. It's interesting behaviour because instead of press-and-hold action, i get "press and release" while i still holding button down.

Entropy512 is correct when talking about time for phone to wakeup before process key. SGSII supports 3-buttons headset where other 2 buttons (VolUp/Down) use resistors to get specific ADC value. May be this cause play button to fail because after time needed for wakeup user may already release key and ADC comarison will fail.
Since headsets with such cirquits are almost nonexistent (iPhone/HTC 3-buttons headsets use IC to send command instead of resistors), it won't be harm to remove ADC value comparison and make any key act as play/pause. I've tried to remove ADC comparison, but it didn't help. Probably need to look into WAKE_DROPPED.
 

chewable

Member
Jul 15, 2011
37
33
Toronto
I've been investigating the RILJ wakelock and these are my findings.

Problem Description
Bad battery drain due to a wakelock being held for an unspecified length of time. BetterBatteryStats shows it to be RILJ holding the wakelock. I've narrowed it down to a RIL request named RIL_REQUEST_SET_TTY_MODE. I dumped out RILJ.mRequestsList during the held wakelock and I see this request staying around and waiting for a response from the RIL. It's as if the RIL is not responding to this request and I don't see RILReceiver processing a response to this request.

One thing to note is that RIL_REQUEST_SET_TTY_MODE is generated when we see EVENT_TTY_PREFERRED_MODE_CHANGED from PhoneApp. This happens when the phone boots up and also when you plug in a pair of headphones. Thus this wakelock can be reproduced by plugging in a pair of headphones.

Q&A
Q: Why does the workaround of rebooting into flight mode work?
A: When trying to send out RIL_REQUEST_SET_TTY_MODE, we hit a RADIO_NOT_AVAILABLE exception and the request is removed from the list. This is interesting because I DO see a response being processed in processResponse() in this case... maybe the RIL is responding to the radio not being on. Since we hit processResponse(), the request is removed from RILJ.mRequestsList. Since it doesn't persist in the requests list, the wakelock is no longer held.

Q: Why does the wakelock go away after some period of time?
A: There is a 60 second timer (30 seconds in gingerbread) where the requests list is cleared if there is no RIL activity. When there is nothing in the requests list, the wakelock will be released. If something comes into the RIL, the stale requests are not cleared, the timer is reset, and the 60 seconds starts all over again. Thus some users with a lot of RIL activity will not see this timer expire and the wakelock won't be released.

Q: How to fix this?
A: I think the RIL is a binary blob to which we don't have source code... so it's difficult to track down why it isn't responding to the TTY request. One alternative is modifying the 60 second timer behaviour to purge outstanding requests that have been in there longer than 60 seconds. Looking for comments from others...
 

Entropy512

Senior Recognized Developer
Aug 31, 2007
14,088
25,086
Owego, NY
I've been investigating the RILJ wakelock and these are my findings.

Problem Description
Bad battery drain due to a wakelock being held for an unspecified length of time. BetterBatteryStats shows it to be RILJ holding the wakelock. I've narrowed it down to a RIL request named RIL_REQUEST_SET_TTY_MODE. I dumped out RILJ.mRequestsList during the held wakelock and I see this request staying around and waiting for a response from the RIL. It's as if the RIL is not responding to this request and I don't see RILReceiver processing a response to this request.

One thing to note is that RIL_REQUEST_SET_TTY_MODE is generated when we see EVENT_TTY_PREFERRED_MODE_CHANGED from PhoneApp. This happens when the phone boots up and also when you plug in a pair of headphones. Thus this wakelock can be reproduced by plugging in a pair of headphones.

Q&A
Q: Why does the workaround of rebooting into flight mode work?
A: When trying to send out RIL_REQUEST_SET_TTY_MODE, we hit a RADIO_NOT_AVAILABLE exception and the request is removed from the list. This is interesting because I DO see a response being processed in processResponse() in this case... maybe the RIL is responding to the radio not being on. Since we hit processResponse(), the request is removed from RILJ.mRequestsList. Since it doesn't persist in the requests list, the wakelock is no longer held.

Q: Why does the wakelock go away after some period of time?
A: There is a 60 second timer (30 seconds in gingerbread) where the requests list is cleared if there is no RIL activity. When there is nothing in the requests list, the wakelock will be released. If something comes into the RIL, the stale requests are not cleared, the timer is reset, and the 60 seconds starts all over again. Thus some users with a lot of RIL activity will not see this timer expire and the wakelock won't be released.

Q: How to fix this?
A: I think the RIL is a binary blob to which we don't have source code... so it's difficult to track down why it isn't responding to the TTY request. One alternative is modifying the 60 second timer behaviour to purge outstanding requests that have been in there longer than 60 seconds. Looking for comments from others...

Perhaps focus on purging RIL_REQUEST_TTY mode if it is old... but this could hose up queuing code... hmm...
 
  • Like
Reactions: Timo_SGS2

chewable

Member
Jul 15, 2011
37
33
Toronto
Perhaps focus on purging RIL_REQUEST_TTY mode if it is old... but this could hose up queuing code... hmm...
I've got something simple that works :) I'll be submitting something to Gerrit over the weekend.
Edit: .. or maybe after the weekend. I just read the contributor agreement and need to get an OK from my employer.
 
Last edited:

myfluxi

Inactive Recognized Developer
Jun 28, 2011
1,171
7,699
Entropy512's latest kernel commit seems to break repo sync. Maybe it's just me but at least worth checking:

Code:
error.GitError: CyanogenMod/android_kernel_samsung_smdk4210 rev-list ('^720d8be0f074baef99293fd9829e40968c61e4eb', 'HEAD', '--'): fatal: bad object 720d8be0f074baef99293fd9829e40968c61e4eb
 

golcheck

Senior Member
Weird thing. I was building cm9 and it finished unexpectedly without the target:

Code:
LD [M] fs/cifs/cifs.ko
make[1]: Leaving directory `/root/android/system/kernel/samsung/smdk4210'
make -C kernel/samsung/smdk4210 O=/root/android/system/out/target/product/galaxys2/obj/KERNEL_OBJ INSTALL_MOD_PATH=../../system ARCH=arm CROSS_COMPILE=/root/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- modules_install
make[1]: Entering directory `/root/android/system/kernel/samsung/smdk4210'
INSTALL drivers/net/wireless/bcmdhd/dhd.ko
INSTALL drivers/samsung/fm_si4709/Si4709_driver.ko
INSTALL drivers/scsi/scsi_wait_scan.ko
INSTALL fs/cifs/cifs.ko
DEPMOD 3.0.28-CM-gaaa0e0b
make[1]: Leaving directory `/root/android/system/kernel/samsung/smdk4210'
mdpath=`find out/target/product/galaxys2/system/lib/modules -type f -name modules.order`; if [ "$mdpath" != "" ];then mpath=`dirname $mdpath`; ko=`find $mpath/kernel -type f -name *.ko`; for i in $ko; do mv $i out/target/product/galaxys2/system/lib/modules/; done; fi
mdpath=`find out/target/product/galaxys2/system/lib/modules -type f -name modules.order`; if [ "$mdpath" != "" ];then mpath=`dirname $mdpath`; rm -rf $mpath; fi
Elapsed: 62 min(s) 26 sec(s)

I didn't get any errors or warnings. It finished just like that. Any ideas?

Edit:

Ok, I found some errors:

Code:
symbol : class Camera
location: package android.graphics
import android.graphics.Camera;
^
frameworks/base/core/java/android/view/View.java:2093: cannot find symbol
symbol : class Camera
location: class android.view.View.TransformationInfo
private Camera mCamera = null;
^
frameworks/base/media/java/android/media/CamcorderProfile.java:19: cannot find symbol
symbol : class Camera
location: package android.hardware
import android.hardware.Camera;
^
frameworks/base/media/java/android/media/CamcorderProfile.java:20: package android.hardware.Camera does not exist
import android.hardware.Camera.CameraInfo;
^
frameworks/base/media/java/android/media/CameraProfile.java:19: cannot find symbol
symbol : class Camera
location: package android.hardware
import android.hardware.Camera;
^
frameworks/base/media/java/android/media/CameraProfile.java:20: package android.hardware.Camera does not exist
import android.hardware.Camera.CameraInfo;
^
frameworks/base/media/java/android/media/MediaRecorder.java:19: cannot find symbol
symbol : class Camera
location: package android.hardware
import android.hardware.Camera;
^
frameworks/base/media/java/android/media/MediaRecorder.java:129: cannot find symbol
symbol : class Camera
location: class android.media.MediaRecorder
public native void setCamera(Camera c);
^
frameworks/base/core/java/android/view/View.java:7112: cannot find symbol
symbol : class Camera
location: class android.view.View
info.mCamera = new Camera();
^
frameworks/base/core/java/android/view/View.java:7201: cannot find symbol
symbol : class Camera
location: class android.view.View
info.mCamera = new Camera();
^
frameworks/base/media/java/android/media/CamcorderProfile.java:230: cannot find symbol
symbol : variable Camera
location: class android.media.CamcorderProfile
int numberOfCameras = Camera.getNumberOfCameras();
^
frameworks/base/media/java/android/media/CamcorderProfile.java:231: cannot find symbol
symbol : class CameraInfo
location: class android.media.CamcorderProfile
CameraInfo cameraInfo = new CameraInfo();
^
frameworks/base/media/java/android/media/CamcorderProfile.java:231: cannot find symbol
symbol : class CameraInfo
location: class android.media.CamcorderProfile
CameraInfo cameraInfo = new CameraInfo();
^
frameworks/base/media/java/android/media/CamcorderProfile.java:233: cannot find symbol
symbol : variable Camera
location: class android.media.CamcorderProfile
Camera.getCameraInfo(i, cameraInfo);
^
frameworks/base/media/java/android/media/CamcorderProfile.java:234: cannot find symbol
symbol : variable CameraInfo
location: class android.media.CamcorderProfile
if (cameraInfo.facing == CameraInfo.CAMERA_FACING_BACK) {
^
frameworks/base/media/java/android/media/CamcorderProfile.java:297: cannot find symbol
symbol : variable Camera
location: class android.media.CamcorderProfile
int numberOfCameras = Camera.getNumberOfCameras();
^
frameworks/base/media/java/android/media/CamcorderProfile.java:298: cannot find symbol
symbol : class CameraInfo
location: class android.media.CamcorderProfile
CameraInfo cameraInfo = new CameraInfo();
^
frameworks/base/media/java/android/media/CamcorderProfile.java:298: cannot find symbol
symbol : class CameraInfo
location: class android.media.CamcorderProfile
CameraInfo cameraInfo = new CameraInfo();
^
frameworks/base/media/java/android/media/CamcorderProfile.java:300: cannot find symbol
symbol : variable Camera
location: class android.media.CamcorderProfile
Camera.getCameraInfo(i, cameraInfo);
^
frameworks/base/media/java/android/media/CamcorderProfile.java:301: cannot find symbol
symbol : variable CameraInfo
location: class android.media.CamcorderProfile
if (cameraInfo.facing == CameraInfo.CAMERA_FACING_BACK) {
^
frameworks/base/media/java/android/media/CameraProfile.java:58: cannot find symbol
symbol : variable Camera
location: class android.media.CameraProfile
int numberOfCameras = Camera.getNumberOfCameras();
^
frameworks/base/media/java/android/media/CameraProfile.java:59: cannot find symbol
symbol : class CameraInfo
location: class android.media.CameraProfile
CameraInfo cameraInfo = new CameraInfo();
^
frameworks/base/media/java/android/media/CameraProfile.java:59: cannot find symbol
symbol : class CameraInfo
location: class android.media.CameraProfile
CameraInfo cameraInfo = new CameraInfo();
^
frameworks/base/media/java/android/media/CameraProfile.java:61: cannot find symbol
symbol : variable Camera
location: class android.media.CameraProfile
Camera.getCameraInfo(i, cameraInfo);
^
frameworks/base/media/java/android/media/CameraProfile.java:62: cannot find symbol
symbol : variable CameraInfo
location: class android.media.CameraProfile
if (cameraInfo.facing == CameraInfo.CAMERA_FACING_BACK) {

and then:

Code:
25 errors
make: *** [out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar] Error 41
make: *** Waiting for unfinished jobs....
 
Last edited:
  • Like
Reactions: mrdoubleb

Entropy512

Senior Recognized Developer
Aug 31, 2007
14,088
25,086
Owego, NY
Entropy512's latest kernel commit seems to break repo sync. Maybe it's just me but at least worth checking:

Code:
error.GitError: CyanogenMod/android_kernel_samsung_smdk4210 rev-list ('^720d8be0f074baef99293fd9829e40968c61e4eb', 'HEAD', '--'): fatal: bad object 720d8be0f074baef99293fd9829e40968c61e4eb

Weird... Try nuking and repaving the repo. (Edit: Just the kernel one)

I hate this new inline kernel building stuff... freaking pain in the ass...
 
Last edited:

myfluxi

Inactive Recognized Developer
Jun 28, 2011
1,171
7,699
Weird... Try nuking and repaving the repo. (Edit: Just the kernel one)

I hate this new inline kernel building stuff... freaking pain in the ass...
Yeah, I fixed it quickly. Just wanted to report the error, just in case it was a systematic one (guess it was random then :)).
 

RagingHarry

Senior Member
Jan 8, 2012
831
330
Havelte
Google Pixel 5
link to the content of local_manifest.xml doesn't work (http://pastie.org/3642839). Could anyone PM me the content?

From pastie.org

Sorry, Pastie is offline.

pastie.org was DDOSed twice last night. To protect it's network and other customers Rails Machine has decided to no longer host and sponsor the site.

I did not see this coming and did not expect my hosting company to just pull the plug so quickly.

I'm in the middle of RailsConf 2012 right now but working on a migration plan to deal with this.

Hang in there, we'll be back.
----------------------------------------------------
I really feel bad about this. I'm just a single person running the site free of charge. I make a very minimal amount of monthly income from the ads. Probably just enough to cover hosting now that I don't have a sponsor.

I guess this is just one of the downsides of running a large, popular site, but it's very frustrating. If anyone feels like they have the expertise to help (with DDOS stuff) please feel to reach out and contact me.

seems that for now some othe site is needed to use.
 
Last edited:

codeworkx

Senior Recognized Developer
Nov 20, 2010
8,495
57,090
Bad Neustadt
correct local_manifest.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="CyanogenMod/android_device_samsung_galaxys2" path="device/samsung/galaxys2" remote="github" />
  <project name="CyanogenMod/android_kernel_samsung_smdk4210" path="kernel/samsung/smdk4210" remote="github" revision="ics" />
  <project name="teamhacksung/buildscripts" path="buildscripts" remote="github" revision="ics">
    <copyfile dest="build.sh" src="samsung/build.sh" />
  </project>
  <project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" />
</manifest>

Sent from my Galaxy Nexus using XDA
 

D4rKn3sSyS

Inactive Recognized Developer
Jan 12, 2011
3,800
16,278
Medellín
Hi guys, some one with this error here?:

Code:
Syncing work tree: 100% (253/253)  error: revision refs/heads/ics in CyanogenMod/android_vendor_qcom_opensource_v8 not found

When trying to do repo sync. Happened just today night. First it downloaded some "https://android.googlesource.com" files, then some from CyanogenMod, and stopped syncing work tree :)


EDIT: Forget this. they just fixed the issue, now branch ics exists. I guess I didn't wait enough.
 
Last edited:

Top Liked Posts