[ltp] Detect CD state after suspend [T61]

Richard Neill linux-thinkpad@linux-thinkpad.org
Wed, 01 Oct 2008 19:02:46 +0100


Fredrik Wendt wrote:
> s=F6n 2008-09-21 klockan 15:23 +0200 skrev Fredrik Wendt:
>> Hi.
>>
>> I'd just like to hear if anyone else recognize the symptoms I have wit=
h
>> the CD drive on my ThinkPad T61.
>>
>> From a full boot, using Ubuntu 8.04, I can insert and eject CDs withou=
t
>> any problems (I use sound-juicer quite a lot to rip my CDs to ogg) - i=
t
>> just works<tm>.
>> But, after a suspend to ram the CD drive just won't play any more. If =
a
>> CD was mounted before issuing the suspend command (Fn+F4, or from the
>> Gnome menu that appears after a quick press on the power button) then
>> that is how the hardware will look after resume. New CDs won't mount.
>> The same goes for an empty drive when issuing the suspend command. Aft=
er
>> a resume, new CDs won't mount.
>>
>> I'm having a hard time reproducing this right now though. But I
>> suspend/resume every time I go to/from work and every time I want to u=
se
>> the CD drive it just won't play with me.
>>

Do you realise that audio cds are not actually ever mounted?  If you try=20
  to mount one, you'll probably get the "what filesystem?" error you=20
describe.(*)

My suggestion is that you try first to debug this with a data-cd in the=20
drive, and see what that does.

Some diagnostic tools:

   grep hdc /proc/mounts		#is cdrom mounted. (may be sr0, or hda)

   cddb-id  /dev/cdrom           #is an (unmounted) audio-cd present?

   cdplay			#play an audio-cd (the old, analog way,
                                 #without resorting to cdda-extraction

   eject   			#eject the disk,
   eject -t			#tray-close. (makes software re-detect)


HTH,

Richard


P.S. Can I suggest a probable simple workaround: always eject the disk
before you suspend.


(*)A further complication is that all CD-ROM drives have the ability to=20
play an audio-cd just like a regular cd-player. This feature dates back=20
to the 486-era, when the CD-ROM drives had headphone outputs. To this=20
day, most motherboards have analog-connections to the CD-ROM, and *this*=20
is what the "CD" setting on the volume-control mixer refers to. Linux=20
supports this using commands such as "cdp" and "cdplay", which will go=20
on happily playing even as you shut-down the system.

Cdparanoia and friends (eg sound-juicer, grip, ...)  use the modern way=20
of digital-audio-extraction (CDDA). This gives you perfect fidelity.=20
(However, if you play a CD via CDDA, it's the PCM volume control; not=20
the CD one that matters in the mixer!).

Neither of these require mounting the Audio disc, which doesn't in fact=20
contain a real filesystem at all (except for some track indices).