Routing Audio data to Both HEADSET and SPEAKER.

by Anand » Thu, 22 Apr 2010 19:43:18 GMT


Sponsored Links
 Hi,

As particular need, I want to route the Audio data to both HEADSET and
SPEAKER. For example if I play a Music file, I want that the output
should come on speaker and on headset as well. My first question is
weather is it possible or not in the current clair SDK.

As per my understanding, the Headset plugging/unplugging is detected
by the kernel switch driver and the event is sent to
HeadsetObserver.java. Then HeadsetObserver.java broadcasts the intent
Intent.ACTION_HEADSET_PLUG with information about state as plugged/
unplugged. This intent is received by PhoneApps.java and the
audiomanager/audioFlinger is informed to turn on/off the speaker. The
audioManager/AudioFlinger further passes the information to
Libaudio.so (AudioHardware.cpp). Then in the end the information is
passed to kernel to switch between the speakerphone and Headset.

I have found a case in AudioHardware.cpp as
SND_DEVICE_HEADSET_AND_SPEAKER.

That being said, please tells me how I can enable both the Headset and
Speakerphone. Incase required, I can furnish more investigation, what
I have done so far.

Thanks
Anand

--



Other Threads

1. Bug in Notepadv3 Tutorial

Hi, I have found a bug in the NoteEdit class. The bug lies in the
"outState.putLong(NotesDbAdapter.KEY_ROWID, mRowId);" statement in
onSaveInstanceState() method.

When a new note is created the mRowId is null. If the application is
terminated while user is editing a new note, an uncaught
NullPointerException will be thrown because an null parameter is
passed into outStat.putLong().

To reproduce the bug:
1. Launch Notepadv3 application.
2. Press the "Menu" key.
3. Select "Add Note".
4. Press the "Home" key to terminate application.


I think it can be solved by replacing the statement with saveState().

--~--~---------~--~----~------------~-------~--~----~

2. startActivity called from non-Activity context - help

This message appeared in logcat when selecting a notification ...

startActivity called from non-Activity context; forcing
Intent.FLAG_ACTIVITY_NEW_TASK for: Intent {
comp={com.blah.blahs/com.blah.blahs.Blahs} (has extras) }

It brings the Activity into focus which is half the battle ... thing is, I
have no idea what function to read the intent details from.  It does not
call onCreate ... or startActivity.

I have posted this several times ... feeling a bit stuck.  Help super
appreciated.

j

--~--~---------~--~----~------------~-------~--~----~

3. wifi icon always shows no bars

4. listeners in popupwindow

5. I just have to say thanks to google. The iPhone review process was killing me, but this is great

6. Android NDK problem withe samples

7. Retrieving Google/GTalk Account bound to Android?