[Debug] Headphone rerouting - Android Q&A, Help & Troubleshooting

Well I ported MIUI to my device, using a CM10 base. I know the last guy that managed MIUI for my phone had switched to an AOKP base because of this exact issue.
When playing music and plugging in headphones, audio continues to play through speakers instead of rerouting to the headphones.
I was wondering if anyone else has had this issue that can help. I tried searching around, but nobody said anything on how they fixed it, except switching to an AOKP base.
I think this is the issue
Code:
D/AudioSessionOutALSA( 139): Pausing the driver
D/ALSAStreamOps( 139): setParameters(): keyRouting with device 2
D/ALSADevice( 139): route: devices 0x2 in mode 0
D/ALSADevice( 139): No valid input device: 0
But I am not sure.. Here's the entire logcat if anyone wants to take a look
http://pastebin.com/CnNqZf9c

Related

[Q] Need help figuring out voice call

For educational purposes I'm trying to understand how audio is routed from/to the radio during a voice call. By running strace on my N1 I was able to see this:
- Audio is played back to the AudioFlinger (i see write() to /dev/msm_pcm_out)
- Recording is not done using msm_pcm_in - maybe DMA directly to the modem?
- Most of the work is done in the propriety libhtc_ril.so
Couldn't find anywhere in the source code where an AudioTrack is created for the voice call.
If anyone could shed some light on this I'd be grateful.
Thanks.

X10 Headphone port not working

Hey everyone,
I have a SE Xperia X10 which I upgraded to CM 6.1.3 V4.4 yesterday.
So far it is working GREAT, but I am unable to play music through the headphone port.
I'm using the official SE headphones, and I'm certain that they are working fine.
Does anyone know how to fix this? I can't seem to find any thread that has anyone else having this problem.
Regards
Hamzah
I got the same problem, only after upgrading to 2.1.
My solution is to try a few times untill the phone recognizes the headphones, might take some time thought, Sony couldn't find the problem
The strange thing is, when I use adb logcat, it looks like the phone is detecting that something was plugged into the socket, and even the remote control works, but no sound.
I tried connecting my desktop speakers to it, and strangely I hear a very strange sound like it is trying to output sound, but failing.
Anyone have any ideas?
I've attached the output of logcat.
lol I had to laugh when I read this
V/HeadsetObserver( 1573): Headset UEVENT: {SUBSYSTEM=switch, SWITCH_STATE=2, DEVPATH=/devices/virtual/switch/h2w, SEQNUM=1455, ACTION=change, SWITCH_NAME=Headset}
V/HeadsetObserver( 1573): Intent.ACTION_HEADSET_PLUG: state: 1 name: Headset mic: 0
W/Vold ( 1445): Ignoring unknown switch 'Headset'
and then right after this
D/dalvikvm( 2210): GC_EXPLICIT freed 711 objects / 31624 bytes in 29ms
D/dalvikvm( 2115): GC_EXPLICIT freed 695 objects / 34520 bytes in 74ms
V/HeadsetObserver( 1573): Headset UEVENT: {SUBSYSTEM=switch, SWITCH_STATE=0, DEVPATH=/devices/virtual/switch/h2w, SEQNUM=1456, ACTION=change, SWITCH_NAME=No Device}
W/TimedEventQueue( 1450): Event 238 was not found in the queue, already cancelled?
W/Vold ( 1445): Ignoring unknown switch 'No Device'
D/dalvikvm( 2303): GC_FOR_MALLOC freed 2801 objects / 217096 bytes in 54ms
How's it going to recognize the name "headset" then plain out ignore it??
Ignoring "no device" well I'm ok with that. lol
Hi,
I'm having the same problem... I tried looking for any errirs using logcat. But there was nil.
Also, I have pulled the phone apart and removed the headphone jack and had a quick looksies at it. Everthing seemed a.o.k. and Audio on the headset even worked for a while. But it stopped again.
Does anyone have any idea of whats causing this, i.e. Hardware/Software bug.
I've tried it using stock SE 2.1 and Wolfbreak's V008 to no avail on my X10i.
Sedge16 said:
Hi,
I'm having the same problem... I tried looking for any errirs using logcat. But there was nil.
Also, I have pulled the phone apart and removed the headphone jack and had a quick looksies at it. Everthing seemed a.o.k. and Audio on the headset even worked for a while. But it stopped again.
Does anyone have any idea of whats causing this, i.e. Hardware/Software bug.
I've tried it using stock SE 2.1 and Wolfbreak's V008 to no avail on my X10i.
Click to expand...
Click to collapse
I am having this same issue on my wife's x10. Seems like a hardware issue since it has done the same thing with stock 2.1, Wolf's TW Gingerbread, and is still doing it on MIUI pRiMe. The sound through the headphones works sometimes for a few seconds to a minute, but always cuts out. When it cuts out, the headset icon on the notification bar goes out. we have had these for less than a year. Is this something SE will fix under warranty?
Just spoke with SE and they will do a warranty repair on the phone. Now I just need to relock the bootloader and repair with SEUS.
Aw, I got this problem today, and googled this thread. This seems to be a common problem - a plug-in checking sensor has failed. And I even found someone to solve this hardware problem by himself: http://forum.xda-developers.com/showthread.php?t=1472440
But I finally come to an easy solution: to install a widget called "Toggleheadset2" . All it does is to bypass the hardware check and force audio to play by headphones.
So every time I just click the widget to turn my headphone on/off. I think I can live with it.
It works on my 2.3 system, and I Hope this information could help someone.
Hello,
abigzhong said:
Aw, I got this problem today, and googled this thread. This seems to be a common problem - a plug-in checking sensor has failed. And I even found someone to solve this hardware problem by himself: http://forum.xda-developers.com/showthread.php?t=1472440
But I finally come to an easy solution: to install a widget called "Toggleheadset2" . All it does is to bypass the hardware check and force audio to play by headphones.
So every time I just click the widget to turn my headphone on/off. I think I can live with it.
It works on my 2.3 system, and I Hope this information could help someone.
Click to expand...
Click to collapse
Finally I've solved my problem with HEADPHONE FIX application found on Market.
Toogle Headset didnt work on my X10 Mini.
abigzhong said:
Aw, I got this problem today, and googled this thread. This seems to be a common problem - a plug-in checking sensor has failed. And I even found someone to solve this hardware problem by himself: http://forum.xda-developers.com/showthread.php?t=1472440
But I finally come to an easy solution: to install a widget called "Toggleheadset2" . All it does is to bypass the hardware check and force audio to play by headphones.
So every time I just click the widget to turn my headphone on/off. I think I can live with it.
It works on my 2.3 system, and I Hope this information could help someone.
Click to expand...
Click to collapse
thanks alot this app qorked for me and aaved me a lot trouble I even took my phone to a local repair shop they opened it and said sorry we could not repair it I thought I will never hear muaic on my device but this app solved all the problems juat by a click

