Drumfix / avb4linux

58 stars 15 forks source link

Errors during make #2

Closed Goli4thus closed 5 years ago

Goli4thus commented 5 years ago

Hi, I wanted try this AVB driver because USB is giving me issues (see here if interested: https://bugzilla.kernel.org/show_bug.cgi?id=203659).

Some background info:

What I did so far:

$ make
mkdir -p kernel-module/igb && make subdir=kernel-module/igb -C kernel-module/igb make[1]: Entering directory '/home/goli/Build/avb4linux/kernel-module/igb' make -C /lib/modules/5.1.8-1-MANJARO/build SUBDIRS=/home/goli/Build/avb4linux/kernel-module/igb modules make[2]: Entering directory '/usr/lib/modules/5.1.8-1-MANJARO/build' Makefile:205: ================= WARNING ================ Makefile:206: 'SUBDIRS' will be removed after Linux 5.3 Makefile:207: Please use 'M=' or 'KBUILD_EXTMOD' instead Makefile:208: ========================================== CC [M] /home/goli/Build/avb4linux/kernel-module/igb/igb_main.o /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:242:13: error: initialization of ‘vm_fault_t ()(struct vm_fault )’ {aka ‘unsigned int ()(struct vm_fault )’} from incompatible pointer type ‘int ()(struct vm_fault )’ [-Werror=incompatible-pointer-types] .fault = igb_vm_fault ^~~~ /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:242:13: note: (near initialization for ‘igb_mmap_ops.fault’) /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:2372:22: error: initialization of ‘u16 ()(struct net_device , struct sk_buff , struct net_device , u16 ()(struct net_device , struct sk_buff , struct net_device ))’ {aka ‘short unsigned int ()(struct net_device , struct sk_buff , struct net_device , short unsigned int ()(struct net_device , struct sk_buff , struct net_device ))’} from incompatible pointer type ‘u16 ()(struct net_device , struct sk_buff , void , u16 ()(struct net_device , struct sk_buff , struct net_device ))’ {aka ‘short unsigned int ()(struct net_device , struct sk_buff , void , short unsigned int ()(struct net_device , struct sk_buff , struct net_device ))’} [-Werror=incompatible-pointer-types] .ndo_select_queue = igb_select_queue, ^~~~ /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:2372:22: note: (near initialization for ‘igb_netdev_ops.ndo_select_queue’) /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:2406:18: error: initialization of ‘int ()(struct ndmsg , struct nlattr , struct net_device , const unsigned char , u16, u16, struct netlink_ext_ack )’ {aka ‘int ()(struct ndmsg *, struct nlattr *, struct net_device , const unsigned char , short unsigned int, short unsigned int, struct netlink_ext_ack )’} from incompatible pointer type ‘int ()(struct ndmsg , struct nlattr , struct net_device , const unsigned char , u16, u16)’ {aka ‘int ()(struct ndmsg , struct nlattr , struct net_device , const unsigned char , short unsigned int, short unsigned int)’} [-Werror=incompatible-pointer-types] .ndo_fdb_add = igb_ndo_fdb_add, ^~~~~~~ /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:2406:18: note: (near initialization for ‘igb_netdev_ops.ndo_fdb_add’) /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:2412:24: error: initialization of ‘int ()(struct net_device , struct nlmsghdr , u16, struct netlink_ext_ack )’ {aka ‘int ()(struct net_device , struct nlmsghdr , short unsigned int, struct netlink_ext_ack )’} from incompatible pointer type ‘int ()(struct net_device , struct nlmsghdr , u16)’ {aka ‘int ()(struct net_device , struct nlmsghdr , short unsigned int)’} [-Werror=incompatible-pointer-types] .ndo_bridge_setlink = igb_ndo_bridge_setlink, ^~~~~~ /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:2412:24: note: (near initialization for ‘igb_netdev_ops.ndo_bridge_setlink’) cc1: some warnings being treated as errors make[3]: ** [scripts/Makefile.build:276: /home/goli/Build/avb4linux/kernel-module/igb/igb_main.o] Error 1 make[2]: [Makefile:1571: module/home/goli/Build/avb4linux/kernel-module/igb] Error 2 make[2]: Leaving directory '/usr/lib/modules/5.1.8-1-MANJARO/build' make[1]: [Makefile:264: default] Error 2 make[1]: Leaving directory '/home/goli/Build/avb4linux/kernel-module/igb' make: [Makefile:31: igb] Error 2

Any ideas on how to suppress these if not critical?

Drumfix commented 5 years ago

Can you update and try again?

Goli4thus commented 5 years ago

Pulled changes, but I'm getting the following now:

$ make mkdir -p kernel-module/igb && make subdir=kernel-module/igb -C kernel-module/igb make[1]: Entering directory '/home/goli/Build/avb4linux/kernel-module/igb' make -C /lib/modules/5.1.8-1-MANJARO/build SUBDIRS=/home/goli/Build/avb4linux/kernel-module/igb modules make[2]: Entering directory '/usr/lib/modules/5.1.8-1-MANJARO/build' Makefile:205: ================= WARNING ================ Makefile:206: 'SUBDIRS' will be removed after Linux 5.3 Makefile:207: Please use 'M=' or 'KBUILD_EXTMOD' instead Makefile:208: ========================================== CC [M] /home/goli/Build/avb4linux/kernel-module/igb/igb_main.o /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:2385:22: error: initialization of ‘u16 ()(struct net_device , struct sk_buff , struct net_device , u16 ()(struct net_device , struct sk_buff , struct net_device ))’ {aka ‘short unsigned int ()(struct net_device , struct sk_buff , struct net_device , short unsigned int ()(struct net_device , struct sk_buff , struct net_device ))’} from incompatible pointer type ‘u16 ()(struct net_device , struct sk_buff , void , u16 ()(struct net_device , struct sk_buff , struct net_device ))’ {aka ‘short unsigned int ()(struct net_device , struct sk_buff , void , short unsigned int ()(struct net_device , struct sk_buff , struct net_device ))’} [-Werror=incompatible-pointer-types] .ndo_select_queue = igb_select_queue, ^~~~ /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:2385:22: note: (near initialization for ‘igb_netdev_ops.ndo_select_queue’) /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:5813:12: error: conflicting types for ‘igb_select_queue’ static u16 igb_select_queue(struct net_device dev, struct sk_buff skb, ^~~~ /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:141:12: note: previous declaration of ‘igb_select_queue’ was here static u16 igb_select_queue(struct net_device dev, struct sk_buff skb, ^~~~ /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:141:12: warning: ‘igb_select_queue’ used but never defined /home/goli/Build/avb4linux/kernel-module/igb/igb_main.c:5813:12: warning: ‘igb_select_queue’ defined but not used [-Wunused-function] static u16 igb_select_queue(struct net_device dev, struct sk_buff skb, ^~~~ cc1: some warnings being treated as errors make[3]: [scripts/Makefile.build:276: /home/goli/Build/avb4linux/kernel-module/igb/igb_main.o] Error 1 make[2]: [Makefile:1571: module/home/goli/Build/avb4linux/kernel-module/igb] Error 2 make[2]: Leaving directory '/usr/lib/modules/5.1.8-1-MANJARO/build' make[1]: [Makefile:264: default] Error 2 make[1]: Leaving directory '/home/goli/Build/avb4linux/kernel-module/igb' make: [Makefile:31: igb] Error 2

Drumfix commented 5 years ago

one more try ...

Goli4thus commented 5 years ago

Thanks, now it's compiling fine. Once installed I tried to run it and get some playback going. But I see no sound coming in at the AVB channels within the Motu Web routing view.

I get the following output: $ sudo avb_up.sh enp8s0 44100 rmmod: ERROR: Module igb is not currently loaded rmmod: ERROR: Module igb_avb is not currently loaded driver: igb_avb version: 5.3.2_AVB firmware-version: 3.16, 0x8000068f expansion-rom-version: bus-info: 0000:08:00.0 supports-statistics: yes supports-test: yes supports-eeprom-access: yes supports-register-dump: yes supports-priv-flags: no Starting daemons on enp8s0 INFO : GPTP [20:16:35:266] gPTP starting ERROR : GPTP [20:16:35:266] Using clock device: /dev/ptp0 STATUS : GPTP [20:16:35:266] Starting PDelay process_events() ERROR : GPTP [20:16:35:362] Error (TX) timestamping PDelay request, error=-72
ERROR : GPTP [20:16:36:437] Error (TX) timestamping PDelay request, error=-72
STATUS : GPTP [20:16:36:825] LINKUP STATUS : GPTP [20:16:36:825] Link Speed: 1000000 kb/sec STATUS : GPTP [20:16:37:877] AsCapable: Enabled STATUS : GPTP [20:16:38:266] *** Announce Timeout Expired - Becoming Master STATUS : GPTP [20:16:38:266] New Grandmaster "68:05:CA:FF:FE:95:B1:EB" (previous "00:00:00:00:00:00:00:00") index=8 rc = 0, mrp_register_domain rc = 0, mrp_join_vlan PARSE: C=6,P=3,V=0002

Mac: 68-05-ca-95-b1-eb PARSE: I=0002

S+L:L=0001f200c10f0000, D=2 rc = 0, done sending ready PARSE: L=0001f200c10f0000, D=2 rc = 0, advertising stream PARSE: S=6805CA95B1EB0000,A=91E0F000FE00,V=0002,Z=224,I=1,P=112,L=95 VNE 0002 R=000000000000 VN/MT

VNE 0002 R=000000000000 VN/MT unhandled from mrpd SNE L:D=2,S=0001f200c10f0000 R=000000000000 VN/MT

EVENT on STREAM ID=0001fffffff200ffffffc10f0000 with state ready got a new/join indication listener: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 listener: 0 0 0 0 0 0 SNE L:D=2,S=0001f200c10f0000 R=000000000000 VN/MT

SNE T:S=6805ca95b1eb0000,A=91e0f000fe00,V=0002,Z=224,I=1,P=112,L=95 R=000000000000 VN/MT

talker: mode 0 stream: 68 5ffffffcaffffff95ffffffb1ffffffeb 0 0 dst_mac: ffffff91ffffffe0fffffff0 0fffffffe 0 vid: 2 SNE T:S=6805ca95b1eb0000,A=91e0f000fe00,V=0002,Z=224,I=1,P=112,L=95 R=000000000000 VN/MT

SNE T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SNE T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SNE T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SNE T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

talker: mode 0 stream: 0 1fffffff2 0ffffffc1 f 0 0 dst_mac: ffffff91ffffffe0fffffff0 0ffffffe541 vid: 2 SJO T:S=0001f200c10f0000,A=91e0f000e541,V=0002,Z=224,I=1,P=112,L=95 R=0001f200c10f VO/IN

SJO D:C=6,P=3,V=0002,N=3 R=0001f200c10f AA/IN

I increased the rt-priority of "enp8s0-TxRx-1", rechecked my adaptations to 'kernel-module/igb/avb-config.h' and set 'PRESENTATION_TIME_OFFSET -250000' in reference to https://github.com/Drumfix/avb4linux/issues/1.

In cadence everything is looking fine; I selected the AVB channels, set buffer size to 144 (3*48; I'm using Reaper) and 'periods/buffer = 3'. I'm getting no Xruns so far (apart from some on starting up Reaper). I configured one input, one output AVB channel in Motu web interface and connected all the resulting 8 ins and outs to Reaper.

Any idea what I'm overlooking?

Goli4thus commented 5 years ago

Hmm, recording a microphone input actually already works fine for me. So it seems to be about playback. Looking at my output (see above) and the one from https://github.com/Drumfix/avb4linux/issues/1 it seems like I'm missing the "listener"-sections (I assume 'talker' means 'Motu talks to PC' and 'listener' means 'Motu listens for PC').

Drumfix commented 5 years ago

Did you forget to edit the avb_config.h file again after doing the update?

Goli4thus commented 5 years ago

I actually did my local adaptions in a separate branch. I did pull your commits in 'master' and rebased my changes onto it.

Nevertheless I just rechecked the adaptations. Here's how I interpreted the wireshark part: Imgur

Did I get it wrong from the start?

Other questions:

  1. Can network management interfere in some way? (I've set up bridging of my two ethernet cards to still be able to access the Motu interface with a web browser).
  2. How can I my ethernet card used by this driver to show up as a device after I've called 'avb_down.sh '? (running 'ifconfig enp8s0 up' just gives me "enp8s0: ERROR while getting interface flags: No such device")
Drumfix commented 5 years ago

You got it right.

I wonder why the Motu is not responding to our connect tx request. Maybe we need to send the entity available message first. Need to update the avb_user program for that.

You need bridging of the network cards only, if you want to use the browser from an external device (e.g. tablet). You can access the Motu via web browser just fine from the computer you are connected to. Network management shouldn't interfere too much, and the tx/rx queues used for streaming have the highest priority anyway. Btw you can overwrite the kernel supplied igb driver with the igb_avb driver and use the latter as your default (and remove the modprobe/rmmod parts from the avb_up.sh/avb_down.sh scripts).

Drumfix commented 5 years ago

One thing comes to mind. The driver currently does not set the samplerate itself. Do you have the same samplerate set in the interface as you give to avb_up.sh?

Goli4thus commented 5 years ago

Most certainly I made sure the sample rate matches (I used 44100 Hz), because I always do the same when using the interface via USB.

Furthermore wouldn't I see xruns in Cadence in case of mismatching sample rates? Or wouldn't I hear noticeable artifacts when recording a microphone (which I successfully was able to do as mentioned above)?

Drumfix commented 5 years ago

Made an update so the samplerate of the interface is set to the sample rate suppied to the avb_up.sh command and also made sure that the samplerates reported by the streams match. Please update.

Goli4thus commented 5 years ago

Thanks for the updates! I've pulled your changes, but sadly no change for the better on my end. I tried both 44100 Hz and 48000 Hz (and made sure the interface displays the sample rate I'm expecting). I tried buffersize 144/3 and 96/2. Furthermore tried setting 'PRESENTATION_TIME_OFFSET' to 0. But I still get the same behaviour: I can record audio via an AVB stream, but I can't play any audio back as nothing seems to reach the Motu interface on the AVB stream according to its routing view. The output of 'avb_up.sh' still shows only 'talker' but no 'listener' as well.

Any other settings I might have wrong? Cadence The Routing is looking good to me though (the 8 AVB streams are auto detected).

Anything else I could provide? JSON dump of Motu interface? Additional debug output that could be enabled in the AVB driver?

Drumfix commented 5 years ago

Can you make screenshots of the the device tab and routing tab in the Motu webinterface. Also a wireshark recording for the first 30 seconds after the avb-user program has been launched could be helpful. For this, comment out the line starting the avb-user program in the avb_up.sh, den start the script, start the recording of the i210 and then start the avb-user command.

Goli4thus commented 5 years ago

Regarding the wireshark capture:

  1. start script without avb-user line
  2. start wireshark
  3. start avb-user manually
  4. connect with Cadence (couple seconds delay to 3.)
Drumfix commented 5 years ago

The wireshark recording shows that none of the 1722.1 messages sent by the motu are received by the avb-user program. It seems that every packet that is coming from the motu is forwarded to the bridged network without a chance by the avb-user program to receive it. This doesn't apply to the packets containing streaming data from the motu, because they are filtered by the avb_igb kernel module before they reach the kernel's network stack.

Drumfix commented 5 years ago

Please update to latest version.

Goli4thus commented 5 years ago

Good and bad news:

The Good

You were right on the bridge being the culprit. I've deleted the whole bridge configuration, let network manager autodetect my main NIC of the mainboard (not the I210) to get internet working. Now I got the listener entry in the _avbup.sh output and actually could do playback using a simple audio file (using mpv). (Note: This already worked on Monday before commit 6609c03.)

Today I tried again just now with the latest commit. I started Reaper, which gave me loud cracks during startup (due to xruns I get when loading larger projects; usually with LinVst; these Xruns so far did not cause loud cracks when using USB) and a lot of constant light crackling during playback in Reaper (jack buffer settings: 144/3; usually on 128/3 with USB with same Reaper project).

I remembered your hints here and gave them a try.

This eventually gave me seemingly (tested 15 minutes or so) crackling free playback of a Reaper project.

Regarding _PRESENTATION_TIMEOFFSET: Was here meant positive 250us offset? Are positive offsets even possible in this context or is 0 the upper limit? Does _PRESENTATION_TIMEOFFSET have a direct influence on latency?

The Bad

I can no longer access the Motu Web App. Here you mentioned:

You need bridging of the network cards only, if you want to use the browser from an external device (e.g. tablet). You can access the Motu via web browser just fine from the computer you are connected to.

Well somehow this isn't the case for me and never was, which is why I set up the bridge to begin with as I remember.

NetworkManager doesn't seem to be able to auto configure the NIC (probably due to it not actually being connect to the LAN but just the Motu, which makes getting an internet connection going impossible ?).

With _avbup.sh running:

It looks to me that I specifically need to configure the NIC. I tried to read up on it (i.e. here and here), but I guess I'm doing something wrong.

Did you not have to do anything on your system to have access via the I210 NIC (second NIC)?

Drumfix commented 5 years ago

Well, actually the problem with the bridge should be solved with that latest commit. Really stupid mistake. But for anything but over-the-air updating of the firmware the bridge is not needed anyway.

re 1) Yes, i mean the connections in the brown area of your screenshot. The driver expects to receive always a stream containing 8 channels. In your screen shot, only channels 1 and 2 are connected. In this case, the MOTU will send a stream with 2 channels only.

re NIC connection: You can configure the direct connection of the NIC and the MOTU with network manager by selecting IPv4-settings and select the method "link-local only". Then both the NIC and the MOTU acquire an IPv4 address from the 169.x.x.x block. This takes around 30 seconds from when the link is up. After the time has expired you can connect the browser using the IPv4 address shown by the MOTU when you push the ID button.

re 2) provided that this is the TxRx-1 irq then the setting is correct.

re 3) The presentation time in AVB is set by a talker and contains the PTP time at which a receiving listener should play the samples sent in the related ethernet packet. My driver takes the presentation time sent in the packet by the MOTU, adds the PRESENTATION_TIME_OFFSET and uses the resulting value as presentation time for its own output packet. So a negative value reduces the time, a positive value increases it. If the time is too short, the MOTU will not be able to play the samples in time and start to drop them, resulting in the crackling you hear. So starting from 0 is good.

My recommended buffer size is multiples of 48 with 2 buffers. 48 is my standard setting, regardless of the samplerate i choose.

Goli4thus commented 5 years ago

Well, actually the problem with the bridge should be solved with that latest commit. Really stupid mistake. But for anything but over-the-air updating of the firmware the bridge is not needed anyway.

Yeah I agree, a bridge isn't needed as long as I have access to the Motu web interface in some other way. It was just the first thing that worked for me back then to get access.

re 1) Yes, i mean the connections in the brown area of your screenshot. The driver expects to receive always a stream containing 8 channels. In your screen shot, only channels 1 and 2 are connected. In this case, the MOTU will send a stream with 2 channels only.

re NIC connection: You can configure the direct connection of the NIC and the MOTU with network manager by selecting IPv4-settings and select the method "link-local only". Then both the NIC and the MOTU acquire an IPv4 address from the 169.x.x.x block. This takes around 30 seconds from when the link is up. After the time has expired you can connect the browser using the IPv4 address shown by the MOTU when you push the ID button.

Alright that "link-local only" setting did the trick! Now I have access to the web interface once again and I added the missing connections.

re 2) provided that this is the TxRx-1 irq then the setting is correct.

