无法播放声音,ALSA库错误

0x0字节

编辑添加ls -l / dev / snd /

编辑添加了混音器-c 0

我正在尝试让我的Ubuntu服务器12.04 lt播放声音文件。但是,我总是收到以下错误,从扬声器测试命令显示。

更新我不再收到以下错误,声音文件将播放(必须将我的用户添加到声音组),但是听不到声音。

speaker-test 1.0.25

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels

Using 16 octaves of pink noise
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM default
Playback open error: -2,No such file or directory

aplay -l

**** List of PLAYBACK Hardware Devices ****

card 0: CMI8738 [C-Media CMI8738], device 0: CMI8738-MC6 [C-Media PCI DAC/ADC]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CMI8738 [C-Media CMI8738], device 1: CMI8738-MC6 [C-Media PCI 2nd DAC]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CMI8738 [C-Media CMI8738], device 2: CMI8738-MC6 [C-Media PCI IEC958]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

lspci -v | grep -A7 -i "audio"

01:00.0 Multimedia audio controller: C-Media Electronics Inc CMI8738/CMI8768 PCI Audio (rev 10)
    Subsystem: C-Media Electronics Inc CMI8738/C3DX PCI Audio Device
    Flags: bus master, medium devsel, latency 64, IRQ 21
    I/O ports at de00 [size=256]
    Capabilities: <access denied>
    Kernel driver in use: snd_cmipci
    Kernel modules: snd-cmipci

01:08.0 Ethernet controller: Intel Corporation 82562EZ 10/100 Ethernet Controller (rev 02)

lsmod | grep snd

snd_cmipci             39606  0 
gameport               15088  1 snd_cmipci
snd_pcm                85934  1 snd_cmipci
snd_page_alloc         18398  1 snd_pcm
snd_opl3_lib           18863  1 snd_cmipci
snd_hwdep              13276  1 snd_opl3_lib
snd_mpu401_uart        13865  1 snd_cmipci
snd_seq_midi           13132  0 
snd_rawmidi            25157  2 snd_mpu401_uart,snd_seq_midi
snd_seq_midi_event     14475  1 snd_seq_midi
snd_seq                51593  2 snd_seq_midi,snd_seq_midi_event
snd_timer              28931  3 snd_pcm,snd_opl3_lib,snd_seq
snd_seq_device         14137  4 snd_opl3_lib,snd_seq_midi,snd_rawmidi,snd_seq
snd                    57014  9 snd_cmipci,snd_pcm,snd_opl3_lib,snd_hwdep,snd_mpu401_uart,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
soundcore              12600  1 snd

ls -l /dev/snd/

total 0
drwxr-xr-x 2 root root       60 Sep  7 11:12 by-path
crw-rw---T 1 root audio 116,  8 Sep  7 11:12 controlC0
crw-rw---T 1 root audio 116,  7 Sep  7 11:12 pcmC0D0c
crw-rw---T 1 root audio 116,  6 Sep  7 11:12 pcmC0D0p
crw-rw---T 1 root audio 116,  5 Sep  7 11:12 pcmC0D1c
crw-rw---T 1 root audio 116,  4 Sep  7 11:12 pcmC0D2c
crw-rw---T 1 root audio 116,  3 Sep  7 11:12 pcmC0D3c
crw-rw---T 1 root audio 116,  2 Sep  7 11:12 pcmC0D4p
crw-rw---T 1 root audio 116,  1 Sep  7 11:12 seq
crw-rw---T 1 root audio 116, 33 Sep  7 11:12 timer

amixer -c 0

Simple mixer control 'Master',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 31 [100%] [0.00dB] [on]
  Front Right: Playback 31 [100%] [0.00dB] [on]
Simple mixer control 'Master Mono',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
  Playback channels: Mono
  Limits: Playback 0 - 31
  Mono: Playback 31 [100%] [0.00dB] [off]
Simple mixer control 'Master Surround',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 31 [100%] [0.00dB] [off]
  Front Right: Playback 31 [100%] [0.00dB] [off]
Simple mixer control 'Headphone Jack Sense',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'PCM',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 31 [100%] [12.00dB] [off]
  Front Right: Playback 31 [100%] [12.00dB] [off]
Simple mixer control 'Surround',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 31 [100%] [0.00dB] [off]
  Front Right: Playback 31 [100%] [0.00dB] [off]
Simple mixer control 'Surround Jack Mode',0
  Capabilities: enum
  Items: 'Shared' 'Independent'
  Item0: 'Shared'
Simple mixer control 'Center',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
  Playback channels: Mono
  Limits: Playback 0 - 31
  Mono: Playback 31 [100%] [0.00dB] [off]
Simple mixer control 'LFE',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
  Playback channels: Mono
  Limits: Playback 0 - 31
  Mono: Playback 31 [100%] [0.00dB] [off]
Simple mixer control 'Line',0
  Capabilities: pvolume pswitch cswitch cswitch-exclusive penum
  Capture exclusive group: 0
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Front Left: Playback 31 [100%] [12.00dB] [off] Capture [off]
  Front Right: Playback 31 [100%] [12.00dB] [off] Capture [off]