[Q] HD2 audio issues (ParanoidAndroid 1.4a NAND)

Hi all,
I have an HD2 with Paranoid Android (1.4a CM9 NAND), along with Supercharger V6 and Mounts2sd 4.5.0.
I'm experiencing some phone audio issues that pop up and then mysteriously go away again. Specifically I cannot hear the audio from the other caller and the only way to have the conversation is by turning on speakerphone (which always works but is quite inconvenient). The other party can always hear me alright.
Anyone else experiencing this? I think this may be related to my Skype, Linphone and CSipsimple installations too but I'm not sure where to look to start debugging. In fact I notice the same strange behavior sometimes in skype too.
Thanks,
Janus
Here's some debug log info:
2012-06-28 15:58:46.045 W 722/AudioPolicyManager: getDeviceForStrategy() unknown strategy: 4
2012-06-28 15:58:46.175 E 1191/PrivacyPersistenceAdapter: getSettings - failed to get settings for package: com.csipsimple
java.lang.IllegalMonitorStateException
at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java)
........................................................................................
2012-06-28 15:58:46.175 W 1191/System.err: java.lang.IllegalMonitorStateException
2012-06-28 15:58:46.175 W 1191/System.err: at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java)
and so I need to enable speakerphone to hear the audio
2012-06-28 16:01:15.755 I 722/AudioHardwareQSD: Routing audio to Speakerphone
2012-06-28 16:01:15.755 D 722/AudioHardwareQSD: Switching audio device to
2012-06-28 16:01:15.755 D 722/AudioHardwareQSD: Speakerphone
2012-06-28 16:01:15.765 I 1191/ActivityManager: START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=yuku.logviewer cmp=yuku.logviewer/.ac.MainActivity bnds=[240,228][360,387]} from pid 1924
2012-06-28 16:01:15.835 D 1924/OpenGLRenderer: Flushing caches (mode 1)
Added more specific debug logs regarding the audio issue.
Hopefully someone can help out and/or a mod can move this thread into the ParanoidAndroid ROM thread?
Thanks
Bump. Anyone?
If no one can help with the audio issues, can someone suggest a stable barebones ICS ROM for the HD2?
I like Paranoid Android but I rather have a barebones ROM that has few bugs than a fully loaded buggy one (at least that has been my experience with audio in PA 1.4a Nand).
Thanks

