[Nexus One Android Development] distortedloop:
And now I can reproduce the problem 100%, although under slightly different steps:

1: Play a song in Music.

2: Pause the song in Music.

3: Kill Music with a task manager.

4: Pull headphones out of the jack.

The song you had paused will start playing. Music does not show as a running task. Open Music and it shows the song is paused. Hit play, it still plays, hit pause, the song pauses.

At that point you can pull the headphones and the song won't start playing.

It only happens to me if Music has been quit (either through killing it or a reboot.

I ran adb logcat here's the output for both when it starts on its own, and when it doesn't.

Starts on own with Music killed:

V/HeadsetObserver( 92): Headset UEVENT: {SUBSYSTEM=switch, SWITCH_STATE=129, DEVPATH=/devices/virtual/switch/h2w, SEQNUM=807, ACTION=change, SWITCH_NAME=Headset}
V/HeadsetObserver( 92): Intent.ACTION_HEADSET_PLUG: state: 1 name: Headset mic: 1
D/KeyguardViewMediator( 92): wakeWhenReadyLocked(26)
D/KeyguardViewMediator( 92): handleWakeWhenReady(26)
D/KeyguardViewMediator( 92): pokeWakelock(5000)
I/power ( 92): *** set_screen_state 1
D/SurfaceFlinger( 92): Screen about to return, flinger = 0x116758
D/Sensors ( 92): using /dev/input/event6 (name=compass)
D/Sensors ( 92): using /dev/input/event3 (name=proximity)
D/Sensors ( 92): using /dev/input/event0 (name=lightsensor-level)
D/Sensors ( 92): data__data_open: compass fd = 129
D/Sensors ( 92): data__data_open: proximity fd = 143
D/Sensors ( 92): data__data_open: light fd = 144
D/WifiService( 92): ACTION_SCREEN_ON
D/AK8973 ( 80): Compass Start
D/ViewFlipper( 171): updateRunning() mVisible=false, mStarted=true, mUserPresent=true, mRunning=false
I/AudioHardwareQSD( 76): Routing audio to Wired Headset
D/AudioHardwareQSD( 76): Switching audio device to
D/AudioHardwareQSD( 76): Stereo Headset
W/AudioFlinger( 76): write blocked for 178 msecs, 18 delayed writes, thread 0xd768
D/dalvikvm( 774): GC freed 8778 objects / 456424 bytes in 37ms
I/AudioHardwareQSD( 76): AudioHardware pcm playback is going to standby.
I/ActivityManager( 92): Starting activity: Intent { flg=0x4400000 cmp=com.rechild.advancedtaskkiller/.AdvancedTaskKiller bnds=[0,485][480,581] }
W/ActivityManager( 92): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { flg=0x4400000 cmp=com.rechild.advancedtaskkiller/.AdvancedTaskKiller bnds=[0,485][480,581] }
D/dalvikvm( 557): GC freed 2880 objects / 174048 bytes in 37ms
D/ActivityManager( 92): Uninstalling process com.android.music
D/ActivityManager( 92): Force removing process ProcessRecord{45fe53d0 1286:com.android.music/10031} (com.android.music/10031)
W/ActivityManager( 92): Scheduling restart of crashed service com.android.music/.MediaPlaybackService in 5000ms
I/Process ( 92): Sending signal. PID: 1286 SIG: 9
D/ActivityManager( 92): Force finishing activity com.android.music/.MediaPlaybackActivity
W/ActivityManager( 92): Activity HistoryRecord{45fdccb0 com.android.music/.MediaPlaybackActivity} being finished, but not in LRU list
D/ActivityManager( 92): Force finishing activity com.android.music/.ArtistAlbumBrowserActivity
W/ActivityManager( 92): Activity HistoryRecord{45f052b8 com.android.music/.ArtistAlbumBrowserActivity} being finished, but not in LRU list
I/WindowManager( 92): WIN DEATH: Window{45e8db98 com.android.music/com.android.music.ArtistAlbumBrowserActivity paused=true}
D/ActivityManager( 92): Received spurious death notification for thread android.os.BinderProxy@4601b6b0
I/WindowManager( 92): WIN DEATH: Window{45f11828 com.android.music/com.android.music.MediaPlaybackActivity paused=true}
W/ResourceType( 92): Resources don't contain package for resource number 0x7f070000
W/AdMob SDK( 557): Cannot render the ad into 483 vertical pixels because it must be 48 tall.
W/AdMob SDK( 557): Cannot render the ad into 483 vertical pixels because it must be 48 tall.
W/InputManagerService( 92): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@45f8d2d8
V/HeadsetObserver( 92): Headset UEVENT: {SUBSYSTEM=switch, SWITCH_STATE=0, DEVPATH=/devices/virtual/switch/h2w, SEQNUM=808, ACTION=change, SWITCH_NAME=Headset}
I/ActivityManager( 92): Start proc com.android.music for broadcast com.android.music/.MediaButtonIntentReceiver: pid=1324 uid=10031 gids={3003, 1015}
W/MediaPlayer( 1324): info/warning (1, 44)
D/MediaPlaybackService( 1324): restored queue, currently at position 150354/289888 (requested 150354)
I/MediaPlayer( 1324): Info (1,44)
W/MediaPlayer( 1324): info/warning (1, 44)
I/MediaPlayer( 1324): Info (1,44)
W/AudioFlinger( 76): write blocked for 166 msecs, 19 delayed writes, thread 0xd768
V/HeadsetObserver( 92): Intent.ACTION_HEADSET_PLUG: state: 0 name: Headset mic: 1
I/AudioHardwareQSD( 76): Routing audio to Speakerphone
D/AudioHardwareQSD( 76): Switching audio device to
D/AudioHardwareQSD( 76): Speakerphone
I/ActivityManager( 92): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher2/.Launcher }
W/InputManagerService( 92): Ignoring hideSoftInput of: com.android.internal.view.IInputMethodClient$Stub$Proxy@45e60318
V/RenderScript_jni( 171): surfaceCreated
V/RenderScript_jni( 171): surfaceChanged
V/RenderScript( 171): setSurface 480 762 0x414990
D/ViewFlipper( 171): updateRunning() mVisible=true, mStarted=true, mUserPresent=true, mRunning=true
W/InputManagerService( 92): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@460ca528 (uid=10077 pid=557)
I/ActivityManager( 92): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.music/.MusicBrowserActivity bnds=[365,234][475,352] }
I/ActivityManager( 92): Starting activity: Intent { act=android.intent.action.PICK dat= typ=vnd.android.cursor.dir/artistalbum flg=0x4000000 cmp=com.android.music/.ArtistAlbumBrowserActivity (has extras) }
I/ActivityManager( 92): Displayed activity com.android.music/.ArtistAlbumBrowserActivity: 229 ms (total 257 ms)
E/MusicUtils( 1324): Trying to unbind for unknown Context
V/RenderScript_jni( 171): surfaceDestroyed
V/RenderScript( 171): setSurface 0 0 0x0
D/ViewFlipper( 171): updateRunning() mVisible=false, mStarted=true, mUserPresent=true, mRunning=false
I/ActivityManager( 92): Starting activity: Intent { cmp=com.android.music/.MediaPlaybackActivity }
D/dalvikvm( 1324): GC freed 2631 objects / 169248 bytes in 39ms
D/dalvikvm( 1324): GC freed 998 objects / 61648 bytes in 52ms
I/ActivityManager( 92): Displayed activity com.android.music/.MediaPlaybackActivity: 350 ms (total 350 ms)
I/AudioHardwareQSD( 76): AudioHardware pcm playback is going to standby.

