Git Product home page Git Product logo

aes67-sender's Introduction

AES67 Sender

Make a soundcard input available in an AES67 network. Works under Windows (DirectSound, ASIO and WASAPI), Linux (ALSA, JACK, PulseAudio and OSS) and MacOS (CoreAudio and JACK). Tested under Ubuntu (18.04 and 20.04), Raspbian and Windows 10. Not yet tested under MacOS.

Installation

To install aes67-sender, clone the repository and install the dependencies.

git clone https://github.com/philhartung/aes67-sender.git
cd aes67-sender
npm install

Audify (audio backend used) prebuilds are available for most major platforms and Node versions. If you need to build Audify from source, see https://github.com/almogh52/audify#requirements-for-source-build.

Usage

To display the help, execute node aes67 --help:

Usage: aes67 [options]

Options:
  -V, --version            output the version number
  -v, --verbose            enable verbosity
  --devices                list audio devices
  -d, --device <index>     set audio device
  -m, --mcast <address>    multicast address of AES67 stream
  -n, --streamname <name>  name of AES67 stream
  -c, --channels <number>  number of channels
  -a, --api <api>          audio api (ALSA, OSS, PULSE, JACK, MACOS, ASIO, DS, WASAPI)
  --address <address>      IPv4 address of network interface
  -h, --help               display help for command

The software has to be executed with priviliges, because the PTP client binds to ports below 1024.

Use cases

Raspberry Pi 4 with Focusrite Scarlett 2i2

The setup is a Rasperry Pi 4 (running Ubuntu 20.04) running aes67-sender with a Focusrite Scarlett 2i2 USB audio interface. First list the audio devices:

pi@raspberrypi:~/aes67-sender $ node aes67 -a alsa --devices
Selected ALSA as audio api
Index, Name, # of Channels
1 'hw:Scarlett 2i2 USB,0' 2

We see the Focusrite interface is index #1, so we can execute the following command to start aes67-sender: sudo node aes67 -a alsa -d 1 -n "Focusrite Scarlett 2i2". The device should now show up as "Focusrite Scarlett 2i2" in Dante Controller or similar software. The two inputs of the Focusrite Scarlett 2i2 are now available in the AES67 network.

Latency cosiderations

In practice low latency is important. Especially when working in a hybrid Dante/AES67 network, latency should be under 2ms. Dante devices are fixed to a maximum of 2ms latency and drop packets with higher latency. With a Raspberry Pi, latency jitter is quite high. A lot/too many packets are dropped because latency is too high when sending audio to a Dante receiver. With a i7-2600 test system (running Ubuntu 18.04), latency (jitter) was low enough for Dante devices. Here is a screenshot of the latency distribution over one hour from aes67-sender running on a i7-2600 test system to a Dante receiver:

Screenshot

aes67-sender's People

Contributors

philhartung avatar quphoria avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

aes67-sender's Issues

Compatibility with virtual sound cards or is it a PTP issue?

Hi!

I tried using this sender with VB-AUDIO virtual audio interface, and I get crackling and buffering issues in AES67 receiver. I haven't yet tried to eliminate this problem by trying a hardware sound interface.

Interesting thing is that when on verbose, there are PTP related messages flowing. Are these normal?

Synced to <redacted> successfully
Starting SAP annoucements and audio stream.
Resycing PTP and RTP timestamp. Offset was 12.021ms.
Resycing PTP and RTP timestamp. Offset was 12.188ms.
Resycing PTP and RTP timestamp. Offset was 14.146ms.
Resycing PTP and RTP timestamp. Offset was 8.979ms.
Resycing PTP and RTP timestamp. Offset was 17.125ms.
Resycing PTP and RTP timestamp. Offset was 17.313ms.
Resycing PTP and RTP timestamp. Offset was 17.375ms.
Resycing PTP and RTP timestamp. Offset was 20.896ms.
Resycing PTP and RTP timestamp. Offset was 8.667ms.
Resycing PTP and RTP timestamp. Offset was 13.854ms.
Resycing PTP and RTP timestamp. Offset was 14.771ms.
Resycing PTP and RTP timestamp. Offset was 11.854ms.
Resycing PTP and RTP timestamp. Offset was 12.896ms.
Resycing PTP and RTP timestamp. Offset was 25.479ms.
Resycing PTP and RTP timestamp. Offset was 11.042ms.
Resycing PTP and RTP timestamp. Offset was 14.229ms.
Resycing PTP and RTP timestamp. Offset was 18.083ms.
Resycing PTP and RTP timestamp. Offset was 15.896ms.
Resycing PTP and RTP timestamp. Offset was 17.021ms.
Resycing PTP and RTP timestamp. Offset was 20.542ms.
Resycing PTP and RTP timestamp. Offset was 8.479ms.
Resycing PTP and RTP timestamp. Offset was 15.229ms.
Resycing PTP and RTP timestamp. Offset was 15.021ms.
Resycing PTP and RTP timestamp. Offset was 22.417ms.
Resycing PTP and RTP timestamp. Offset was 15.021ms.
Resycing PTP and RTP timestamp. Offset was 26.458ms.
Resycing PTP and RTP timestamp. Offset was 19.104ms.
Resycing PTP and RTP timestamp. Offset was 11.146ms.
Resycing PTP and RTP timestamp. Offset was 23.646ms.
Resycing PTP and RTP timestamp. Offset was 20.063ms.
Resycing PTP and RTP timestamp. Offset was 9.792ms.

