HOWTO nForce2 hw mixing

来源:互联网 发布:unity3d click判断 编辑:程序博客网 时间:2024/06/10 08:42

Contents

[hide]
  • 1 Introduction
    • 1.1 Comment:
  • 2 Preparing Kernel 2.6
  • 3 Inserting nvsound module
  • 4 System configuration
  • 5 ALSA/OSS mixers
  • 6 Known problems
    • 6.1 This guide is all wrong

[edit]

Introduction

This HOWTO is based on the following thread from Gentoo Forums, started by -=GGW=- $ol!d $n4>|e. This article is devoted to all people with nvidia's SoundStorm integrated on motherboard and willing to obtain hardware sound mixing with ALSA.

[edit]

Comment:

This HOWTO is not correct. The nvidia kernel module is for the Open Sound System and not alsa related. So skip the parts where alsa gets configured. Read at the bottom of this page what needs to be done or check the Release notes.

[edit]

Preparing Kernel 2.6

First we have to change directory to /usr/src/linux and make menuconfig in order to configure our kernel

# cd /usr/src/linux# make menuconfig 

You need to have these things checked as built in, not modular.

Linux Kernel Configuration: Kernel Configuration
Device Drivers --->   Sound --->      <*> Sound card support      Advanced Linux Sound Architecture --->         <*> Advanced Linux Sound Architecture         <*> Sequencer support         <*> OSS Mixer API         <*> OSS PCM (digital audio) API         PCI devices --->            <*> Intel/SiS/nVidia/AMD/ALi AC97 Controller      Open Sound System --->         <*> Open Sound System (DEPRECATED)         <*> VIA 82C686 Audio Codec


Assuming there have been changes in your kernel's configuration you will have to recompile it and install, otherwise you can pass to the next paragraph

# make && make modules_install# cp arch/i386/boot/bzImage /boot/kernel-2.6# cp System.map /boot/System.map-2.6# cp .config /boot/config-2.6 

After that you need to reload your kernel which simply means rebooting

# reboot
[edit]

Inserting nvsound module

Now you need to get nForce2 precompiled drivers provided by nvidia. You can download it form http://www.nvidia.com/object/unix.html and install manually yet as we are using Gentoo Linux, the most convenient way is to use Portage :D

# emerge nforce-audio

Next you will be most probably able to load your newly created module nvsound . Let's pray and let's test it

# modprobe nvsound# modules-update

If no ugly message appears the module works :) To remove module just type:

# rmmod nvsound
Note: After each more serious recompilation of your kernel you will also have to reemerge (reinstall) nvsound module.
[edit]

System configuration

Configure /etc/modules.d/alsa

File: /etc/modules.d/alsa
   # ALSA portion  alias char-major-116 snd  alias snd-card-0 snd-intel8x0  # OSS/Free portion  alias char-major-14 soundcore  alias sound-slot-0 snd-card-0 snd-intel8x0    # OSS/Free portion - 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    alias /dev/mixer snd-mixer-oss  alias /dev/dsp snd-pcm-oss  alias /dev/midi snd-seq-oss    options snd cards_limit=1  

To be safe, check to make sure /etc/devfsd.conf is set up properly

File: /etc/devfsd.conf
# ALSA/OSS stuff# Comment/change these if you want to change the permissions on# the audio devicesLOOKUP snd MODLOAD ACTION sndLOOKUP dsp MODLOADLOOKUP mixer MODLOADLOOKUP midi MODLOADREGISTER sound/.* PERMISSIONS root.audio 660REGISTER snd/.* PERMISSIONS root.audio 660

in order to have nvsound loaded at boot add nvsound into your /etc/modules.autoload.d/kernel-2.6

echo "nvsound" >> /etc/modules.autoload.d/kernel-2.6
Note: Since nvsound takes care of hw mixing there is no need to set up a /.asoundrc config file for dmixing. Infact, setting one up will break the built in hwmixing and cause conflicts with some programs.
[edit]

ALSA/OSS mixers

In order to be able to save and restore your alsa mixer level you have to:

# emerge alsa-utils# emerge alsa-oss

Now since the original /etc/init.d/alsasound will attempt to load modules that are all ready taken car of nvidia and will spit out long annoying ugly looking warning and erros at you when you boot up, we use a modified version of the script.