Operates as expected, Music app running but paused:

D/dalvikvm( 472): GC freed 537 objects / 24000 bytes in 62ms
V/HeadsetObserver( 92): Headset UEVENT: {SUBSYSTEM=switch, SWITCH_STATE=129, DEVPATH=/devices/virtual/switch/h2w, SEQNUM=809, ACTION=change, SWITCH_NAME=Headset}
V/HeadsetObserver( 92): Intent.ACTION_HEADSET_PLUG: state: 1 name: Headset mic: 1
I/power ( 92): *** set_screen_state 0
D/Sensors ( 92): using /dev/input/event6 (name=compass)
D/Sensors ( 92): using /dev/input/event3 (name=proximity)
D/Sensors ( 92): using /dev/input/event0 (name=lightsensor-level)
D/ViewFlipper( 171): updateRunning() mVisible=false, mStarted=true, mUserPresent=false, mRunning=false
D/WifiService( 92): ACTION_SCREEN_OFF
D/SurfaceFlinger( 92): About to give-up screen, flinger = 0x116758
D/AK8973 ( 80): Compass CLOSE
I/power ( 92): *** set_screen_state 1
D/SurfaceFlinger( 92): Screen about to return, flinger = 0x116758
D/Sensors ( 92): using /dev/input/event6 (name=compass)
D/Sensors ( 92): using /dev/input/event3 (name=proximity)
D/Sensors ( 92): using /dev/input/event0 (name=lightsensor-level)
D/Sensors ( 92): data__data_open: compass fd = 138
D/Sensors ( 92): data__data_open: proximity fd = 143
D/Sensors ( 92): data__data_open: light fd = 144
D/WifiService( 92): ACTION_SCREEN_ON
D/AK8973 ( 80): Compass Start
I/AudioHardwareQSD( 76): Routing audio to Wired Headset
D/AudioHardwareQSD( 76): Switching audio device to
D/AudioHardwareQSD( 76): Stereo Headset
W/AudioFlinger( 76): write blocked for 182 msecs, 20 delayed writes, thread 0xd768
D/dalvikvm( 92): GC freed 31574 objects / 1645048 bytes in 111ms
D/Email ( 395): Upsyc triggered for message id=94
D/Email ( 395): *** synchronizeMailboxGeneric ***
I/ActivityManager( 92): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher2/.Launcher }
W/InputManagerService( 92): Ignoring hideSoftInput of: com.android.internal.view.IInputMethodClient$Stub$Proxy@45fbb4a0
V/RenderScript_jni( 171): surfaceCreated
V/RenderScript_jni( 171): surfaceChanged
V/RenderScript( 171): setSurface 480 762 0xa8c4b0
D/ViewFlipper( 171): updateRunning() mVisible=true, mStarted=true, mUserPresent=false, mRunning=false
I/AudioHardwareQSD( 76): AudioHardware pcm playback is going to standby.
V/HeadsetObserver( 92): Headset UEVENT: {SUBSYSTEM=switch, SWITCH_STATE=0, DEVPATH=/devices/virtual/switch/h2w, SEQNUM=810, ACTION=change, SWITCH_NAME=Headset}
D/dalvikvm( 774): GC freed 9951 objects / 530504 bytes in 37ms
V/HeadsetObserver( 92): Intent.ACTION_HEADSET_PLUG: state: 0 name: Headset mic: 1

I hope that's helpful. If this isn't a CM issue, I can bring it over to Google's bug reporting site.

P.S. - I'm on 5.0.4.1 with the latest .33 undervolt kernel