Search This thread

codeworkx

Senior Recognized Developer
Nov 20, 2010
8,495
57,090
Bad Neustadt

codeworkx

Senior Recognized Developer
Nov 20, 2010
8,495
57,090
Bad Neustadt

Dude, this is a development thread.
Cleary statet at OP.

Use the Discussion thread like advised.

And...
* Submitting bug reports on nightly builds is the leading
* cause of male impotence.

Everyone knows about your problem because you've posted it 20 times on the discussion thread, wrote two emails to me, wrote at irc to me, pm'ed me....
WTF is wrong with you?

I'm not your personal supporter, i'm a dev and there are more important things to do for me than careing about your problem.
If you don't get a answer then try to fix it on your own, get used to it or flash a damn samsung rom.
BUT STOP ANNOYING US!!!!
 

codeworkx

Senior Recognized Developer
Nov 20, 2010
8,495
57,090
Bad Neustadt
If someone wants to work on opensource camera or omx:

- checkout cm sources
repo init -u git://github.com/CyanogenMod/android.git -b ics
- create .repo/local_manifest.xml

Code:
[B].repo/local_manifest.xml[/B]

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

    <project path="device/samsung/galaxys2" name="codeworkx/android_device_samsung_galaxys2" remote="github" revision="ics"/>
    <project path="bionic" name="codeworkx/android_bionic" remote="github" revision="ics"/>
    <project path="frameworks/base" name="codeworkx/android_frameworks_base" remote="github" revision="ics"/>
    <project path="hardware/libhardware" name="codeworkx/android_hardware_libhardware" remote="github" revision="ics" />
    <project path="hardware/samsung" name="codeworkx/android_hardware_samsung" remote="github" revision="ics" />
    <project path="vendor/samsung" name="codeworkx/proprietary_vendor_samsung" remote="github" revision="ics" />

</manifest>

- repo sync

HAL
https://github.com/codeworkx/android_hardware_samsung/tree/ics/exynos4/hal

OMX
https://github.com/codeworkx/android_hardware_samsung/tree/ics/exynos4/multimedia
 

StevenHarperUK

Senior Member
Nov 6, 2009
56
174
Lancashire
Bug with AudioService

Hi codeworkx,

Firstly thanks for all the hard work.

I have found two bugs with the Audio Control on my i9100P

When listening to Music with headphones, if another audio stream need to be heard (incoming notification), the headphones are muted and the interrupting audio plays on the phones speaker (not on the headphones).

Also when the 2nd audio stream is finished, the Headphones are always returned to Audio volume 1 - instead of the previous volume. On the next track the volume reverts back to normal.

Code:
E/AudioHardwareYamaha( 1690): setHeadphoneVolume: Set Headset Analog Volume control(1)
V/yamaha::media::CManager( 1690): setHeadphoneVolume(volume=1)
V/yamaha::media::VolumeCtrl( 1690): VolumeCtrl::setAnalogVolume(id=1, volume=5)
V/yamaha::media::VolumeCtrl( 1690): VolumeCtrl::createVolume()

I have a full checkout / build working - but I am too new to Android Rom development to debug this any further (I can code in C and Java).

Here is a full logcat
 

tlkh

Senior Member
Aug 12, 2010
111
39
titaniiiium.6te.net
Just wanted to add on something the post above missed.
If one presses the volume buttons, the volume "resets" itself and goes back to normal.

Sent from my Samsung Galaxy S II running CM9
 
  • Like
Reactions: kmelkon

StevenHarperUK

Senior Member
Nov 6, 2009
56
174
Lancashire
Another Sound Event Bug

Hi Again,

Another bug.

If you have music playing in the foreground, then insert some headphones the sound is defaulted to level 1, however when you attempt to adjust the volume, the sound jumps to its correct (remembered) setting.

Looking at the logcat it appears to be a problem with the parameters sent to setParameter method.

Code:
I/AudioHardwareYamaha( 1690): setHeadphoneVolume: We don't need to set Analog volume
I/AudioHardwareYamaha( 1690): ### setDeivceInCall = 00400000h  mEnabledDualMic 1
I/HeadsetService(12515): Headset=true; Bluetooth=false
I/HeadsetService(12515): Selected configuration: headset
I/EventHub( 1814): New device: id=19, fd=247, path='/dev/input/event9', name='sec_jack', classes=0x1, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false
I/InputReader( 1814): Device added: id=19, name='sec_jack', sources=0x00000101
[B]E/HeadsetService(12515): Invalid argument error in setParameter(1000, (short) 10000) == -4[/B]
I/AudioHardwareYamaha( 1690): AudioHardware::setDevices(devices=00000004h, mask=00023FFFh)
V/yamaha::media::CManager( 1690): setDevices(devices=00000004h)
V/yamaha::media::VolumeCtrl( 1690): VolumeCtrl::createVolume()

This is not effected when you pull out the headphones, as the music stops and the event that is caused when you hit the play button seems to fix the volume again.

Here is a bigger logcat - The first part is me inserting the headphones (while music is playing) after the gap is when I push the volume button.
 

StevenHarperUK

Senior Member
Nov 6, 2009
56
174
Lancashire
More digging

Hi again,

I have done a bit more digging:

The DSPManager.java is where the event is getting generated

