bondagit / aes67-linux-daemon

AES67 Linux Daemon with configuration WebUI
GNU General Public License v3.0
372 stars 82 forks source link

Documentation: simple driver2driver network test #83

Open neoscopio opened 2 years ago

neoscopio commented 2 years ago

Hi, I've looked at devices.md, and I'm missing a way to stream audio from aes67 virtual driver to another aes67 virtual driver. I've setup two devices (a desktop and a raspeberry pi). Both sources show up in the respective web interfaces, but I cant get audio to play across network. At this moment I can't run a dante controller, (I don't have a window machine right now) and I can't find another way to connect sources to sinks. I'm probably missing something, but is there a way to test this without using a controller, from the command line or web interface?

Also: can the "Buttler" thing from ravenna be used here?

Thanks

bondagit commented 2 years ago

First of all you need to have a PTP master clock running on the LAN. Use the WebUI on both devices and make sure that the PTP status in the PTP tab is locked. Then you need to configure a Sink. On one of the two devices (or on both) go to the Sink tab, click on the Plus (+) button, check on Use SDP and select the SDP file of the remote device. Once you are done you have to run a playback on the Source device to activate the streaming that you can record on the Sink. For example on the Source device you can run: speaker-test -D plughw:RAVENNA -r 48000 -c 2 -t sine to record on the Sink device you can use: arecord -D plughw:RAVENNA -c 2 -f cd -d 30 -r 48000 -t wav sink.wav

neoscopio commented 2 years ago

Hi, couldn't get this to work. My guess is about the ptp clock not locking, but can't figure out why.

I started a master in a desktop with: sudo ptp4l -i enp1s0 -m -l7 -S I started a slave in the pi with: sudo ptp4l -i eth0 -m -l7 -s -S

Since slave is locked to the correct master, I've tried to go ahead anyway:

Tried to play on the source, record on the pi, but arecord hangs and doesn't finish. [ctrl-c] to exit, sink.wav only 44 bytes. Reversed roles, now arecord records 30sec of silence

Can you help?

bondagit commented 2 years ago

HI there, by default you cannot run the master clock on the same board where you run the AES67 daemon, and you have to run ptp4l on a third board. The reason is that the original version of ptp4l disable the local multicast (it's possible tp patch it but you have to recompile it from the sources, see #34 ) On the boards where you run the daemon you don't need to run the ptp slave because it is embedded in the driver. Before running playback/capture verify on the two boards using the WebUI that your PTP slave clock is locked otherwise it cannot work.

neoscopio commented 2 years ago

Ah! ok, I'll try that, thanks!

neoscopio commented 2 years ago

So, it works, some problems:

In the source I did: speaker-test -D plughw:RAVENNA -r 48000 -c 2 -t wave -l 4 to get the "Front Left","Front Right" repeated four times

In the sink (raspberry) I did: arecord -D plughw:RAVENNA -c 2 -f cd --duration=30 -r 48000 -t wav sink.wav

then aplay sink.wav :

I notice a somewhat long silence on the start, then it starts playing OK, but the recording ends sooner, on the last "Front Right" stops after the "Front..." never recording the last "Right" word.

Is there an easy way for the driver to output directly to the plughw:1,0 (raspeberry headphone jack?), or alsa default sink, that in my case are the same?

Thanks!

neoscopio commented 2 years ago

Just tried to listening directly using:

sudo nice -n -10 alsaloop -c 2 -r 48000 -f S16_LE -C plughw:RAVENNA -P plughw:1,0

I hear some "clicks" not present in the recording, and the sound still ends sooner missing the last "Right" word. (also tried with S32_LE)

neoscopio commented 2 years ago

... I've managed to get rid of the "click" sounds, specifying "-b" option. I could also get a better flow using "-t" option with a greater latency, but I'm trying to get that to the bare minimum.

Still, I get these weird results, e.g:

aplay -D plughw:RAVENNA /usr/share/sounds/alsa/Side_Left.wav

It should be on the "LEFT side" of my headphones, but it plays on the "RIGHT" side. Still cuts the last word, as saying. "Side Le...". Same with the speakertest.

If I specify a buffer, like:

speaker-test -b1000 -D plughw:RAVENNA -r 48000 -c 2 -t wave -l 4

It gets to play to the end, but channels are still reversed.

Any ideas?

Thanks