我购买了一个小型USB声卡。我的Pi可以识别该设备:
$ lsusb
Bus 001 Device 004: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller
如果我运行alsamixer
并将音频设置为USB PnP Sound Device
,则可以通过USB声卡听到音频。要使其永久,我输入:
$ sudo alsactl store
但是重新启动后,默认设置不再是USB声卡。
因此,我尝试查看播放设备列表:
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
我进行编辑/etc/asound.conf
以设置默认值:
$ sudo nano /etc/asound.conf
pcm.!default {
type hw
card 1
device 0
}
做一个reboot
,但我的默认设置不是USB声卡。
当我尝试:
$ aplay /usr/share/sounds/alsa/Front_Center.wav -D sysdefault:CARD=1
我听到了USB卡发出的声音。
我还尝试了以下方法:
$ sudo nano /etc/modprobe.d/alsa-base.conf
将索引从-2更改为0:
options snd-usb-audio index=0
重新启动,仍然没有设置默认值。我什至评论了这一行,没有运气。
那么,如何将USB卡设置为默认音频设备?
编辑
dpkg -s pulseaudio
显示:
Package: pulseaudio
Status: install ok installed
Priority: optional
Section: sound
Installed-Size: 4413
Maintainer: Pulseaudio maintenance team <pkg-pulseaudio-devel@lists.alioth.debian.org>
Architecture: armhf
Multi-Arch: foreign
Version: 2.0-6
Depends: libasound2 (>= 1.0.24.1), libc6 (>= 2.13-28), libcap2 (>= 2.10), libdbus-1-3 (>= 1.1.1), libfftw3-3, libgcc1 (>= 1:4.4.0), libice6 (>= 1:1.0.0), libltdl7 (>= 2.4.2), liborc-0.4-0 (>= 1:0.4.16), libpulse0 (= 2.0-6), libsamplerate0 (>= 0.1.7), libsm6, libsndfile1 (>= 1.0.20), libspeexdsp1 (>= 1.2~beta3.2-1), libstdc++6 (>= 4.1.1), libsystemd-daemon0 (>= 31), libsystemd-login0 (>= 31), libtdb1 (>= 1.2.7+git20101214), libudev0 (>= 146), libwebrtc-audio-processing-0, libx11-6, libx11-xcb1, libxcb1, libxtst6, adduser, lsb-base (>= 3.2-13), consolekit, udev (>= 143), libasound2-plugins
Recommends: pulseaudio-module-x11, gstreamer0.10-pulseaudio, rtkit
Suggests: pulseaudio-utils, pavumeter, pavucontrol, paman, paprefs
Breaks: libltdl3 (<< 1.5.24-1)
Conffiles:
/etc/init.d/pulseaudio 8580c855e4547e8a3c84dca96d9bbd7e
/etc/default/pulseaudio ee26e4427d72cf16a59b1a8ce2712c66
/etc/xdg/autostart/pulseaudio.desktop 5e19ffbe14d21702be1edd3256c4265d
/etc/xdg/autostart/pulseaudio-kde.desktop fd20c58d32035e908a0866784e4e3511
/etc/pulse/system.pa 408f6d6119d7afce522ab1b394709134
/etc/pulse/default.pa a9ac2a96744beae0913865fafd3d2582
/etc/pulse/daemon.conf 6c9e4c973cabb406beee3ec81c63fcd7
/etc/dbus-1/system.d/pulseaudio-system.conf 69d56dc5342bf589a2e199541709a452
Description: PulseAudio sound server
PulseAudio, previously known as Polypaudio, is a sound server for POSIX and
WIN32 systems. It is a drop in replacement for the ESD sound server with
much better latency, mixing/re-sampling quality and overall architecture.
.
然后:
cat /proc/asound/modules
显示:
0 snd_bcm2835
1 snd_usb_audio
cat /proc/asound/modules
并发布输出吗?
options snd-usb-audio index=0 [PRESS ENTER] options snd_bcm2835 index=1
?从我所看到的,您只是在更改snd-usb-audio
索引,而系统又将其更改回原来的位置,因为它不能在同一索引上同时包含两个(usb和bcm2835)?
dpkg -s pulseaudio
出去找出答案,dpkg-query: package 'pulseaudio' is not installed and no information is available
如果不是,它会说类似的话。您可以运行该命令并发布输出吗?