yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Original Android Development] codeworkx:
volume bug

Some users reported that when they're playing music and a notification comes in, the music volume never comes back to it's previous value.

can't reproduce. tried on different volumes and in any case volume before = volume after.

I/AudioService( 2030): AudioFocus requestAudioFocus() from android.media.AudioManager@415a3ad0
I/AudioPolicyManager( 1865): stopOutput() output 1, stream 3, session 30 [B]<-- stop music[/B]
I/AudioPolicyManager( 1865): startOutput() output 1, stream 5, session 31 [B]<-- start notification[/B]
D/AudioSystem( 1865): android::AudioSystem::isSeparatedStream(audio_stream_type_t) called!
D/AudioSystem( 1865): audio_stream_type_t: 5
D/AudioSystem( 1865): isSeparatedStream: false
I/AudioService( 2030): AudioFocus abandonAudioFocus() from android.media.AudioManager@415a3ad0
I/AudioPolicyManager( 1865): stopOutput() output 1, stream 5, session 31 [B]<-- stop notification[/B]
I/AudioService( 2030): AudioFocus requestAudioFocus() from android.media.AudioManager@413ab548com.android.music.AudioPreview$2@413a31e8
I/AudioPolicyManager( 1865): startOutput() output 1, stream 3, session 30 [B]<-- start music again[/B]
D/AudioSystem( 1865): android::AudioSystem::isSeparatedStream(audio_stream_type_t) called!
D/AudioSystem( 1865): audio_stream_type_t: 3
D/AudioSystem( 1865): isSeparatedStream: false
I/AudioPolicyManager( 1865): getDeviceForStrategy() strategy 0, device 2
I/power ( 2030): *** set_screen_state 0
[Galaxy S II Original Android Development] spaxx24:
Wierd. That happens to me.
[Galaxy S II Original Android Development] spaxx24:
And I use Spotify. It resets if i use go sms tho. But just for sms. Facebook messenger etc does not reset
[Galaxy S II Original Android Development] StevenHarperUK:
About 2 weeks ago this was definitely the case.

I tried to reproduce today - Taking 1 logcat from a stock i19100 and 1 logcat from my CM9 i9100 - both worked perfectly.

I believe someone/something has fixed it.

EDIT : Hold on there is this a Headphone Only bug?

---------- Post added at 06:48 PM ---------- Previous post was at 06:46 PM ----------

My Device is actually an i9100P

Its Model Number in the About panel is GT-I9100

Should this be GT-I9100P - or do all the i9100's show up as this?

- I as because I was trying the NFC patch and wondered if it was staying greyed out for his reason.
[Galaxy S II Original Android Development] Entropy512:
logcat done as follows:

Start music playing at max volume

Set music to repeat one track forever so I don't need to keep restarting it

adb logcat -c (to clear old cruft from logs)

adb logcat -v time, and while logcat is running:

Drop volume one notch, raise it back up

Receive notification

Low volume occurs

Touch volume down - volume goes to 30

Touch volume up - volume back to max

This was done with the music playing over headphones.
[Galaxy S II Original Android Development] StevenHarperUK:
The Audio bug

I am pretty certain that the bug is in AudioPolicyManager.cpp

or

AudioHardware.cpp

Which of these do I start in?

./hardware/qcom/media/audio/msm7x30/AudioPolicyManager.cpp
./hardware/qcom/media/audio/msm7x27a/AudioPolicyManager.cpp
./hardware/qcom/media/audio/qsd8k/AudioPolicyManager.cpp
./hardware/qcom/media/audio/msm8x60/AudioPolicyManager.cpp
./hardware/libhardware_legacy/audio/AudioPolicyManagerDefault.cpp
./hardware/libhardware_legacy/audio/AudioPolicyManagerBase.cpp
./hardware/msm7k/libaudio/AudioPolicyManager.cpp
./hardware/msm7k/libaudio-qdsp5v2/AudioPolicyManager.cpp
./hardware/msm7k/libaudio-qsd8k/AudioPolicyManager.cpp

EDIT:

If its not in the above mentioned classes, the I am afraid that it lives in the binary blob

