Gentoo安装详解(四)-- 配置声卡

配置声卡

ALSA - Gentoo Wiki

To choose the right driver, first detect the used audio controller. Use lspci for this task:

lspci | grep -i audio

内核配置

You need to activate the following kernel options:

Device Drivers --->
    <*> Sound card support
        <*> Advanced Linux Sound Architecture --->
            [*] PCI sound devices  --->
                Select the driver for your audio controller.
                HD-Audio  --->
                   Select a codec or enable all and let the generic parse choose the right one:
                   [*] Build Realtek HD-audio codec support
                   [*] ...
                   [*] Build Silicon Labs 3054 HD-modem codec support
                   [*] Enable generic HD-audio codec parser
            [*] USB sound devices  --->
                Must have as some cards are presented as USB devices.
                [*] USB Audio/MIDI driver
General setup --->
    [*] System V IPC

The lsmod command can be helpful.

If the system has more than 8 sound outputs (Each HDMI output on a GPU will count as one), the max number of sound cards will need to be increased:

KERNEL

Device Drivers --->
    <*> Sound card support
        <*> Advanced Linux Sound Architecture --->
            [*] Dynamic device file minor numbers
            (32) Max number of sound cards

软件

The media-sound/alsa-utils package provides some tools for troubleshooting and testing the sound system. It is a good idea to merge the package if it is not already installed:

emerge --ask alsa-utils

配置

权限

If the acl USE flag enabled globally and a login daemon (e.g. systemd-logind or elogind) is being used (i.e the system is using a desktop profile) permissions to sound cards will be handled automatically. Permissions can be checked using getfacl:

getfacl /dev/snd/controlC0 | grep larry
user:larry:rw-

Add the user you want to be able to access the sound card to the audio group:

gpasswd -a larry audio

服务

You can now start ALSA:

/etc/init.d/alsasound start

To start ALSA at boot time, add it your boot runlevel:

rc-update add alsasound boot

Mixer 调节音量,取消静音

If you can't hear anything, the output channels may be muted. Unmute the channels with the desktop environment's mixer or with alsamixer by selecting the appropriate channels and pressing the M key to mute or unmute:

alsamixer

测试声音

If everything above is perfect, you should now be able to test your sound card and your speakers. We will use the speaker-test command line tool from package media-sound/alsa-utils (this should already be installed as per our previous recommendation).

speaker-test -t wav -c 2
posted @   孤逐王  阅读(1142)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示