首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Raspberry Pi将usb麦克风重定向到hdmi音频

Raspberry Pi将usb麦克风重定向到hdmi音频
EN

Stack Overflow用户
提问于 2019-01-31 09:19:43
回答 1查看 397关注 0票数 0

我有工作的HDMI音频,可以看到usb麦克风,但我不确定ALSA的设置是什么,通过HDMI发送现场音频。我不想只录制,因为我正在使用它作为现场摄像机到另一个房间的hdmi监视器,并需要实时音频和视频。我正在使用raspivid来运行摄像头部分。

我尝试过录制-D插件w:1,0| aplay,但有大约一秒的长时间延迟。我需要它和视频同步。

另外: jackd -r -d alsa -D -Chw:1 -Phw:0 -r 44100。服务器运行,但没有任何反应,没有音频输出。

EN

回答 1

Stack Overflow用户

发布于 2019-02-01 06:44:08

对于那些对此感兴趣的人,我找到了一个非常有效的答案。这是我发现的最简单和最低的延迟。

注意:这不是无头的。你需要做更多的工作才能让它无头工作。

我做了什么来制作一台带音频的HDMI直播摄像机:

代码语言:javascript
复制
(Note: I'm assuming that pi is the user. Edit accordingly if not.)

1. Get a raspberry pi camera module and a USB microphone.

2. Get and compile Tinyalsa https://github.com/tinyalsa/tinyalsa and
   install according to git hub instructions.

3. (Optional) Force hdmi audio with raspi-config. You may not need this
   but default is auto so if you start your Pi without an HDMI monitor
   it will default to outputting to the 3.5mm jack.

4. copy /etc/xdg/lxsession/LXDE-pi/autostart to 
   ~/.config/lxsession/LXDE-pi/autostart

5. add these lines to the end of ~/.config/lxsession/LXDE-pi/autostart:

   /usr/bin/raspivid -t 0
   /home/pi/runtinycap.sh

   (Note: you can put an @ sign before them if you want to 
   automatically restart if the apps crash, but I haven't tested.)

6. create /home/pi/runtinycap.sh with these lines (need to know the audio card
   numbers and may also need the card device numbers using -d after the -D's):

   #!/bin/bash
   /usr/local/bin/tinycap -- -D <card no> -c 1 -r 44100 -b 16 -p 16 -n 2 | /usr/local/bin/tinyplay - -D <card no> -c 1 -r 44100 -b 16 -p 16 -n 2

我希望这会有所帮助,因为这是一个非常痛苦的练习,花了8个多小时才弄清楚,因为只有谷歌搜索的信息很少!

延迟比Jack,QjackCtl,pulseaudio,arecord都要好得多,我无法在没有Jack崩溃的情况下将-p设置为小于2048和-n 4,并且有大约140ms的延迟。TinyAlsa只有16和2!我不知道确切的延迟,但它非常低。视频和音频是同步的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54452020

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档