Not showing up in Dante controller

I was able to get this running on OSX. I have a dante primary and it seems to be able to see the AES67 stream (it's a dante DSP) but I'd prefer to configure the receive/transmit via dante controller and aes-sender is not showing up there under transmit. Any ideas?

Error Could not sync to PTP master. Aborting.

I have PTP installed and bound to the eth0.

Why am I still getting this error ?

root@x92f3371a9a4f:/usr/src/aes67-sender# ethtool -T eth0
Time stamping parameters for eth0:
Capabilities:
hardware-transmit (SOF_TIMESTAMPING_TX_HARDWARE)
software-transmit (SOF_TIMESTAMPING_TX_SOFTWARE)
hardware-receive (SOF_TIMESTAMPING_RX_HARDWARE)
software-receive (SOF_TIMESTAMPING_RX_SOFTWARE)
software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
hardware-raw-clock (SOF_TIMESTAMPING_RAW_HARDWARE)
PTP Hardware Clock: 0
Hardware Transmit Timestamp Modes:
off (HWTSTAMP_TX_OFF)
on (HWTSTAMP_TX_ON)
Hardware Receive Filter Modes:
none (HWTSTAMP_FILTER_NONE)
all (HWTSTAMP_FILTER_ALL)
ptpv1-l4-sync (HWTSTAMP_FILTER_PTP_V1_L4_SYNC)
ptpv1-l4-delay-req (HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ)
ptpv2-l4-sync (HWTSTAMP_FILTER_PTP_V2_L4_SYNC)
ptpv2-l4-delay-req (HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ)
ptpv2-l2-sync (HWTSTAMP_FILTER_PTP_V2_L2_SYNC)
ptpv2-l2-delay-req (HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ)
ptpv2-event (HWTSTAMP_FILTER_PTP_V2_EVENT)
ptpv2-sync (HWTSTAMP_FILTER_PTP_V2_SYNC)
ptpv2-delay-req (HWTSTAMP_FILTER_PTP_V2_DELAY_REQ)
root@x92f3371a9a4f:/usr/src/aes67-sender#

Error when running on RPI4 with Ubuntu

Hi,
running the application gives you the following GLIBC error:
Error: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/ubuntu/repo/aes67-sender/node_modules/audify/build/Release/audify.node)

Although it seems that Ubuntu 20.04 has been tested.

lsb_release -a
Description: Ubuntu 20.04.5 LTS

ldd --version
ldd (Ubuntu GLIBC 2.31-0ubuntu9.9) 2.31

Moved to Ubuntu 24.04 RPI, the device list command gets an Alsa error:
node aes67 -a alsa --devices
ALSA lib control.c:1570:(snd_ctl_open_noupdate) Invalid CTL pulse
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM output
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM input

Unhandled error event

Hey,

When starting the virtual sound card, i get this error:

$ node aes67 -a alsa -d 7 -n "Focusrite Scarlett 2i2"
events.js:174
throw er; // Unhandled 'error' event
^

Error: bind EACCES 0.0.0.0:319
at state.handle.lookup (dgram.js:242:18)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Emitted 'error' event at:
at state.handle.lookup (dgram.js:243:14)
at process._tickCallback (internal/process/next_tick.js:63:19)
[... lines matching original stack trace ...]
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

Can't get aes67-sender to open an alsa device

Hey there,
i've been trying to get aes67-sender to work on my setup for a while now and it just can't seem to be able to open any devices.

I've tried on ubuntu 20.04 and various versions of arch linux and i always end up with the following errors:

➜  aes67-sender git:(master) node aes67 -a alsa --devices
Index, Name, # of Channels
0 Default ALSA Device 32
1 PulseAudio Sound Server 32
7 HD-Audio Generic (ALC897 Alt Analog) 2
8 Scarlett Solo 4th Gen (USB Audio) 4
➜  aes67-sender git:(master) sudo node aes67 -d 8 -n "Scarlett Solo 4th Gen (USB Audio)"
[sudo] password for kanken: 
ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
Invalid audio device!
➜  aes67-sender git:(master) sudo node aes67 -a alsa -d 8 -n "Scarlett Solo 4th Gen (USB Audio)"
ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
Invalid audio device!
➜  aes67-sender git:(master) 

Trying it on a rpi 4 running ubuntu 24.04 yeilds the same result, do you have any idea what might be going wrong here?
Thanks in advance.

Example how to combine PTP and AES67 stream

Hello

i installed the ptp4l package and started it:

sudo ptp4l -A -m -i eth0 -S -i lo

ptp4l[1247.384]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[1247.385]: port 2: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[1247.385]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[1254.157]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
ptp4l[1254.158]: selected local clock dca632.fffe.2481d2 as best master
ptp4l[1254.158]: port 1: assuming the grand master role
ptp4l[1254.556]: port 2: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
ptp4l[1254.557]: selected local clock dca632.fffe.2481d2 as best master
ptp4l[1254.557]: port 1: assuming the grand master role
ptp4l[1254.557]: port 2: assuming the grand master role

Then i launched the aes67 sender - i have a usb audio card connected

sudo node aes67 -v -d 2 -c 2 -n test --address 192.168.0.100

_RtApiPulse::DeviceInfo pa_context_connect() failed: Connection refused

Selected ALSA as audio api

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (default), No such file or directory.

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (hw:2,0), No such device.

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (hw:3,0), No such device.

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (default), No such file or directory.

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (hw:2,0), No such device.

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (hw:3,0), No such device.

Selected device hw:ICUSBAUDIO7D,0 with 2 input channels
Selected 239.69.0.100 as RTP multicast address.
Opening audio stream.

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (default), No such file or directory.

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (hw:2,0), No such device.

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (hw:3,0), No such device.

Trying to sync to PTP master.
Could not sync to PTP master. Aborting._

Any suggestions or how to combine these 2 programs?

Run aes67-sender without PTP Master

It is currently not possible to run aes67-sender without PTP master. RFC7273 allows to implement a ts-refclk:ptp=traceable which could be implemented to use aes67-sender without a PTP master.

Error installing on RPi 2b

When running

npm install

on raspberry pi 2b, I get this error message:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>= 14.15.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm ERR! code 1
npm ERR! path /home/pkcubed/aes67-sender/node_modules/audify
npm ERR! command failed
npm ERR! command sh -c prebuild-install || npm run rebuild
npm ERR! > [email protected] rebuild
npm ERR! > cmake-js compile
npm ERR! prebuild-install warn install /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.32' not found (required by /home/pkcubed/aes67-sender/node_modules/audify/build/Release/audify.node)
npm ERR! /home/pkcubed/aes67-sender/node_modules/cmake-js/lib/buildSystem.js:15
npm ERR!         return !!projectPkgJson?.binary?.napi_versions
npm ERR!                                 ^
npm ERR! 
npm ERR! SyntaxError: Unexpected token '.'
npm ERR!     at wrapSafe (internal/modules/cjs/loader.js:915:16)
npm ERR!     at Module._compile (internal/modules/cjs/loader.js:963:27)
npm ERR!     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR!     at Module.load (internal/modules/cjs/loader.js:863:32)
npm ERR!     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR!     at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR!     at require (internal/modules/cjs/helpers.js:74:18)
npm ERR!     at Object.<anonymous> (/home/pkcubed/aes67-sender/node_modules/cmake-js/lib/index.js:4:18)
npm ERR!     at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR!     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /home/pkcubed/aes67-sender/node_modules/audify
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c cmake-js compile
npm ERR! 
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /home/pkcubed/.npm/_logs/2023-10-06T02_08_45_884Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pkcubed/.npm/_logs/2023-10-06T02_08_47_944Z-debug.log

No callback with JACK api

Hi,

I'm having some trouble with aes67-sender and JACK. When using ALSA everything seems to be working ok, but with JACK i get no audio callback in the code. I've inserted a log row in audio callback and there is nothing coming in. There is sound in jack 'cables', I've attached a VU meter using Carla and it seems fine. See log:

~/aes67-sender$ authbind --deep node aes67 -v -a jack -d 1 -c 2 -n "syshar"
Selected Jack as audio api
Selected 192.168.5.152 as network interface
Selected device shairport-sync with 2 input channels
Selected 239.69.5.152 as RTP multicast address.
Opening audio stream.
Trying to sync to PTP master.
Synced to b8-27-eb-ff-fe-4c-81-29:0 successfully
Starting SAP annoucements and audio stream.

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.