[ltp] suspend together with ALSA and with PCMCIA ISDN card on ThinkPad T23

Martin Steigerwald linux-thinkpad@linux-thinkpad.org
Sat, 12 Mar 2005 00:30:54 +0100


Hello,

I now use this suspend to ram script which solves issue 1 and 2 posted in 
my previous e-mail:

-------------------------------------------------------------------------
#!/bin/sh

# stop ALSA
/etc/init.d/alsa stop

# stop ISDN
/etc/init.d/isdn stop

# stop PCMCIA
/etc/init.d/pcmcia stop

# suspend to RAM
echo mem > /sys/power/state

# restart PCMCIA
/etc/init.d/pcmcia start

# restart isdn
# this wait is needed. otherwise it won't work
sleep 1
/etc/init.d/isdn start

# wait some more time for restarting sound to avoid jitter during playback
sleep 4
/etc/init.d/alsa start
-------------------------------------------------------------------------

I use this script for fn-f4 and the ibm-lid event.

ALSA also works this way when I have an application playing back music 
while I initiate suspend. Sound will start playing happily again after my 
KDE 3.3 desktop is up and running. 

Only once out of many tests I had it that sound would not recover.

With suspend to disk don't work that way. ALSA works, but the PCMCIA stuff 
does not work. 

Well specifically that "/etc/init.d/pcmcia stop" thing that is supposed to 
handle my AVM Fritzcard PCMCIA A1 - the Mercury USB 2.0 USB Controller 
(NEC chipsets) is handled by hotplug and this is working fine so far it 
seems. 

When I use "/etc/init.d/pcmcia stop" before suspend to disk the system 
hangs after the message"cs: unable to map card memory". 

I also get this message when doing suspend to ram, but with suspend to ram 
the system suspends anyway. With suspend to disks it hangs.

Doing "/etc/init.d/pcmcia restart" when awakening after suspend to disk 
doesn't help either. Kernel doesn't find the /dev/ippp? device anymore.

The ISDN card  will only work when I pull it out and plug it in again. So 
I made the best out of it, left the PCMCIA stuff out and just added a 
"/etc/init.d/isdn start" after some timeout. This leaves me time to pull 
the card out and plug it back in again before ISDN is reconfigured 
automatically. 

Two ways work:

1) Pulling the ISDN card out before suspend to disk and putting it back in 
after suspend to disk awaked enough.

2) Leaving the card in during suspend to disk and pulling it out and 
plugging it back in afer suspend to disk awaked enough.

Well that will do for now. Any hints on the PCMCIA issue? 

Anyway I am awesome happy about that almost everything works now. Suspend 
to disk and suspend to RAM are really usable for me after a long time of 
trying around.

Okay,  before I go to bed, this is my suspend to disk script:

-------------------------------------------------------------------------
#!/bin/sh

# stop isdn
/etc/init.d/isdn stop

# stop pcmcia
# leads to: "cs: unable to map card memory"
#/etc/init.d/pcmcia stop

# stop alsa
/etc/init.d/alsa stop

# hibernate
echo platform > /sys/power/disk; echo disk > /sys/power/state
# doesnt make a difference for PCMCIA
#echo shutdown > /sys/power/disk; echo disk > /sys/power/state

# wait some time for wake up from suspend state before start playing sound 
to avoid jitter in playback
sleep 8
/etc/init.d/alsa start

# does not work
#/etc/init.d/pcmcia restart

# after starting playing sound again wait some 5 more seconds before 
restarting isdn configuration
# this gives 16 seconds time to re-plug the isdn card ;-)
sleep 8
/etc/init.d/isdn restart
-------------------------------------------------------------------------

Regards,
-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de