Warning: mysqli_real_connect(): Headers and client library minor version mismatch. Headers:50625 Library:50543 in /sites/rockbox.org/flyspray/adodb/drivers/adodb-mysqli.inc.php on line 108 FS#8519 : Headphone detection for iPod 2G is broken



FS#8519 - Headphone detection for iPod 2G is broken

Attached to Project: Rockbox
Opened by Mark Fawcus (yapper) - Saturday, 26 January 2008, 19:28 GMT
Last edited by Marc Guay (Marc_Guay) - Monday, 21 April 2008, 01:12 GMT
Task Type Bugs
Category Applications
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Currently button-1g-3g.c looks at GPIO C bit 0, but it appears (through experimentation on a 2G and from http://ipodlinux.org/GPIO) that the 2G and 3G models use GPIO B bit 0 (and the 1G appears to not support detection).
This task depends upon

Closed by  Marc Guay (Marc_Guay)
Monday, 21 April 2008, 01:12 GMT
Reason for closing:  Duplicate
Additional comments about closing:  Patch is here:  FS#8920 
Comment by Mark Fawcus (yapper) - Saturday, 26 January 2008, 19:42 GMT
My initial forum posting on this issue is here : http://forums.rockbox.org/index.php?topic=15143.0

Complications (to me) in fixing this across the 1G/2G/3G include:
The 1G seems to use GPIO B bit 0 for scrollwheel enable, and the same bit is used by the 2G for headphone detection
The 1G and 2G seem to be logically grouped in the code
I'm not sure if the 3G is also broken.

I was thinking of proposing something like:
bool headphones_inserted(void)
#ifdef IPOD_1G2G
return (GPIOB_INPUT_VAL & 0x1)?true:false;
return (GPIOC_INPUT_VAL & 0x1)?true:false;
to leave the 3G untouched, but this also means that the 1G will be seeing the scrollwheel enable state. Maybe someone who has more experience can unravel a solution.
Comment by Mark Fawcus (yapper) - Friday, 21 March 2008, 14:28 GMT
This is probably a bit better in terms of the 1G and 2G (still need to find if the 3G is currently broken too - I'm posting a forum topic for user feedback):

bool headphones_inserted(void)
#ifdef IPOD_1G2G
if ((IPOD_HW_REVISION >> 16) == 2)
return (GPIOB_INPUT_VAL & 0x1)?true:false;
/* 1G has no headphone detection, so fake insertion */
return (true);
return (GPIOC_INPUT_VAL & 0x1)?true:false;
Comment by Bill Tsang (gardengate) - Wednesday, 16 April 2008, 03:40 GMT
FYI - Headphone detection works fine on my 3G iPod with current release code.
Comment by Mark Fawcus (yapper) - Sunday, 20 April 2008, 22:59 GMT
Thanks Bill.
I've filed a patch for this under  FS#8920  that leaves the 3G detection method unchanged, and fixes it for the 2G.