我正在尝试在2个覆盆子pis之间流式传输低延迟音频。 gstreamer和ffmpeg都会对我造成2秒钟以上的延迟。

我曾与Jack Audio一起玩过,在一次pi上本地播放似乎很有希望。我可以将麦克风输入本地路由到扬声器,这几乎是瞬时的。

但是,使用Netjack在设备之间路由时遇到了麻烦。

# ON SERVER
jackd -P70 -p16 -t2000 -dalsa -dhw:1 -p128 -n3 -r44100 -s

# ON CLIENT
jackd -v -R -P70 -dnetone -i1 -o1 -I0 -O0  -r44100 -p128 -n3

# ON SERVER
jack_netsource -H < ip address of client >
jack_lsp # list availible connection ports

>system:capture_1
>system:playback_1
>system:playback_2
>netjack:capture_1
>netjack:capture_2
>netjack:capture_3
>netjack:playback_1
>netjack:playback_2
>netjack:playback_3

jack_connect system:capture_1 system:playback_1 # this works
jack_connect system:capture_1 netjack:playback_1 # this doesn't work :(

我从这里拉出的大多数启动选项http://wiki.linuxaudio.org/wiki/raspberrypi#using_jack。老实说,我真的不知道他们在做什么。

客户端jackd输出显示如下消息
Jack: data not valid
Jack: data not valid
Jack: JackSocketServerChannel::Execute : fPollTable i = 1 fd = 6
Jack: JackRequest::Notification
Jack: JackEngine::ClientNotify: no callback for notification = 3
Jack: JackEngine::ClientNotify: no callback for notification = 3
netxruns... duration: 139ms
Jack: JackSocketServerChannel::Execute : fPollTable i = 1 fd = 6
Jack: JackRequest::Notification
Jack: JackEngine::ClientNotify: no callback for notification = 3
Jack: JackEngine::ClientNotify: no callback for notification = 3

服务器jack_netsource的输出看起来像
current latency 114
current latency 20
current latency 27
current latency 29
current latency 48
current latency 23
current latency 33
current latency 28
current latency 41
current latency 84
current latency 44

和服务器杰克输出看起来像
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = netjack was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = netjack was not finished, state = Triggered
JackEngine::XRun: client = netjack was not finished, state = Triggered

我相信-dnetone标志指示使用Netjack2。我尝试使用-dnet标志的Netjack 1会从jack_netsource获得一条Not Connected消息,并且:
Jack: CatchHost fd = 5 err = Resource temporarily unavailable
Jack: CatchHost fd = 5 err = Resource temporarily unavailable
Jack: CatchHost fd = 5 err = Resource temporarily unavailable
Jack: CatchHost fd = 5 err = Resource temporarily unavailable
Jack: CatchHost fd = 5 err = Resource temporarily unavailable
Jack: JackSocketServerChannel::Execute : fPollTable i = 1 fd = 6

从客户杰克。

最佳答案

首先,在树莓派上,确保已启用mmap(check here)。
正确设置jackd之后,这是在主机和从机之间连接jackd2的基本方法:
在主人...

jackd -d alsa
jack_load netmanager
在奴隶上...
jackd -r -d net -a ipaddress
此时应该可以正常工作,不要忘记将端口从netjack连接到主机上的系统输入和输出。您可以使用JackPortMonitor或JackPortMonitorGui为您自动在主机上连接这些端口。在这种情况下,主启动看起来像这样:
杰克-d阿尔萨
jack_load网络管理员
JackPortMonitorGui

关于audio - 无法使LAN上的JACK Audio/Netjack正常工作,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36274662/

10-10 11:43