vendor/samsung/galaxys2/proprietary/libmediayamaha.so [:sadface]
[Galaxy S II Original Android Development] Entropy512:
AudioHardware.cpp is source for libaudio - which is a proprietary blob for us.
[Galaxy S II Original Android Development] rlorange:
I get the volume bug (still in latest nightly). I'm using poweramp too.
[Galaxy S II Original Android Development] StevenHarperUK:
Which one?

./hardware/qcom/media/audio/msm7x30/AudioHardware.cpp

./hardware/qcom/media/audio/msm7x27a/AudioHardware.cpp

./hardware/qcom/media/audio/qsd8k/AudioHardware.cpp

./hardware/qcom/media/audio/msm8x60/AudioHardware.cpp

./hardware/libhardware_legacy/audio/AudioHardware.cpp

./hardware/libhardware_legacy/audio/AudioHardware.cpp

./hardware/msm7k/libaudio/AudioHardware.cpp

./hardware/msm7k/libaudio-qdsp5v2/AudioHardware.cpp

./hardware/msm7k/libaudio-qsd8k/AudioHardware.cpp
[Galaxy S II Original Android Development] espenfjo:
Sadly; vendor/samsung/galaxys2/proprietary/audio/lib/*
[Galaxy S II Original Android Development] Zlodo:
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.
[Galaxy S II Original Android Development] Entropy512:
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.)

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.
[Galaxy S II Original Android Development] sorg:
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.
[Galaxy S II Original Android Development] Entropy512:
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".
[Galaxy S II Original Android Development] czesiu:
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.
[Galaxy S II Original Android Development] akas84:
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,
[Galaxy S II Original Android Development] sorg:
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.
[Galaxy S II Original Android Development] chewable:
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...
[Galaxy S II Original Android Development] Entropy512:
Perhaps focus on purging RIL_REQUEST_TTY mode if it is old... but this could hose up queuing code... hmm...
[Galaxy S II Original Android Development] chewable:
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.
[Galaxy S II Original Android Development] myfluxi:
Entropy512's latest kernel commit seems to break repo sync. Maybe it's just me but at least worth checking:

error.GitError: CyanogenMod/android_kernel_samsung_smdk4210 rev-list ('^720d8be0f074baef99293fd9829e40968c61e4eb', 'HEAD', '--'): fatal: bad object 720d8be0f074baef99293fd9829e40968c61e4eb
[Galaxy S II Original Android Development] RagingHarry:
@golcheck Pleas use the code tags around the logs to wrap it up bit

... [ code] [/code ] ....
[Galaxy S II Original Android Development] Entropy512:
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...
[Galaxy S II Original Android Development] golcheck:
link to the content of local_manifest.xml doesn't work (http://pastie.org/3642839). Could anyone PM me the content?
[Galaxy S II Original Android Development] thracemerin:
Nevermind, I misunderstood what you were saying.
[Galaxy S II Original Android Development] myfluxi:
Yeah, I fixed it quickly. Just wanted to report the error, just in case it was a systematic one (guess it was random then :)).
[Galaxy S II Original Android Development] RagingHarry:
From pastie.org

seems that for now some othe site is needed to use.
[Galaxy S II Original Android Development] codeworkx:
correct local_manifest.xml

<?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>
[Galaxy S II Original Android Development] imfloflo:
Can't receive emoji on lastest fitsnugl nightly 0422
[Galaxy S II Original Android Development] D4rKn3sSyS:
Hi guys, some one with this error here?:

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.
[Galaxy S II Original Android Development] espenfjo:
Ok guys....

I have been looking into the opensource sensors trying to make the orientation work.

The problem is that the sensors are rolling while pitching the device.

It seems like the magnetometers X value is off, atleast.

The sensors work like this.

1. The kernel driver reports the raw values. They are alike for both samsung and opensource libs.

2. The raw values from the kernel is read by libakm (Closed Source), gain adjusted, magic applied and written to the Linux input event system.

3. The libsensors read the values from the input event system, and convert the values it gets to microtesla.

4. The Android framework reads the values from the libsensors, and converts Accelerometer values + Magnetometer values into Orientation values.

For example you will see this for magnetometer X with samsung libs:

And this with the opensource libs:

This is an easy conversion. But if I move the device just slightly the values and the conversion values will be completly different. :(

For example -0.9(samsung) vs 3.5 (opensource), this just being a slight move.

Ideas?
[Galaxy S II Original Android Development] D4rKn3sSyS:
Perhaps it can be set like (and this is pure pseudocode, im just guessing)

int x = levelWhereItChanges
int y = anotherOfThoseLevels

if (value < x)
doTheConversion(params)
else if (value > x)
doTheConversion(params)
else if (value < y)
doTheConversion(params)
else if (value > y)
doTheConversion(params)

Wouldn't be a fix, but at least may serve as workaround.

EDIT: Wait, Looking again those values, I see some kind of pattern, you can see that values are always from contrary sign (if open source are positive, then samsung are negative), and they differ about 2.5 in magnitude, so what about

int doTheConversion(int value)
boolean isValuePositive = value > 0;
return (isValuePositive ? abs(value) - 2.5 : abs(value) + 2.5)*(isValuePositive ? -1 : 1)

Consideering what you posted it may work
[Galaxy S II Original Android Development] espenfjo:
Some more values:

Opensource:

Number of samples: 9586

Average: 12.7092

Max: 18.0625

Min: 10.625

Samsung:

Number of samples: 915

Average: 2.95233

Max: 3.72

Min: 2.28

Turning the device slighty (30 degrees?):

Opensource:

Number of samples: 2835

Average: 20.6192

Max: 22.375

Min: 15.875

Samsung:

Number of samples: 1202

Average: 9.91433

Max: 15.24

Min: 9.0

Turning it a bit more (same direction, 90ish degrees from the original position).

OpenSource:

Number of samples: 2148

Average: 6.3512

Max: 9.4375

Min: 4.875

Samsung:

Number of samples: 955

Average: 1.18454

Max: 7.9

Min: -0.48

Some times it looks like +10, but then... Something totally different :)

I will see when I find the will to test this a bit more tomorrow perhaps, kinda fed up with sensors now. Check if it is +10 until X.

And if it is consistent from X -> Y. And from Y back to +10 again.
[Galaxy S II Original Android Development] Major_Sarcasm:
Had a kernel panic earlier, grabbed a last_kmsg after reboot, hope it might be of some use... posts in the discussion thread tend to get swamped by background noise within seconds, so here is the link to pastebin.

Stock cm9 from 29th April.
[Galaxy S II Original Android Development] Rawi666:
Opening Cyanogen in Eclipse

Hi guys,

I'm trying to open Cyanogen in Eclipse.

I did complete build from command line according to the official tutorial and there were no errors.

Next I tried to open whole project in Eclipse according to this tutorial

And unfortunately 2 jars are missing and I can't compile it in eclipse.

Here is screenshot from eclipse [SCREENSHOT]

I googled everywhere but it seems noone had such an issue :(

Missing jars are:

google-common_intermediates.jar

gsf-client_intermediates.jar
[Galaxy S II Original Android Development] TheGrammarFreak:
It looks to me almost like an exponential difference between the Sammy version and Opensource. (Or potentially logarithmic). I reckon it's possible to find a usable exponent with more data.
[Galaxy S II Original Android Development] codeworkx:
Dunno if this still works for ICS.

I never managed to get it working with Eclipse.

Real men use geany, nano, vi or whatever! :-P
[Galaxy S II Original Android Development] daef:
my two sens

could you try to:

* rotate the device in all directions

* log all datapoints (opensource)

* to the same(!) thing as good as possible

* log all datapoints (samsung)

(dunno if you can log both at the same time...)

* paste the (raw)data - by raw i guess i mean the values after libsensors (the values you already posted the minima and maxima of)

then i could:

* throw the data into a huge graph-plot

* apply magic to the data to make the graphs match

* find out if it seems to follow any logic

* provide conversion-code or something alike

tl;dr

try working visually when dealing with sensors

-- daef
[Galaxy S II Original Android Development] Major_Sarcasm:
Another kernel panic this afternoon. It should be noted that I haven't had any prior to this build. Last_kmsg here, booted into recovery for ADB access after kernel panic rather than right into OS.

Stock build, stock kernel, 29th April.

Edit: Do you guys want me to post these or shove them in the spammage thread? (or not bother at all?)
[Galaxy S II Original Android Development] golcheck:
Weird thing. My repo has been updated with the extract-files.sh stuff (re: libpn544_fw.so & mfc_fw.bin). I did ./extract-files.sh and noticed those 2 files were not present on my device. I updated my s2 wit the latest nightly to get those files. Then did ./extract-files.sh again. libpn544_fw.so has been transfered but mfc_fw.bin is still missing:

remote object '/system/vendor/firmware/mfc_fw.bin' does not exist

because of that building cm9 stops with error message about missing mfc_fw.bin file.

make: *** No rules to make object `vendor/samsung/galaxys2-common/proprietary/mfc_fw.bin', required by `out/target/product/galaxys2/system/vendor/firmware/mfc_fw.bin'. Stop.

Any ideas how to get that fixed?
[Galaxy S II Original Android Development] aramil:
Flash the latest CodeWorkx build : HERE

Just tested and it works :D
[Galaxy S II Original Android Development] thracemerin:
You could also just use koush's github to get the proprietary files rather than extracting them off your device.
[Galaxy S II Original Android Development] espenfjo:
Sensor readings done in a circle with 45 degrees intervals.

X is opensource sensors, and Xs is Samsugs Sensors.

90 is 90 degrees done on the right edge of the device.

90.2 is 90 degrees done on the left edge of the device.

http://espen.mrfjo.org/sensor/

I will do some massaging of the numbers and see if I can find something usefull.

PS: only 90 and 90s have the ANSI colour codes.
[Galaxy S II Original Android Development] daef:
first:

i didn't expect files where 1 file equals one orientation,

i'd really love files where the device (and thus the values) move.

second:

the device moved in some of your files (see sourcemonk dot com/on/values_not_constant_plus_spikes.jpg )

could you provide 2 files, one for opensource, one for

samsung, where the device does some crazy rotation

in all directions (i don't even have to know how it moved)

only important thing: both files should contain the

data for the same movement (as good as possible)

regards
[Galaxy S II Original Android Development] espenfjo:
Actually, the device did not move. This is just some instabilities / sensor slow to adapt / gain adjustments.

Will try and provide a log where the device does the crazy pitching tonight.
[Galaxy S II Original Android Development] daef:
kk

i threw together the data anyway and did a first plot over x&y

(since z stays constant)

the blue line represents a tenth of the the orientation in degree

(315° => 31.5)

sourcemonk dot com/on/first_graph.jpg

regards
[Galaxy S II Original Android Development] isimobile:
Hi Guys,

I am doing some dev work on cm9 and I came across the following problem. I am trying to implement a setting in settings here:

/packages/apps/Settings/src/com/android/settings/cyanogenmod/:

The code below returns null in the SGS2, but on my Samsung 10.1 tablet on cm9 it does not return null.

File dir = getActivity().getApplicationContext().getExternalCacheDir();

The android help of the above command says:

I need to access this location in another place that is why I need to use this function as there is no security restrictions on the location as highlighted in bold above. Also note: I know the External storage is not mounted. I check this with the following code:

private boolean isSDMounted() {
return android.os.Environment.getExternalStorageState().equals(
android.os.Environment.MEDIA_MOUNTED);

}

Any Ideas?

Thanks.
[Galaxy S II Original Android Development] espenfjo:
Rocking the device back and forth holding it upright.

This really shows the issue in compass apps.

OpenSource rocking: http://espen.mrfjo.org/sensor/RockingOpenSource

Samsung rocking: http://espen.mrfjo.org/sensor/RockingSamsug

The red line is Samsung sensors.

The green is opensource.

Do also note that the opensource sensor delivers data 10 times as fast as the Samsung one. So the Samsung one have 125 measure points, while the OpenSource one have 1600.

Weird..
[Galaxy S II Original Android Development] xOnerOs:
ei i'm really interested in trying out cm9

would anyone mind directing me to a link

on how to install this ROM... tia

so far all i've found this http://www.theandroidsoul.com/cm9-galaxy-s2/
[Galaxy S II Original Android Development] alexeiw123:
http://xdaforums.com/showthread.php?p=20841817

This thread is for development, please don't reply to this, as these two posts are already cluttering a productive development thread.