Alsa Sound Konfiguration

Dieser Artikel beschreibt die Recherche nach Informationen zum Setup einer Soundkarte mit ALSA (Advanced Linux Sound Architecture).

 

Welche Soundkarten werden gefunden?

localhost # lspci | grep -i audio
00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Trinity HDMI Audio Controller
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 01)

Mit dem ermittelten Controllernamen finden Sie den benötigten Treiber in der ALSA SoundCard Matrix.

Es müssen folgende Einstellungen im Kernel aktiv sein:

Alsa im Kernel

 

Ist Alsa im Portage aktiv? (euse ist ein Teil des Paketes app-portage/gentoolkit)

localhost # euse -E alsa
WARNING: Use flag "alsa" is already enabled globally

Das Paket media-sound / alsa-utils enthält einige Tools zur Fehlerbehebung und zum Testen des Soundsystems. Es empfiehlt sich, das Paket zu kompilieren, falls es noch nicht installiert ist.

Ist der User in der Gruppe audio?

localhost# grep audio /etc/group
audio:x:18:michi

#Falls Nein:
localhost # gpasswd -a michi audio 
Benutzer michi wird zur Gruppe audio hinzugefügt.

 

Welche Treiber sind aktiv?

00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Root Complex
Subsystem: ASUSTeK Computer Inc. Family 15h (Models 10h-1fh) Processor Root Complex
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Richland [Radeon HD 8570D]
Subsystem: ASUSTeK Computer Inc. Richland [Radeon HD 8570D]
Kernel modules: radeon
00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Trinity HDMI Audio Controller
Subsystem: ASUSTeK Computer Inc. Trinity HDMI Audio Controller
Kernel modules: snd_hda_intel
00:10.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 09)
Subsystem: ASUSTeK Computer Inc. FCH USB XHCI Controller
Kernel driver in use: xhci_hcd
Kernel modules: xhci_pci
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 40)
Subsystem: ASUSTeK Computer Inc. FCH SATA Controller [AHCI mode]
Kernel driver in use: ahci
Kernel modules: ahci
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)
Subsystem: ASUSTeK Computer Inc. FCH USB OHCI Controller
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11)
Subsystem: ASUSTeK Computer Inc. FCH USB EHCI Controller
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)
Subsystem: ASUSTeK Computer Inc. FCH USB OHCI Controller
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11)
Subsystem: ASUSTeK Computer Inc. FCH USB EHCI Controller
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 16)
Subsystem: ASUSTeK Computer Inc. FCH SMBus Controller
Kernel modules: i2c_piix4
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 01)
Subsystem: ASUSTeK Computer Inc. FCH Azalia Controller
Kernel modules: snd_hda_intel
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 11)
Subsystem: ASUSTeK Computer Inc. FCH LPC Bridge
00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] FCH PCI Bridge (rev 40)
00:15.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Hudson PCI to PCI bridge (PCIE port 0)
Kernel driver in use: pcieport
00:15.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Hudson PCI to PCI bridge (PCIE port 1)
Kernel driver in use: pcieport
00:15.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Hudson PCI to PCI bridge (PCIE port 2)
Kernel driver in use: pcieport
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 5
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8192CE PCIe Wireless Network Adapter (rev 01)
Subsystem: Realtek Semiconductor Co., Ltd. RTL8192CE PCIe Wireless Network Adapter
03:00.0 USB controller: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller
Subsystem: ASUSTeK Computer Inc. ASM1042A USB 3.0 Host Controller
Kernel driver in use: xhci_hcd
Kernel modules: xhci_pci
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 11)
Subsystem: ASUSTeK Computer Inc. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
Kernel driver in use: r8169
Kernel modules: r8169

 

Konfigurationsdateien:
/etc/asound.conf – Globale (systemweite) Konfigurationsdatei.

~ / .asoundrc – Lokale (pro Benutzer) Konfigurationsdatei. Dese Datei kann optional verwendet werden, sodass pro Benutzer ALSA-Standardwerte überschrieben werden können.

 

localhost  # less /etc/modprobe.d/alsa.conf
# Alsa kernel modules' configuration file.

# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore

##
## IMPORTANT:
## You need to customise this section for your specific sound card(s)
## and then run `update-modules' command.
## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
##
## ALSA portion
## alias snd-card-0 snd-interwave
## alias snd-card-1 snd-ens1371
## OSS/Free portion
## alias sound-slot-0 snd-card-0
## alias sound-slot-1 snd-card-1
##

# 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
## OSS/Free portion - card #2
## alias sound-service-1-0 snd-mixer-oss
## alias sound-service-1-3 snd-pcm-oss
## alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.
options snd cards_limit=2

 

 

localhost # /etc/init.d/alsasound start
* Caching service dependencies ... [ ok ]
* Restoring Mixer Levels ...
* No mixer config in /var/lib/alsa/asound.state, you have to unmute your card! [ ok ]
 localhost # rc-update add alsasound boot *
service alsasound added to runlevel boot


Eine Beispielanzeige vom Alsamixer im grafischen Modus:
   
 

 

michi@localhost ~ $ speaker-test -c 2 -D hw:0,3

speaker-test 1.1.2

Playback device is hw:0,3
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 16384
Period size range from 32 to 8192
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
1 - Front Right
Time per period = 5,739853
0 - Front Left
1 - Front Right
Time per period = 5,989964
0 - Front Left
1 - Front Right
Time per period = 5,870038
0 - Front Left
1 - Front Right
Time per period = 5,989912
0 - Front Left
1 - Front Right
Time per period = 6,020624
0 - Front Left
1 - Front Right

 

localhost # /etc/init.d/alsasound stop
* WARNING: you are stopping a boot service
* Storing ALSA Mixer Levels ...
alsactl: save_state:1595: No soundcards found...
* Error saving levels. [ !! ]

 

Wiki vom Alsa ( englisch) : https://wiki.parabola.nu/Advanced_Linux_Sound_Architecture 
Ich habe absichtlich den Link zum englischen wiki gesetzt. Das deutsche wiki ist nicht aktuell in diesem Bereich.