QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 8968|回复: 19

alsa究竟如何才能够开机自动激活?

[复制链接]
发表于 2002-7-29 15:44:02 | 显示全部楼层 |阅读模式
当初是为了QUAKE,卸载掉VIA官方驱动,装的这个
呵呵,没有VIA官方驱动的时候,还是用的这个

如何让他开机自动激活呢?
每次都要运行AUDIO MIXER,不爽
发表于 2002-7-29 16:41:08 | 显示全部楼层
做个链接到用户目录的.kde/autorun目录中。(此目录默认为隐藏,选中“显示隐藏目录”就能看到了)
回复

使用道具 举报

 楼主| 发表于 2002-7-29 17:35:29 | 显示全部楼层
我是直接加在GNOME启动里面的
不过总要自动打开GMIX设置窗口

以前好像看过一篇让ALSA自动打开服务的办法,55555555555,可惜找不到了,咋办?
回复

使用道具 举报

发表于 2002-7-29 17:59:54 | 显示全部楼层
打开服务 是什么意思?
你试试setup一下,看里面的系统服务有没有alsasound这个选项,有的话将它选上看有没有作用?
回复

使用道具 举报

 楼主| 发表于 2002-7-29 18:41:59 | 显示全部楼层
就是LINUX起来后,自动激活声卡啊
默认是静音嘛

没有ALSASOUND,想找来着,可惜,可惜不知道怎么才能让ALSA做到这个服务里
回复

使用道具 举报

发表于 2002-7-30 22:30:46 | 显示全部楼层
我的启动能自动激活声卡alsa 0.5.12a  RH7.3
但每次启动wave都是静音 (只有wave是这样)
请问怎样才能 保存wave音量设定?
回复

使用道具 举报

发表于 2002-7-30 22:36:16 | 显示全部楼层
能不能这样:
运行kmix,调好音量后选“音量”-“保存为默认”

试试看
先声明,我的是核心驱动,没用过alsa驱动
回复

使用道具 举报

发表于 2002-7-30 23:00:58 | 显示全部楼层
[quote:f20da369de="llc"]能不能这样:
运行kmix,调好音量后选“音量”-“保存为默认”

试试看
先声明,我的是核心驱动,没用过alsa驱动[/quote]

不行啊 kmix里连wave调节都没有
不过alsa驱动真的很不错 音质比核心驱动和oss都要好(在我的ymh声卡上)
回复

使用道具 举报

发表于 2002-7-31 09:12:32 | 显示全部楼层
我试了一下,在我的红旗3.0上,可以用内核驱动,也可以用alsa驱动,用alsa驱动时,ntsysv里有个叫alsasound服务的选项可以钩上,这样每次启动后如果运行kmix,就会发现多了一个叫mixer00的标签(原来用内核驱动时只有一个STAC9708的标签)可以选择,而原来的STAC9708的标签变成了空白。在mixer00的标签上选好音量后保存为默认,下次开机也就ok了

(在红旗上,无论怎么是用内核驱动还是alsa驱动,无法playmidi,我的声卡是SBPCI28D)

我将我的alsasound脚本贴上来,大家试试有没有用:(新建一个叫alsasound的文本,将下面的内容复制粘贴进去,保存,然后将这个alsasound文件拷贝进/etc/init.d目录下,同时用命令chmod +x alsasound给它添加可执行属性,用右键添加可执行属性也可以;然后运行ntsysv,应该就可以见到有alsasound的选项,试试将它选上,重起一下再进系统看kmix有没有其他标签出来)


#!/bin/bash
#
# alsasound     This shell script takes care of starting and stopping
#               the ALSA sound driver.
#
# This script requires /usr/sbin/alsactl and /usr/bin/aconnect programs
# from the alsa-utils package.
#
# Copyright (c) by Jaroslav Kysela <[email protected]>
#
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
# For RedHat 5.0+:
# chkconfig: 2345 87 14
# description: ALSA driver
#
# modified to visually fit into SuSE 6.0+ by Philipp Thomas <[email protected]>
# further improvements by Bernd Kaindl, Olaf Hering and Takashi Iwai.
#
### BEGIN INIT INFO
# Provides:       alsasound
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start:  2 3 5
# Default-Stop:
# Description:    Loading ALSA drivers and store/restore the current setting
### END INIT INFO

