Audio

LFS 沒有聲音

  • December 2, 2020

我正在嘗試安裝 BLFS 8.4 我已經成功安裝了 alsa-lib 和 alsa-utilities,alsa-mixer 也可以正常工作。我的音效卡是“HDA Intel”。 speaker-test也可以,但會產生不希望的輸出:

speaker-test 1.1.8

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 2048 to 8192
Period size range from 1024 to 1024
Using max buffer size 8192
Periods = 4
was set period_size = 1024
was set buffer_size = 8192
0 - Front Left
Time per period = 2.823178
0 - Front Left
Time per period = 2.986632
0 - Front Left
Time per period = 2.986640
0 - Front Left
Time per period = 2.986624
0 - Front Left
Time per period = 2.986635
0 - Front Left
Time per period = 2.986632
0 - Front Left
Time per period = 2.986626
0 - Front Left
Time per period = 2.986631
0 - Front Left
Time per period = 2.986632
0 - Front Left
Time per period = 2.986633
0 - Front Left
Time per period = 2.986628
0 - Front Left
^[[5~Time per period = 2.986638
0 - Front Left
Time per period = 2.986628
0 - Front Left
Time per period = 2.986633
0 - Front Left
^CWrite error: -4,Interrupted system call
xrun_recovery failed: -4,Interrupted system call
Transfer failed: Interrupted system call
aplay -v /dev/urandom
Playing raw data '/dev/urandom' : Unsigned 8 bit, Rate 8000 Hz, Mono
Plug PCM: Rate conversion PCM (48000, sformat=U8)
Converter: libspeex (external)
Protocol version: 10002
Its setup is:
 stream       : PLAYBACK
 access       : RW_INTERLEAVED
 format       : U8
 subformat    : STD
 channels     : 1
 rate         : 8000
 exact rate   : 8000 (8000/1)
 msbits       : 8
 buffer_size  : 1365
 period_size  : 170
 period_time  : 21333
 tstamp_mode  : NONE
 tstamp_type  : MONOTONIC
 period_step  : 1
 avail_min    : 170
 period_event : 0
 start_threshold  : 1365
 stop_threshold   : 1365
 silence_threshold: 0
 silence_size : 0
 boundary     : 768426686420090880
Slave: Route conversion PCM (sformat=S32_LE)
 Transformation table:
   0 <- 0
   1 <- 0
Its setup is:
 stream       : PLAYBACK
 access       : MMAP_INTERLEAVED
 format       : U8
 subformat    : STD
 channels     : 1
 rate         : 48000
 exact rate   : 48000 (48000/1)
 msbits       : 8
 buffer_size  : 8192
 period_size  : 1024
 period_time  : 21333
 tstamp_mode  : NONE
 tstamp_type  : MONOTONIC
 period_step  : 1
 avail_min    : 1024
 period_event : 0
 start_threshold  : 8192
 stop_threshold   : 8192
 silence_threshold: 0
 silence_size : 0
 boundary     : 4611686018427387904
Slave: Soft volume PCM
Control: PCM Playback Volume
min_dB: -51
max_dB: 0
resolution: 256
Its setup is:
 stream       : PLAYBACK
 access       : MMAP_INTERLEAVED
 format       : S32_LE
 subformat    : STD
 channels     : 2
 rate         : 48000
 exact rate   : 48000 (48000/1)
 msbits       : 32
 buffer_size  : 8192
 period_size  : 1024
 period_time  : 21333
 tstamp_mode  : NONE
 tstamp_type  : MONOTONIC
 period_step  : 1
 avail_min    : 1024
 period_event : 0
 start_threshold  : 8192
 stop_threshold   : 8192
 silence_threshold: 0
 silence_size : 0
 boundary     : 4611686018427387904
Slave: Direct Stream Mixing PCM
Its setup is:
 stream       : PLAYBACK
 access       : MMAP_INTERLEAVED
 format       : S32_LE
 subformat    : STD
 channels     : 2
 rate         : 48000
 exact rate   : 48000 (48000/1)
 msbits       : 32
 buffer_size  : 8192
 period_size  : 1024
 period_time  : 21333
 tstamp_mode  : NONE
 tstamp_type  : MONOTONIC
 period_step  : 1
 avail_min    : 1024
 period_event : 0
 start_threshold  : 8192
 stop_threshold   : 8192
 silence_threshold: 0
 silence_size : 0
 boundary     : 4611686018427387904
Hardware PCM card 0 'HDA Intel' device 0 subdevice 0
Its setup is:
 stream       : PLAYBACK
 access       : MMAP_INTERLEAVED
 format       : S32_LE
 subformat    : STD
 channels     : 2
 rate         : 48000
 exact rate   : 48000 (48000/1)
 msbits       : 32
 buffer_size  : 8192
 period_size  : 1024
 period_time  : 21333
 tstamp_mode  : ENABLE
 tstamp_type  : MONOTONIC
 period_step  : 1
 avail_min    : 1024
 period_event : 0
 start_threshold  : 1
 stop_threshold   : 4611686018427387904
 silence_threshold: 0
 silence_size : 4611686018427387904
 boundary     : 4611686018427387904
 appl_ptr     : 0
 hw_ptr       : 2049^CAborted by signal Interrupt...
 aplay: pcm_write:2053: write error: Interrupted system call
paplay -v --raw /dev/urandom
Opening a playback stream with sample specification 's16le 2ch 44100Hz' and channel map 'front-left,front-right'.
Connection established.
Stream successfully created.
Buffer metrics: maxlength=4194304, tlength=352800, prebuf=349276, minreq=3528
Using sample spec 's16le 2ch 44100Hz', channel map 'front-left,front-right'.
Connected to device alsa_output.pci-0000_00_1b.0.analog-stereo (index: 0, suspended: no).
Stream started.
^CGot signal, exiting.ncy: 2260381 usec.
amixer
Simple mixer control 'Master',0
 Capabilities: pvolume pvolume-joined pswitch pswitch-joined
 Playback channels: Mono
 Limits: Playback 0 - 127
 Mono: Playback 127 [100%] [0.00dB] [on]
Simple mixer control 'Headphone',0
 Capabilities: pvolume pswitch
 Playback channels: Front Left - Front Right
 Limits: Playback 0 - 127
 Mono:
 Front Left: Playback 104 [82%] [-17.25dB] [off]
 Front Right: Playback 104 [82%] [-17.25dB] [off]
Simple mixer control 'Speaker',0
 Capabilities: pvolume pswitch
 Playback channels: Front Left - Front Right
 Limits: Playback 0 - 127
 Mono:
 Front Left: Playback 127 [100%] [0.00dB] [on]
 Front Right: Playback 127 [100%] [0.00dB] [on]
Simple mixer control 'PCM',0
 Capabilities: pvolume
 Playback channels: Front Left - Front Right
 Limits: Playback 0 - 255
 Mono:
 Front Left: Playback 255 [100%] [0.00dB]
 Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'IEC958',0
 Capabilities: pswitch pswitch-joined
 Playback channels: Mono
 Mono: Playback [off]
Simple mixer control 'Capture',0
 Capabilities: cvolume cswitch
 Capture channels: Front Left - Front Right
 Limits: Capture 0 - 15
 Front Left: Capture 8 [53%] [12.00dB] [on]
 Front Right: Capture 8 [53%] [12.00dB] [on]
Simple mixer control 'Auto-Mute Mode',0
 Capabilities: enum
 Items: 'Disabled' 'Enabled'
 Item0: 'Disabled'
Simple mixer control 'Internal Mic Boost',0
 Capabilities: volume
 Playback channels: Front Left - Front Right
 Capture channels: Front Left - Front Right
 Limits: 0 - 3
 Front Left: 3 [100%] [30.00dB]
 Front Right: 3 [100%] [30.00dB]

我也找不到~/.asoundrc/etc/asound.conf並且有一個配置文件,/etc/alsa/conf.d但書中沒有alsa.conf給出。該命令locate libasound.so顯示目錄/usr/lib/libasound.so,但沒有/usr/lib/alsa-lib/smixer書中給出的目錄。

我的筆記型電腦終於有聲音了!我只是把所有東西都做成了模組<m>Device Drivers -> Sound Card Support -> Advanced Linux Sound Architecture它工作了!

以下是lsmod所需模組的輸出:

lsmod
Module                  Size  Used by
snd_hda_codec_hdmi     45056  1
snd_hda_codec_idt      49152  1
snd_hda_codec_generic    65536  1 snd_hda_codec_idt
snd_hda_intel          36864  3
snd_hda_codec          98304  4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_idt
snd_hwdep              16384  1 snd_hda_codec
snd_hda_core           65536  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_idt

引用自:https://unix.stackexchange.com/questions/621938