我正在尝试将raspbmc (在Raspberry Pi Model b上运行)的默认音频输出录制为原始wav流(我想通过管道将其传输到piFM,以便将音频传输到FM调谐器)。我没有成功地使用一个记录,并发现raspbmc的默认音频引擎是pulseaudio,所以我尝试了使用parecord/pacat。
我的pi通过HDMI连接到电视上,声音工作正常。但是pactl list只给了我以下的汇/源:
Sink #0
State: SUSPENDED
Name: auto_null
Description: Dummy Output
Driver: module-null-sink.c
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 4
Mute: no
Volume: 0: 100% 1: 100%
0: 0.00 dB 1: 0.00 dB
balance 0.00
Base Volume: 100%
0.00 dB
Monitor Source: auto_null.monitor
Latency: 0 usec, configured 0 usec
Flags: DECIBEL_VOLUME LATENCY
Properties:
device.description = "Dummy Output"
device.class = "abstract"
device.icon_name = "audio-card"
Formats:
pcm
Source #0
State: SUSPENDED
Name: auto_null.monitor
Description: Monitor of Dummy Output
Driver: module-null-sink.c
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 4
Mute: no
Volume: 0: 100% 1: 100%
0: 0.00 dB 1: 0.00 dB
balance 0.00
Base Volume: 100%
0.00 dB
Monitor of Sink: auto_null
Latency: 0 usec, configured 0 usec
Flags: DECIBEL_VOLUME LATENCY
Properties:
device.description = "Monitor of Dummy Output"
device.class = "monitor"
device.icon_name = "audio-input-microphone"
Formats:
pcm此外,aplay还为我提供了:
pi@raspbmc:~$ aplay -l
aplay: device_list:252: no soundcards found...
pi@raspbmc:~$ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)尝试从默认设备录制音频时,不会录制任何内容。当我尝试使用paplay播放声音时,没有播放任何声音(没有错误,只是没有声音)。
那么我在这里错过了什么呢?我只需要把所有播放的声音发送到另一个程序...
我花了几个小时在谷歌和论坛、维基和博客上,但还没有找到适合我的设置的解决方案。
提前感谢!
编辑: /dev/audio在raspbmc上不存在,/dev/snd只包含条目'timer‘
发布于 2014-04-23 21:16:09
您可能需要加载声音设备的内核模块,如下所示:
# modprobe snd-bcm2835这将导致一些新的设备文件出现在/dev/snd/中,pulseaudio将检测为卡#0。如果我理解正确的话,这个设备是一个让pulseaudio通过ALSA输出声音的层。将其添加到您的/etc/modules,使其在引导时自动加载。
在我的设置中,ALSA默认通过HDMI输出声音。如果没有,或者您希望将其更改为phono插孔,您可以使用amixer命令:
$ amixer cset numid=3 <output>
0=auto
1=headphones
2=hdmi来源:http://www.raspberrypi.org/forums/viewtopic.php?f=38&t=27019。与他们的示例相反,我可以以非特权用户pi而不是root用户的身份执行此命令。
发布于 2017-11-09 17:14:09
我已经为它挣扎了一个星期左右。虽然在我的linux-menuconfig中为snd_bcm2835启用了ALSA。
pi@raspi:~$ aplay -l
aplay: device_list:250: no soundcards found...和
# aplay output.wav
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4528:(_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:4528:(_snd_config_evaluate) function snd_func_concat
returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer
returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file
or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:788: audio open error: No such file or directory此修复:
尝试向/boot/config.txt添加dtparam=audio=on
来源:非常感谢fzinken >> Alsa doesn’t work on my Raspberry Pi 2/3
https://stackoverflow.com/questions/18902761
复制相似问题