Yeah, I search via cat /proc/interrupts and set the realtime priority via sudo chrt -f -p 95 $(pgrep irq/52-enp8s0-T).

re 3) The presentation time in AVB is set by a talker and contains the PTP time at which a receiving listener should play the samples sent in the related ethernet packet. My driver takes the presentation time sent in the packet by the MOTU, adds the PRESENTATION_TIME_OFFSET and uses the resulting value as presentation time for its own output packet. So a negative value reduces the time, a positive value increases it. If the time is too short, the MOTU will not be able to play the samples in time and start to drop them, resulting in the crackling you hear. So starting from 0 is good.

So if I understand correctly having a negative offset would indeed lower the round-trip latency (i.e. in case of monitor back a live played instrument), but it just depends on the particular Motu interface model whether it can handle it. So nothing wrong with sticking with 0 in my case.

My recommended buffer size is multiples of 48 with 2 buffers. 48 is my standard setting, regardless of the samplerate i choose.

Ok, I will experiment with 2 buffers and multiples of 48.

So now I think we've finally reached a point at which your driver works for me! ;) I've disconnect the USB connection between Motu interface and my PC, set the Inputs/Outputs (the non AVB ones) to their minimum (2) in the Motu web interface and removed any routing associated with them (in hopes of reducing unnecessary dsp load).

One last thing: You mentioned here that:

Btw you can overwrite the kernel supplied igb driver with the igb_avb driver and use the latter as your default (and remove the modprobe/rmmod parts from the avb_up.sh/avb_down.sh scripts).

_igbavb.ko is located in /root/.avb/. The default igb driver is in /usr/lib/modules/5.1.16-1-MANJARO/kernel/drivers/net/ethernet/intel/igb/igb.ko.xz (for that particular kernel). 1) Did you mean to rename _igbavb.ko to igb.ko and overwrite the default one for each kernel manually? Irregardless if this actually makes sense, is there a more kernel update robust way (i.e. something along the lines of blacklisting via /etc/modprobe.d/)? 2) Re _avb_up / avbdown scripts: Removing only the "igb" related modprobe/rmmod commands or all (including the ones for _i2c_algobit and ptp)? 3) How would one pass or change the sample rate parameter to the igb_avb driver without the script?

Drumfix commented 5 years ago

After thinking again it is probably easier to keep the starting/stopping as is for the moment. :) One last note: If you want to change the samplerate you need to do a cycle

avb_up.sh avb_down.sh avb_up.sh

This is because on the first avb_up the device will change its samplerate, but the avb-user program does not do the necessary disconnect/reconnect of the streams yet.

Goli4thus commented 5 years ago

Ok that's fine.

Just did some recording with guitarix and got some message along the lines of "buffer setting isn't a multiple of 2; convolver won't work" (due to buffersize of 96). Going with 128 works for guitarix, but what's the rationale behind your recommendation of using a multiple of 48 with Reaper (or multiples of 6 in general)?

Drumfix commented 5 years ago

AVB, like USB and Firewire sends 1 packet per stream every 125 microseconds, so 8000 packets per seconds with 6 samples per channel each when at 48kHz. At 44.1kHz the MOTU uses a non-AVB compliant 136 microsecond interval, so that again it is sending 6 samples per its interval. Reaper processes data in 16 samples packets internally, so the 3*16 = 48 is the buffersize that best matches with 8*6 = 48 from the AVB packets.

For running guitarix at 48 samples with a working convolver both guitarix and the related libzita-convolver require a patch. That patch is not publicly available yet.

Since your initial issue seems to be solved now, i close the issue now.

Goli4thus commented 5 years ago

Thanks for the explanations and your patience while working this issue out! (and sorry for dragging this issue off topic at the end)