Problem with Bluetooth and CM13

Hi
I have installed CM13.0 - 20160114 with a clean install.
My problem is, that I tried to use BT with the speakerphone in my car. It connects, but when I want to make a call it doesn't work. Recieving call works with a short delay.
Next problem is, that my heart rate belt doesn't work. I use runtastic, since I had the Blueooth MIDI Service in Doze as "not optimzed", the belt is shown as a Bluetooth device (before it was even not shown), but no pairing.
In CM11 all works fine. Can anybody help me, please? When this doesn't work, I have to go back to CM11.
regards
Friedrich
CM13 (2016-05-12) + BT + Audi A3 speakerphone
I have installed 13.0-20160512-NIGHTLY-i9300 (clean install)
I come from Samsung stock ROM (Android 4.3):
I tried to use BT with the speakerphone in my car (Audi A3). Samsung S3 connects, but when I want to make a call it does not work. The display of the car states: "Netzwerkfehler" (network error). Recieving call works fine. There was never a problem with "Android 4.3".
Could you please fix this issue?
I am going to explain this once so that you know that whatever voodoo or dancing around a build.prop filre because it will do nothing with your bluetooth issue.
/* if we're over buffer high water mark, we're done */
if ((p_port->tx.queue_size > PORT_TX_HIGH_WM)
|| (p_port->tx.queue.count > PORT_TX_BUF_HIGH_WM))
{
port_flow_control_user(p_port);
event |= PORT_EV_FC;
debug("tx queue is full,tx.queue_size:%d,tx.queue.count:%d,available:%d",
p_port->tx.queue_size, p_port->tx.queue.count, available);
break;
}
What we have here is a failure to communicate lol.
The mtu is not being properly negotiated causing overflows of the the audio buffer. So what are the options.
https://issuetracker.google.com/issues/36905704 join the other few thousand people with the same problem.
Look at the 5.0 code https://android.googlesource.com/pl...id/+/android-5.0.0_r3/stack/rfcomm/port_api.c
Which was working.... or use the following to fix the bug
http://androiddoc.qiniudn.com/reference/android/bluetooth/BluetoothGatt.html
Or use a third party app from play store. Testing one right now.
To verify the problem logcat and look for
tx queue is full,tx.queue_size:%d,tx.queue.count:%d,available:%d
I ended up using a third party free ap I found that fixed the mtu issue https://play.google.com/store/apps/details?id=eu.darken.bluemusic&hl=en
The more you know the less time on this pain in the bluetooth you will blow

Audio input signal path - minimizing phase distortion/HPF

After digging into the kernel code for the Qualcomm WCD audio codecs on a few phones (Hammerhead, Pixel, Nexus 6P) I'm having some trouble figuring out how to access the DC blocking/high-pass filter being applied to a signal coming in through the headset mic line (ADC2 on some phones). Looking at the spectrum on all of these phones shows a definite high-pass filter shape with a cutoff between 50-100 Hz depending on the phone. What is more problematic is the phase distortion that the DC blocker is applying.
Originally I tried modifying the TX HPF Cutoff settings as well as turning it on in cases where it was still off during recording, just to see if it would have an effect. These values don't seem to affect the signal at all, whether it's set to 3 Hz, the default of 75, or the max of 150. I believe the TX HPF is only part of the signal chain during telephony modes and not during normal recording. There are also IIR filters available with these Qualcomm codecs but looking at the datasheet for the WCD9311 (the only one publicly available) shows that these are for sidetone processing and not the direct ACD headset mic path, so again it seems these are only applicable in telephony modes.
For my application the raw signal is desired - so minimal HPF effects, no ANC, no Compander, and no automatic gain control. Basically what the new UNPROCESSED config in Nougat is supposed to provide, but testing so far on the Pixel has shown that this HPF+phase distortion are still happening even when running a clean square wave or similar signal in through the headset mic line. I'm using TinyMixer to check exposed mixer path values over adb in real-time while recording (and comparing the values to what they are before recording).
In the past on the Nexus S this problem could be overcome with root by modifying a register (the enum was something like ADC High Pass Filter Switch), but the mixer paths for these WCD9xxx codecs are a little more complex with no signs of a single HPF switch for this ADC line that exists outside of the TX one. This doesn't seem to be a problem that many people face but I was hoping for any insight anyone here may have, and also hoping that anyone who needs to use this line in without distorting their signals will be able to find a solution in the future, at least before USB C over and the 3.5mm jack becomes obsolete.

Categories

Resources