Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bugs
  • Category Applications
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by yapper - 2008-01-26
Last edited by Marc_Guay - 2008-04-21

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

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).

Closed by  Marc_Guay
2008-04-21 01:12
Reason for closing:  Duplicate
Additional comments about closing:  

Patch is here:  FS#8920 

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;

#else

  return (GPIOC_INPUT_VAL & 0x1)?true:false;

#endif
}
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.

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;
  }
  else
  {
	/* 1G has no headphone detection, so fake insertion */
	return (true);
}

#else

return (GPIOC_INPUT_VAL & 0x1)?true:false;

#endif
}

FYI - Headphone detection works fine on my 3G iPod with current release code.

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.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing