Coder Social home page Coder Social logo

mai's People

Contributors

markmcconnell 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

Watchers

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

mai's Issues

[ERROR] mai_rtp_init could not open multicast socket

Is there any way to get more information in debug mode? Right now it is unclear why a multicast socket is not created:

sudo mai -i eth0 -m recv -a 239.1.4.1:3000 -s sess1 -b 16 -r 48000 -c 2 -p 1000 -v

[DEBUG] mai_ptp_init PTP Domain: 224.0.1.129 (0)
[ERROR] sock_recv multicast address (239.1.4.1:3000): Success.
[ERROR] mai_rtp_init could not open multicast socket

regular user not able to initialize

Many thx for the quick fix #4
I still have to comment out -Werror, btw., otherwise ‘ptime’ may be used uninitialized in this function.

Anyway, now that I can run it, I stumble over the problem, that only root can use it. As a normal user I get:
[ERROR] sock_recv bind: Permission denied
[ERROR] mai_ptp_init could not open PTP event socket

Tested under Debian and Arch.

It seem that setting up multicast is the issue. AFAIK jack itself is doing that, when used over the network, which I am doing, so there must be a simple way, I just don't find it.
root is not a safe option for firing up an entire audio environment, so I wonder, what I am missing.

If there is a simple solution it would be very helpful to find that under getting started in the README.

error : could not connect to jack server.

sudo ./mai -m r -a 239.69.170.132 -i ens33 -s u_audio -t aes7 -b 24 -r 48000 -c 2 -p 1000 -v
[DEBUG] mai_ptp_init PTP Domain: 224.0.1.129 (0)
[DEBUG] mai_rtp_init RTP Receiver: 239.69.170.132:5004
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
[ERROR] mai_jack_init could not connect to jack server.

How to solve this problem ?thanks

Unstable initial PTP source

First of all, thanks for making this package! This is one of very few packages I've found that demonstrates proper PTP-synced and SDP-broadcasted AES67 stream generation that also seem to work with my Dante-enabled speaker.

I have both a Dante mic (normally the leader) and a Dante speaker (both AVIO adapters) on my local network. When I start up your package, within a few seconds, a weird back-and-forth oscillation between the two devices begins as your PTP clock alternately displays each of my devices as the new PTP synchronization source only to eventually settle after a few minutes.

During this period, the latency stats in Dante controller (routing the AES67 stream to my speaker) are abysmal but are totally fine after the weird back-and-forth settles. Also, both become primary leaders until it stops as well. Lastly, the first response to a delay request only seems to happen afterward (not even in the few seconds before).

Do you know why this could be and if it might be fixable?

How is sync working?

Thx for all the quick fixes!

One (hopefully last) question remains: How is the timing actually working? To my understanding jack starts with a given backend and is synced to that backend, timing-wise, eg. the 48 kHz clock of a soundcard or a jack-master over the network.

Now I understand that AES67 relies on a clock master in the network, so I ask myself how these two clocks - which cannot be in perfect sync - are handled? Is there resampling implemented or framedropping/-inserting, or how is this taken care of. Should not the AES67 bit be a backend rather that sort of a bridge or am I just overseeing something?

Sorry if this is not actually "an issue" but a question, but I would not know where to ask it otherwise.

Segfault on Debian Bookworm

When compiling on Debian Bookworm (testing), i get it to compile, when I disable -Werror in the Makefile but I end up with a segfault and nothing else. I suspect the libraries on Bookworm are newer that the ones mai is ment to compile against.

Is there any chance of updating the sources to compile on newer systems?

packet size (232) is larger than interface mtu (0).

mai compiled successfully, now trying:

sudo ./mai -m send -a 192.168.178.31 -s "TestMAI" -b 32 -r 48000 -c 8 -p 125 -l "aes67" -u 1000 -g 1000

returns

[ERROR] mai_rtp_init packet size (232) is larger than interface mtu (0).

Quite obviously, my MTU is not 0 but 1500, as ifconfig confirms. I assume there is an issue in the code when obtaining the correct MTU.

How to actually run it though?

Hi Mark, I was able to compile it after ignoring the fallthrough warnings... but then how do I actually use it ? Any direction appreciated, thanks!

Error in sap.c

This is my first time filing an issue, so please be mercyful :).

When trying to compile on Linux ubuntu 4.18.0-17-generic #18~18.04.1-Ubuntu I got the following error:

sap.c: In function ‘sap’:
sap.c:41:20: error: this statement may fall through [-Werror=implicit-fallthrough=]
case 4000: ptime = (mai.args.rate == 44100) ? "4.35" : "4";
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sap.c:42:3: note: here
case 1000: ptime = (mai.args.rate == 44100) ? "1.09" : "1";
^~~~
sap.c:42:20: error: this statement may fall through [-Werror=implicit-fallthrough=]
case 1000: ptime = (mai.args.rate == 44100) ? "1.09" : "1";
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sap.c:43:3: note: here
case 333: ptime = (mai.args.rate == 44100) ? "0.36" : "0.33";
^~~~
sap.c:43:20: error: this statement may fall through [-Werror=implicit-fallthrough=]
case 333: ptime = (mai.args.rate == 44100) ? "0.36" : "0.33";
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sap.c:44:3: note: here
case 250: ptime = (mai.args.rate == 44100) ? "0.27" : "0.25";
^~~~
sap.c:44:20: error: this statement may fall through [-Werror=implicit-fallthrough=]
case 250: ptime = (mai.args.rate == 44100) ? "0.27" : "0.25";
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sap.c:45:3: note: here
case 125: ptime = (mai.args.rate == 44100) ? "0.13" : "0.12";
^~~~
cc1: all warnings being treated as errors
: recipe for target 'sap.o' failed
make: *** [sap.o] Error 1

I got it to compile by adding brake statements like below:

  switch (mai.args.ptime) {
            case 4000: ptime = (mai.args.rate == 44100) ? "4.35" : "4"; break;
            case 1000: ptime = (mai.args.rate == 44100) ? "1.09" : "1"; break;
            case  333: ptime = (mai.args.rate == 44100) ? "0.36" : "0.33"; break;
            case  250: ptime = (mai.args.rate == 44100) ? "0.27" : "0.25"; break;
            case  125: ptime = (mai.args.rate == 44100) ? "0.13" : "0.12";

I hope this was helpful.

Unable to compile

My error is

gcc -Wall -Werror -Wextra -std=c11 -O2 -fomit-frame-pointer -march=native   -c -o audio.o audio.c
gcc -Wall -Werror -Wextra -std=c11 -O2 -fomit-frame-pointer -march=native   -c -o jack.o jack.c
gcc -Wall -Werror -Wextra -std=c11 -O2 -fomit-frame-pointer -march=native   -c -o mai.o mai.c
gcc -Wall -Werror -Wextra -std=c11 -O2 -fomit-frame-pointer -march=native   -c -o ptp.o ptp.c
gcc -Wall -Werror -Wextra -std=c11 -O2 -fomit-frame-pointer -march=native   -c -o rtp.o rtp.c
gcc -Wall -Werror -Wextra -std=c11 -O2 -fomit-frame-pointer -march=native   -c -o sap.o sap.c
sap.c: In function 'sap':
sap.c:57:13: error: 'ptime' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  payload += sprintf(payload, "a=ptime:%s\r\n", ptime);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
<builtin>: recipe for target 'sap.o' failed
make: *** [sap.o] Error 1

Using

gcc -v                                                                                                                                                          master
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-18+deb9u1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix

On Debian 9, have installed the deps listed in readme.md

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.