Laptop issues with OSS
======================

Unknown laptop chipsets
-----------------------

Many laptops use ISA chips which are not automatically detected by OSS (PCI
chips will always get detected correctly in case they are supported by OSS).

There are two common (ISA) sound chips used in notebooks:

1) Crystal CS423x which should work with the "Generic Crystal CS4237 based
oundcard or motherboard (non PnP)" driver in OSS (the last digit of the
chip type doesn't matter). You may need to modify the configuration to
match the BIOS settinsg using the "Manual configuration" function of the
soundconf program.

2) Yamaha OPL3-SAx which works with the "Generic Yamaha OPL3-SAx (YMF715/YMF719) non-PnP"
driver in OSS.

PCMCIA soundcards
-----------------

There are just very few PCMCIA based soundcards available and they are probably
out of production yet. We don't have any plans to support PCMCIA soundcards in OSS.

Special problems with notebooks
-------------------------------

Practically all sound chips used in notebooks are currently supported
by OSS. Unfortunately many notebooks use proprietary volume control
chips in addition to the ordinary mixer chip supported by OSS. For
this reason it's possible that no sound comes out while the sound
chip appears to be working properly.

There are few possible workarounds and you could check if any of them
work in your case:
- If there are keyboard combinations for controlling volume or muting
sound you should try to use them first. For example in HP omnibook 2100
the [Fn]+[F7] combination mutes/unmutes the sound.
- Try taking sound from the line out or headphone connector instead of using
the internal speaker. In some notebooks they work better.
- Initialize the volume control chip by booting Windows before booting
Linux.

Special Instructions for IBM, Sony and Fujitsu based laptops
------------------------------------------------------------
- On the Fujitsu FMV-640 models with the Intel 810 ICH chips,
you need to set PnP OS to NO. Press F2 and under Advanced Settings,
set PnP OS: NO

- On Sony VAIO laptops with YMF744 chips, set PnP OS to NO. Press F2 and
under Avanced Settings, set PnP OS: NO

- On IBM Laptops with the Crystal CS428x/CS46xx chips, you need to
disable APM. See the README.CS4280 document.

- On other laptops you may need to disable APM support if OSS doesn't work.
or the mixers don't install.

Suspend/Resume on Laptops
--------------------------

OSS doesn't support Automatic Suspend and Resume with APM events.
The latest Redhat 7.0 distribution has support for OSS in the suspend/resume
scripts. You can use the scripts below if you aren't using Redhat 7.0.

Suspend/Resume scripts for Linux
Courtesy Mr. Philip Zeyliger

Install the apmd-3.0final-3 RPM from the RawHide RH distro:

Name : apmd Relocations: (not relocateable)
Version : 3.0final Vendor: Red Hat, Inc.
Release : 3 Build Date: Mon 08 May 2000 06:37:52 AM PDT
Install date: Mon 22 May 2000 08:24:03 AM PDT Build Host: porky.devel.redhat.com
Group : System Environment/Daemons Source RPM: apmd-3.0final-3.src.rpm
Size : 87371 License: GPL
Packager : Red Hat, Inc.
Summary : Advanced Power Management (APM) BIOS utilities for laptops.


Then create a new script, /etc/sysconfig/apm-scripts/apmcontinue :
-----
#!/bin/bash
# Took parts of RH's apmscript to adapt to 4Front's OSS drivers
# Mon May 22 09:47:11 PDT 2000 // philz@thibs.menloschool.org

case "$1" in
suspend)
echo "apmcontinue: suspending..."
;;
resume)
# then we have to find all programs that use sound, because
# we have to stop them in order to restart the
# sound-system-driver
SOUNDPROGS=""
for n in `lsof |grep /dev|grep ' 14,'|sed -e 's/ \+/|/g'|cut '-d|' -f1-3`; do
SOUNDPROG=`echo $n|cut '-d|' -f1`
SOUNDPID=`echo $n|cut '-d|' -f2`
SOUNDUSER=`echo $n|cut '-d|' -f3`
SOUNDDISPLAY=`perl -e 's/\000/\n/g;' -p /proc/$SOUNDPID/environ|grep DISPLAY=|cut -d= -f2`
SOUNDPROGS="$n|$SOUNDDISPLAY $SOUNDPROGS"
kill "$SOUNDPID"
# Change from RH script:
# ps -ax "$SOUNDPID" &>/dev/null
ps "$SOUNDPID" &>/dev/null
[ "$?" = "0" ] && kill -9 "$SOUNDPID"
logger "apmscript: Program $SOUNDPROG ($SOUNDPID) of user $SOUNDUSER on display $SOUNDDISPLAY terminated."
done
# let's restart the sound-system-driver now
/usr/local/bin/soundoff
/usr/local/bin/soundon


# at least we can restart the programs using sound on
# the right display
for n in $SOUNDPROGS; do
SOUNDPROG=`echo $n|cut '-d|' -f1`
SOUNDPID=`echo $n|cut '-d|' -f2`
SOUNDUSER=`echo $n|cut '-d|' -f3`
SOUNDDISPLAY=`echo $n|cut '-d|' -f4`
# Modified from RH original:
# su - "$SOUNDUSER" -c "source /etc/profile;[ -f ~/.bashrc ] && source ~/.bashrc;[ -f ~/.bash_profile ] && source ~/.bash_profile;export DISPLAY="$SOUNDDISPLAY";$SOUNDPROG &"
# RH's script is screwed up--if user running SOUNDPROG was using tcsh (non-sh-related), sourc'ing bash rc files doesn't help
su - "$SOUNDUSER" --shell="/bin/bash" -c "source /etc/profile; [ -f ~/.bashrc ] && source ~/.bashrc; [ -f ~/.bash_profile ] && source ~/.bash_profile; export DISPLAY="$SOUNDDISPLAY"; $SOUNDPROG &"
logger "apmscript: Program $SOUNDPROG started as user $SOUNDUSER on display $SOUNDDISPLAY."
done
;;
*)
logger "FAIL: Wrong parameter \"$PROG\" in apmscript (apmcontinue)!"
#exit 1
;;

esac