if [ -r /etc/rc.config ]; then
  . /etc/rc.config
  rc_warning="\033[m33m\033[1m"
else
  rc_done="done"
  rc_warning=""
  rc_reset=""
fi

if [ x$START_ALSA != xno ]; then
  START_ALSA=yes
fi
if [ x$START_ALSA_SEQ != xno ]; then
  START_ALSA_SEQ=yes
fi

# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}

# Force execution if not called by a runlevel directory.
test $link = $base && START_ALSA=yes
test "$START_ALSA" = yes || exit 0

alsactl=/usr/sbin/alsactl
asoundcfg=/etc/asound.state
aconnect=/usr/bin/aconnect
alsascrdir=/etc/alsa.d

function start() {
  #
  # insert all sound modules
  #

  drivers=`/sbin/modprobe -c | \
    grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | \
    awk '{print $3}'`
  for i in $drivers; do
      echo -n "Starting sound driver: $i "
      /sbin/modprobe $i
      echo -e "$rc_done"
    done
  #
  # insert sequencer modules
  #
  if [ x"$START_ALSA_SEQ" = xyes -a -r /proc/asound/seq/drivers ]; then
    t=`cut -d , -f 1 /proc/asound/seq/drivers`
    if [ "x$t" != "x" ]; then
      /sbin/modprobe $t
    fi
  fi
  #
  # restore driver settings
  #
  if [ -d /proc/asound ]; then
    if [ ! -r $asoundcfg ]; then
      echo "No mixer config in $asoundcfg, you have to unmute your card!"
    else
      if [ -x $alsactl ]; then
        $alsactl -f $asoundcfg restore
      else
        echo -e "${rc_warning}ERROR: alsactl not found${rc_reset}"
      fi
    fi
  fi
  #
  # run card-dependent scripts
  for i in $drivers; do
    t=`echo $i | sed -e 's/snd-card-\(.*\)/\1/'`
    if [ -x $alsascrdir/$t ]; then
      $alsascrdir/$t
    fi
  done
}

function terminate() {
  #
  # Kill processes holding open sound devices
  #
  # DEVS=`find /dev/ -follow -type c -maxdepth 1 -print 2>/dev/null | xargs ls -dils | grep "1*1[46]," | cut -d: -f2 | cut -d" " -f2; echo /proc/asound/dev/*`
  ossdevs="/dev/admmidi? /dev/adsp? /dev/amidi? /dev/audio* /dev/dmfm* \
     /dev/dmmidi? /dev/dsp* /dev/dspW* /dev/midi0? /dev/mixer? /dev/music \
     /dev/patmgr? /dev/sequencer* /dev/sndstat"
  alsadevs="/proc/asound/dev/*"
  fuser -k $ossdevs $alsadevs 2> /dev/null 1>/dev/null
  #
  # remove all sequencer connections if any
  #
  if [ -f /proc/asound/seq/clients -a -x $aconnect ]; then
    $aconnect --removeall
  fi
}

function stop() {
  #
  # store driver settings
  #
  if [ -x $alsactl ]; then
    $alsactl -f $asoundcfg store
  else
    echo -n -e "${rc_warning}!!!alsactl not found!!!${rc_reset} "
  fi
  #
  # remove all sound modules
  #
  /sbin/lsmod | grep -E "^snd" | grep -v "snd-rme9652_mem" | while read line; do \
     /sbin/rmmod `echo $line | cut -d ' ' -f 1`; \
  done
  # remove the 2.2 soundcore module (if possible)
  /sbin/rmmod soundcore 2> /dev/null
}