Simple mixer control 'Line Jack Sense',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'CD',0
  Capabilities: pvolume pswitch cswitch cswitch-exclusive penum
  Capture exclusive group: 0
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Front Left: Playback 31 [100%] [12.00dB] [off] Capture [off]
  Front Right: Playback 31 [100%] [12.00dB] [off] Capture [off]
Simple mixer control 'Mic',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined cswitch cswitch-exclusive penum
  Capture exclusive group: 0
  Playback channels: Mono
  Capture channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono: Playback 0 [0%] [-34.50dB] [off]
  Front Left: Capture [on]
  Front Right: Capture [on]
Simple mixer control 'Mic Boost (+20dB)',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Mic Select',0
  Capabilities: enum
  Items: 'Mic1' 'Mic2'
  Item0: 'Mic1'
Simple mixer control 'Video',0
  Capabilities: cswitch cswitch-exclusive penum
  Capture exclusive group: 0
  Capture channels: Front Left - Front Right
  Front Left: Capture [off]
  Front Right: Capture [off]
Simple mixer control 'Phone',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined cswitch cswitch-exclusive penum
  Capture exclusive group: 0
  Playback channels: Mono
  Capture channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono: Playback 31 [100%] [12.00dB] [off]
  Front Left: Capture [off]
  Front Right: Capture [off]
Simple mixer control 'Aux',0
  Capabilities: pvolume pswitch cswitch cswitch-exclusive penum
  Capture exclusive group: 0
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Front Left: Playback 31 [100%] [12.00dB] [off] Capture [off]
  Front Right: Playback 31 [100%] [12.00dB] [off] Capture [off]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 15
  Front Left: Capture 0 [0%] [0.00dB] [on]
  Front Right: Capture 0 [0%] [0.00dB] [on]
Simple mixer control 'Mix',0
  Capabilities: cswitch cswitch-exclusive penum
  Capture exclusive group: 0
  Capture channels: Front Left - Front Right
  Front Left: Capture [off]
  Front Right: Capture [off]
Simple mixer control 'Mix Mono',0
  Capabilities: cswitch cswitch-exclusive penum
  Capture exclusive group: 0
  Capture channels: Front Left - Front Right
  Front Left: Capture [off]
  Front Right: Capture [off]
Simple mixer control 'Channel Mode',0
  Capabilities: enum
  Items: '2ch' '4ch' '6ch'
  Item0: '2ch'
Simple mixer control 'Downmix',0
  Capabilities: enum
  Items: 'Off' '6 -> 4' '6 -> 2'
  Item0: 'Off'
Simple mixer control 'Exchange Front/Surround',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'External Amplifier',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'High Pass Filter Enable',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Spread Front to Surround and Center/LFE',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Stereo Mic',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'V_REFOUT Enable',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [on]
0x0字节

通过将我的用户添加到声音组来解决。

sudo useradd -G sound {username}

然后强制我的集成声卡的索引为1,因此pci卡默认为0。

找到您不想成为聋子的卡片。我的是snd_intel8x0。当前默认索引为0。

cat /proc/asound/modules

0 snd_cmipci
1 snd_intel8x0

修改conf文件,以便将您不需要的卡默认设置为索引1

sudo nano /etc/modprobe.d/alsa-base.conf

找到这行:

# Prevent abnormal drivers from grabbing index 0

并在其下添加以下内容,使用您的声卡的名称代替我的snd_intel8x0

options snd_intel8x0 index=1

最后重新启动并使用alsamixer来确保该卡没有被静音。

alsamixer

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

无法播放声音

来自分类Dev

SKAudioNode无法播放声音

来自分类Dev

无法让OpenAL播放声音

来自分类Dev

在LXC容器中使用ALSA播放声音时出错

来自分类Dev

WMPLib DLL错误中播放声音

来自分类Dev

无法在iOS上播放声音

来自分类Dev

MediaElement无法播放声音效果

来自分类Dev

为什么PyGame无法播放声音

来自分类Dev

无法在耳机中播放声音

来自分类Dev

Android SoundPool无法播放声音

来自分类Dev

无法在耳机中播放声音

来自分类Dev

Java / Eclipse无法播放声音

来自分类Dev

无法播放声音文件

来自分类Dev

Node.js 播放声音:类型错误:无法读取未定义的属性“播放”

来自分类Dev

如何播放声音?

来自分类Dev

快速播放声音

来自分类Dev

如何给空白数据给双簧管库播放声音?

来自分类Dev

使用MediaPlayer播放声音时出现无效属性错误

来自分类Dev

无法在Meteor.js应用中播放声音

来自分类Dev

自定义Segue无法播放声音

来自分类Dev

无法使用Cordova在Android Game Build上播放声音

来自分类Dev

iOS模拟器无法播放声音

来自分类Dev

Qt无法在其他设备上播放声音

来自分类Dev

无法使用Cordova在Android Game Build上播放声音

来自分类Dev

iOS模拟器无法播放声音

来自分类Dev

华硕Xonar DX问题:Windows无法播放声音

来自分类Dev

AudioPlayer无法在使用Java 1.6的Mac上播放声音

来自分类Dev

LinuxMint 19.1 Tessa无法在默认设备中播放声音

来自分类Dev

用Java播放声音