LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: startX

古怪的/dev/dsp 问题 (无法建立dsp) ---alsa问题解决,更新做结尾----

[复制链接]
 楼主| 发表于 2005-1-3 19:00:25 | 显示全部楼层
/dev/dsp 的问题 在删除那些  udev、hotplug、discover1   已经好了  没有问题
用 VLC  可以   播放已经没问题(以前vlc 是不能用的  因为dsp )

现在我的 VM 还是没声音  问题应该是在  vmTOOLs 那里了
继续  研究
dev/dsp  告一段落

非常感谢  楼上各位的 回帖        :thank
发表于 2007-10-5 04:29:16 | 显示全部楼层
Post by windrose
应该是udev的问题。
我在slackware里面安装alsa的时候,起初也遇到类似的问题,后来发现slackware自带的启动脚本能解决。
脚本内容如下:

  1. #!/bin/sh
  2. # Load the mixer settings and OSS compatibility for ALSA.
  3. # (the Advanced Linux Sound Architecture)

  4. # A function to load the ALSA mixer settings:
  5. load_alsa_mixer() {
  6.   if [ -r /etc/asound.state ]; then
  7.     echo "Loading ALSA mixer settings:  /usr/sbin/alsactl restore"
  8.     /usr/sbin/alsactl restore
  9.   else
  10.     echo "ALSA warning:  No mixer settings found in /etc/asound.state."
  11.     echo "  Sound may be muted.  Use 'alsamixer' to unmute your sound card,"
  12.     echo "  and then 'alsactl store' to save the default ALSA mixer settings"
  13.     echo "  to be loaded at boot."
  14.   fi
  15. }

  16. # A function to load the ALSA OSS compat modules:
  17. load_alsa_oss_modules() {
  18.   if ! cat /proc/modules | grep -w snd-pcm-oss 1> /dev/null 2> /dev/null ; then
  19.     echo "Loading OSS compatibility modules for ALSA."
  20.     modprobe snd-pcm-oss
  21.     modprobe snd-mixer-oss
  22.   fi
  23. }

  24. # If hotplug or something else has loaded the ALSA modules, then
  25. # simply load the mixer settings and make sure the OSS compat
  26. # modules are loaded:
  27. if [ -d /proc/asound ]; then
  28.   load_alsa_mixer
  29.   load_alsa_oss_modules
  30. else
  31.   # If there are ALSA modules defined in /etc/modules.conf, but
  32.   # ALSA is not yet loaded, then load the modules now:
  33.   DRIVERS=`modprobe -c | grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | awk '{ print $3 }'`
  34.   if [ ! "$DRIVERS" = "" ]; then
  35.     echo "Loading ALSA kernel modules."
  36.     for module in $DRIVERS; do
  37.       modprobe $module
  38.     done
  39.   fi
  40.   # If ALSA is now up, then load the mixer settings and OSS modules:
  41.   if [ -d /proc/asound ]; then
  42.     load_alsa_mixer
  43.     load_alsa_oss_modules
  44.   fi
  45. fi
复制代码


这个脚本果然有效!
刚才 sh 执行了一下此脚本,立即就出现了 /dev/dsp 。我就感觉奇怪呢?内核中应该先的 都选了, OSS 的一个没漏。以前 2.6.20.1 内核一直可以,现在 2.6.22.x 一直不能发现 /dev/dsp 。其实内核中都支持了,是新版 udev 的问题。
回复 支持 反对

使用道具 举报

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

本版积分规则

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