[Gta04-owner] Headset detection bouncing during calls in A3

NeilBrown neilb at suse.de
Fri Sep 14 09:13:00 CEST 2012


On Mon, 10 Sep 2012 13:08:57 +0200 Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
wrote:

> Hi,
> 
> If I do evtest /dev/input/jack during a call in SHR, I've that:
> root at om-gta04:~# evtest /dev/input/jack 
> Input driver version is 1.0.1
> Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
> Input device name: "gta04 Headset Jack"
> Supported events:
>   Event type 0 (Sync)
>   Event type 5 (?)
>     Event code 2 (?)
>     Event code 4 (?)
> Testing ... (interrupt to exit)
> Event: time 946691723.367524, type 5 (?), code 2 (?), value 0
> Event: time 946691723.367524, type 5 (?), code 4 (?), value 0
> Event: time 946691723.367555, -------------- Report Sync ------------
> Event: time 946691723.867401, type 5 (?), code 2 (?), value 1
> Event: time 946691723.867432, type 5 (?), code 4 (?), value 1
....
> it bounces between 0 and 1, it doesn't do it during regular music
> playing...
> 
> That prevents me from adding a gsmheadset scenario which would make
> possible to redirect the sound and recording of the call to the
> headset...which is good for the health(else you keep the phone close to
> your head which is a very bad idea).
> 

Hmm... it looks like the numbers that we get from the ADC which reads the
microphone presence are not very stable or reliable.  It looks like I'm going
to have to add some hysteresis.  i.e. once I choose a setting, require a
change of at least 40 before accepting a new setting.  I still need some
cut-off to decide in the initial insertion is with a mic or without.

I've seen 'without microphone' numbers as high as 850 (often lower), and
'with microphone' numbers as low as 840! (usually higher), though I think
that 840 was wired wrongly - I cannot reproduce it now.  So I'll try 870.

If you (or anyone) would like to run

   watch -n 0.2 -d cat /sys/class/hwmon/hwmon0/device/in7_input 

at the same time as 'evtest /dev/input/jack', and see what numbers are
reported in different states, it might be very helpful.

Thanks,
NeilBrown
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/gta04-owner/attachments/20120914/ef3aa17f/attachment-0001.bin>


More information about the Gta04-owner mailing list