# See how we were called.
case "$1" in
  start)
        # Start driver if it isn't already up.
        if [ ! -d /proc/asound ]; then
          start
        else
          echo "ALSA driver is already running."
        fi
        ;;
  stop)
        # Stop daemons.
        if [ -d /proc/asound ]; then
          echo -n "Shutting down sound driver: "
          terminate
          stop
          echo -e "$rc_done"
        fi
        ;;
  restart|reload)
        $0 stop
        $0 start
        ;;
  status)
        if [ -d /proc/asound ]; then
          echo -n "ALSA sound driver loaded."
        else
          echo -n "ALSA sound driver not loaded."
        fi
        echo
        ;;
  *)
        echo "Usage: alsasound {start|stop|restart|status}"
        exit 1
esac

exit 0
回复

使用道具 举报

 楼主| 发表于 2002-8-3 03:43:11 | 显示全部楼层
仔细研究了一番
其实alsa在redhat /etc/init.d里面也生成了alsasound这个命令
不过ntsysv里面并不显示
做个链接到/etc/rc.d/rc5.d 改名S70alsasound (S70为运行顺序)
运行ntsysv,哈哈哈哈哈,alsasound有了
重起,自动start,ok!
回复

使用道具 举报

发表于 2003-6-13 09:59:07 | 显示全部楼层
[quote:3a0742e127="sd444"]仔细研究了一番
其实alsa在redhat /etc/init.d里面也生成了alsasound这个命令
不过ntsysv里面并不显示
做个链接到/etc/rc.d/rc5.d 改名S70alsasound (S70为运行顺序)
运行ntsysv,哈哈哈哈哈,alsasound有了
重起,自动start,ok![/quote]

我已经在/etc/rc.d/rc5.d下ln -s /etc/init.d/alsasound s70alsasound,
可在ntsysv里就是没有alsasound,怎么办呢?
改成s87什么的,也不行啊
回复

使用道具 举报

发表于 2003-6-13 10:31:14 | 显示全部楼层
[quote:f2817c3e3c="Linux盲"]做个链接到用户目录的.kde/autorun目录中。(此目录默认为隐藏,选中“显示隐藏目录”就能看到了)[/quote]
请问,这个链接该怎么做呢?
我在.kde/autorun下ln -s /etc/init.d/alsasound alsasound
结果系统启动的时候显示找不到alsasound
回复

使用道具 举报

发表于 2003-6-13 14:24:47 | 显示全部楼层
根本不用那么麻烦。
安装alsa后,
执行:chkconfig --add alsasound
就万事ok了。
至于音量,推荐用alsactl+gamix解决。
www.linuxsir.com有详细教程。
回复

使用道具 举报

发表于 2003-7-29 22:20:18 | 显示全部楼层
我是这样的!
........

.......(省略编译的步骤)
插入模块:
modprobe snd-via82xx
modprobe snd-pcm-oss
modprobe snd-mixer-oss
modprobe snd-seq-oss

赶快打开你得音量控制看看是不是可以调节音量了?如果不可以得话,不好意思,在装吧!

在检测一下声卡吧:点击声卡检测 出现得界面上面有个“播放测试声音”点击看看,这时应该可以听到3声测试得声音是不是非常激动?呵呵,久违得声音终于出来了 ^O^
将以下几句加如/etc/modules.conf中
# gedit

ps: 以上得井号是root得提示符,自己不用键入,但是下面得井号得键入了!~

打开/etc/modules.conf

#This is ordinal lines - between #-->
#-->
alias char-major-116 snd
alias snd-card-0 snd-via82xx
# module options should go here
# OSS/Free portion
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
# card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
#-->
# and this lines are from modules.conf in distr. of RH 8.0
post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null 2>&1 || :
pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null 2>&1 || :

好了,保存吧!~ 重启,尽情得聆听来自自由世界得声音吧~
回复

使用道具 举报

发表于 2003-7-29 23:35:45 | 显示全部楼层
置顶!!!!!!!!!!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-5-13 07:52 , Processed in 0.145773 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表