File: /etc/init.d/alsasound
#!/sbin/runscript# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsasound,v 1.23 2005/04/21 09:07:45 eradicator Exp $alsactl=/usr/sbin/alsactlasoundcfg=/etc/asound.stateopts="${opts} save"depend() {need bootmisc localmountafter modules isapnp coldplug hotplug}restore_mixer() {ebegin "Restoring Mixer Levels"local val=0if [[ ! -r ${asoundcfg} ]] ; thenewarn "No mixer config in ${asoundcfg}, you have to unmute your card!"elif [[ -x ${alsactl} ]] ; thenlocal CARDS="$(cat /proc/asound/cards | awk '/: / { print $1 }')"local CARDNUMfor CARDNUM in ${CARDS}do[[ -e /dev/snd/controlC0 ]] || sleep 2[[ -e /dev/snd/controlC0 ]] || sleep 2[[ -e /dev/snd/controlC0 ]] || sleep 2[[ -e /dev/snd/controlC0 ]] || sleep 2${alsactl} -f ${asoundcfg} restore ${CARDNUM}((val=val+$?))doneelseeerror -e "ERROR: Cannot find alsactl, did you forget to install media-sound/alsa-utils?"val=1fieend ${val}return ${val}}save() {ebegin "Storing ALSA Mixer Levels"local val=0if [[ -x ${alsactl} ]] ; then${alsactl} -f ${asoundcfg} storeval=$?elseeerror -e "ERROR: Cannot find alsactl."val=1fieend ${val}return ${val}}start() {restore_mixer}stop() {save}

Use your favorite text editor to make that and save it as root in /etc/init.d/ as alsarestore (or whatever you want it to be called). For the purpose of this guide I will assume you named it alsarestore.

In order to make the boot script executable, as root do

# chmod +x /etc/init.d/alsarestore

Now we add the script to the boot run level

# rc-update add alsarestore boot

Next you have to unmute your channels.

# amixer set Master 100% unmute# amixer set PCM 100% unmute

Activate the script so that it will store the sound state

# /etc/init.d/alsarestore start

Just to be safe

# alsactl store
[edit]

Known problems

  • Hardware mixing works only with ALSA, OSS using programs will block sound device.
  • Although this may seem not related to sound, people with nForce2 motherboards in order to get USB keyboard/mouse properly working should check in kernel configuration OHCI HCD Support instead of UHCI HCD (most Intel and VIA) support
  • As well as that if you use nForce2 LAN Controler you should check Reverse Engineered nForce Ethernet support (EXPERIMENTAL)


[edit]

This guide is all wrong

The new nvsound module is OSS only and supports hardware-mixing. You don't need any of the alsa stuff in the kernel. You just need to enable "Open Sound System" in the linux-kernel. Then emerge nforce-audio and load the nvsound module. Use nvmixer to set up your speaker options. To store the settings and get them loaded after a reboot, add the following to "/etc/conf.d/local.start"

/usr/bin/nvmix-reg -f /etc/nvmixrc -L >/dev/null 1>&2

You don't need to start alsa at boot. (do 'rc-update del alsasound')

Retrieved from "http://gentoo-wiki.com/HOWTO_nForce2_hw_mixing"
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 飞机无人陪护如果接机延误该怎么办 过年要坐火车回家 狗狗怎么办 一岁八个月宝宝小腿弯怎么办 2岁宝不愿意坐马桶拉屎怎么办 宝宝两岁多肺炎出院还老咳嗽怎么办 去外国机场买机票不会说外语怎么办 坐飞机不能带的物品办理托运怎么办 深圳外地户口儿童要办身份证怎么办 网上订票错写了护照号怎么办 国航 在智能火车票订飞机票订反了怎么办 办社保卡的时候填错地址怎么办 两个人住酒店只有一张身份证怎么办 农村社保卡信息错了说改不了怎么办 社保卡与原医保卡信息错误怎么办 学校发的社保卡丢了怎么办 魔棒工具选中选区后再怎么办 微信每次打开都出现月球图案怎么办 仙人掌的刺扎手里弄不出来怎么办 保险交满15年领了一年死了怎么办 狗咬了出了点血怎么办 被小狗咬到了吃了海鲜怎么办 想给一个人道歉又不敢说怎么办 被尘封的故事中魔法师不见了怎么办 宝骏5602挡升3挡有点卡怎么办 剥开的榴莲没熟壳又扔了怎么办 视频播放器激活码设备超限了怎么办 ai如何把右边菜单栏隐藏了怎么办 矫正牙齿粘牙齿的胶掉了怎么办 3m双面胶生产的时候胶不干怎么办 新房赠送面积没地热想接地热怎么办 教育网注册报名的用户名忘了怎么办 艺术生校考通过文化没过本线怎么办 想做主持人 但不是播音专业怎么办 微信登录版本最低登录不上怎么办 所录微课的视频声音小是怎么办 电脑开机黑屏只有光标在闪怎么办 联想家悦重装系统时驱动缺失怎么办 ps做到一半电脑重启了怎么办 宝宝起风疹怎么办 要注意的问题 惠普笔记本刚换的显卡又坏了怎么办 电脑装驱动时不注意点了跳过怎么办