packages/apps/DSPManager/src/com/bel/android/dspmanager/service/HeadsetService.java

Code:
	private void updateDsp(SharedPreferences preferences, EffectSet session) {
		session.mCompression.setEnabled(preferences.getBoolean("dsp.compression.enable", false));
		EffectSet.setParameter(session.mCompression, 0, Short.valueOf(preferences.getString("dsp.compression.mode", "0")));

		session.mBassBoost.setEnabled(preferences.getBoolean("dsp.bass.enable", false));
		session.mBassBoost.setStrength(Short.valueOf(preferences.getString("dsp.bass.mode", "0")));

		/* Equalizer state is in a single string preference with all values separated by ; */
		session.mEqualizer.setEnabled(preferences.getBoolean("dsp.tone.enable", false));
		if (mOverriddenEqualizerLevels != null) {
			for (short i = 0; i < mOverriddenEqualizerLevels.length; i ++) {
				session.mEqualizer.setBandLevel(i, (short) Math.round(Float.valueOf(mOverriddenEqualizerLevels[i]) * 100));
			}
		} else {
			String[] levels = preferences.getString("dsp.tone.eq.custom", "0;0;0;0;0").split(";");
			for (short i = 0; i < levels.length; i ++) {
				session.mEqualizer.setBandLevel(i, (short) Math.round(Float.valueOf(levels[i]) * 100));
			}
		}
		[B]EffectSet.setParameter(session.mEqualizer, 1000, Short.valueOf(preferences.getString("dsp.tone.loudness", "10000")));[/B]

		session.mVirtualizer.setEnabled(preferences.getBoolean("dsp.headphone.enable", false));
		session.mVirtualizer.setStrength(Short.valueOf(preferences.getString("dsp.headphone.mode", "0")));
	}

This method gets dealt with by the AudioEffect object

frameworks/base/media/java/android/media/audiofx/AudioEffect.java
Code:
    public int setParameter(byte[] param, byte[] value)
            throws IllegalStateException {
        checkState("setParameter()");
        return [B]native_setParameter(param.length, param, value.length, value);[/B]
    }


     /**
     * Operation failed due to bad parameter value.
     */
    public static final[B] int ERROR_BAD_VALUE = -4;[/B]

The Native method returns a -4 (see above) this is a bad parameter

Code:
E/HeadsetService( 2300): Invalid argument error in setParameter(1000, (short) 10000) == -4


Now I suspect its the second parameter of the call param, the ones that gets handed to the native method.

The value is 1000

However in the file

./frameworks/base/media/java/android/media/audiofx/Equalizer.java

The Statics for the Params in there are small numbers - 0-9.

This is as far as I have got, a comment in the top of Equalizer.java says

// These constants must be synchronized with those in
// frameworks/base/include/media/EffectEqualizerApi.h

But the frameworks/base/include/media/EffectEqualizerApi.h is missing.
 

StevenHarperUK

Senior Member
Nov 6, 2009
56
174
Lancashire
Car Dock

Hi Codeworkx

I have today received an Official Samsung SII Car Dock.
The dock has 1 USB connector (that goes into the phone) that is then split out into a USB power input and a Audio Jack input.

Currently the Audio Jack does not work. The expected behaviour is that the AudioService class should get an appropriate intent when it senses the Audio connection being connected.

Code:
private class AudioServiceBroadcastReceiver extends BroadcastReceiver {
        @Override
        public void onReceive(Context context, Intent intent) {

I have added some extra logging into the AudioService.java and while connected to adb via wireless, plugged in the dock.

I do get this intent (ACTION_DOCK_EVENT)

Code:
V/AudioService( 2028): Broadcast Receiver: Got action = android.intent.action.DOCK_EVENT
V/AudioService( 2028): Broadcast Receiver: Got ACTION_DOCK_EVENT, dockState = 2

The Extra dock state is Intent.EXTRA_DOCK_STATE_CAR which is right - infact on the device I can see the dock Icon.

However the current code in that block sets the Audio to be the BT Car Dock.
I had hoped that this may be the reason why I was getting no audio - so I changed the default to the USB Analog Dock

Code:
//config = AudioSystem.FORCE_BT_CAR_DOCK;
config = AudioSystem.FORCE_ANALOG_DOCK;

This didn't seem to work either, so I noticed that the config for the force is actualy set for each type - so I added the following after the AudioSystem.FOR_DOCK

Code:
AudioSystem.setForceUse(AudioSystem.FOR_MEDIA, config);

Again this did not work.


So I had an Idea - the dock event is not the same as an audio plug even - when I pug into the normal audio jack I get a new Intent (for the top jack).
I dont get anything for the dock audio.

Further down the same class I see the following

Code:
 } else if (action.equals(Intent.ACTION_USB_ANLG_HEADSET_PLUG)) {
                int state = intent.getIntExtra("state", 0);
                Log.v(TAG, "Broadcast Receiver: Got ACTION_USB_ANLG_HEADSET_PLUG, state = "+state);
                synchronized (mConnectedDevices) {

This seems to be what I am looking for.

So what is stopping the intent event being fired?

Is there something missing from the Kernel to support the USB Analog Headset?

My Java debugging is pretty good, but my lack of Kernel & Android experience is stopping me get any further.

Thanks


Steven
 

Top Liked Posts