#!/bin/sh # if [ "$1" = "prereqs" ]; then exit 0 fi quiet=n . /scripts/functions . /conf/tcos.conf . /conf/tcos-run-functions . /bin/set-limits # if break=initsound STOP here maybe_break initsound TCOS_DISABLE_SOUND=$(read_cmdline_var "nosound" "0") if [ "${TCOS_SOUND}" = "0" -o "${TCOS_DISABLE_SOUND}" = "1" ]; then log_begin_msg "Sound disabled" log_end_msg 1 exit 0 fi # check if soundcard is avalaible if [ ! -d /proc/asound ] && [ ! -e /dev/dsp ] ; then _log "INITSOUND /proc/asound and /dev/dsp don't exists, need other kernel modules!!!" log_failure_msg "No soundcard found" log_end_msg 1 exit 0 fi # DOCUMENTME volume=XX% | set master and pcm volume levels to value passed (0%-100% or integer from 1 to 31) TCOS_VOLUME=$(read_cmdline_var "volume" "${TCOS_VOLUME}") if [ -e /dev/dsp ] && [ ! -d /proc/asound ]; then export TCOS_SOUND_OSS=1 echo "TCOS_SOUND_OSS=1" >> /conf/tcos.conf log_begin_msg "OSS detected, try to search another sound device with ALSA support" log_end_msg 1 exit 0 fi if [ -n "$TCOS_PULSEAUDIO" ]; then log_begin_msg "Init sound server (PulseAudio)" _log "INITSOUND starting pulseaudio" startpulseaudio 2> /var/log/pulseaudio.log & log_end_msg $? fi TCOS_VOLUME_MIC=75 # setting volumes, set after sound server initialization log_begin_msg "Setting audio levels to ${TCOS_VOLUME}%" _log "INITSOUND Setting volume to ${TCOS_VOLUME}" tmixer -c 0 sset 'Front' ${TCOS_VOLUME} >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Front' on >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'PCM' ${TCOS_VOLUME} >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'PCM' on >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Master' ${TCOS_VOLUME} >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Master' on >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Master Mono' ${TCOS_VOLUME} >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Master Mono' on >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Master Front' ${TCOS_VOLUME} >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Master Front' on >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Master Digital' ${TCOS_VOLUME} >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Master Digital' on >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Mic' ${TCOS_VOLUME_MIC} >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Front Mic' ${TCOS_VOLUME_MIC} >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Rear Mic' ${TCOS_VOLUME_MIC} >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Mic' off >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Front Mic' off >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Rear Mic' off >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Mic Boost (+20dB)' off >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Mic Boost' off >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Rear Mic Boost' off >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Front Mic Boost' off >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Mic Boost (+20dB)' 0% >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Mic Boost' 0% >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Rear Mic Boost' 0% >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Front Mic Boost' 0% >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Headphone' ${TCOS_VOLUME} >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Headphone' on >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Speaker' on >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Capture' cap >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Capture,0' cap >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Capture,1' cap >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Capture,2' cap >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Capture,3' cap >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Capture' 90% >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Capture,0' 90% >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Capture,1' 90% >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Capture,2' 90% >> /tmp/initramfs.debug 2>&1 tmixer -c 0 sset 'Capture,3' 90% >> /tmp/initramfs.debug 2>&1 log_end_msg 0 update_progress exit 0