Avnu / libavtp

Open source implementation of Audio Video Transport Protocol (AVTP) specified in IEEE 1722-2016 spec.
BSD 3-Clause "New" or "Revised" License
62 stars 34 forks source link

can't receive AVB audio packets on some machines #32

Open MS71 opened 3 years ago

MS71 commented 3 years ago

Hi, i made a simple AVB audio listener derived from the aaf-listener.c example. This small tool is working on some machines (e.g. my RPI3).

static int new_packet(int sk_fd, int timer_fd) { ... n = recv(sk_fd, pdu, PDU_SIZE, 0); ...

On some other machines (e.g. my RPI3+), it simply doesn't receive any packets. I can solve this issue by starting a "tcpdump -i vlan.201" on a second terminal. Any idea about the reason or how i can solve that?

edersondisouza commented 3 years ago

Hi @MS71,

I'm not sure I got the point about tcpdump - do you mean that your application starts to work if you have tcpdump running alongside it? Or that tcpdump does get packets, but not your application?

How are you sending the data? Are you sending to a multicast address or specifically to some machine?

As you have it working on some machines, I'd suggest comparing some configurations - kernel version, what does ip maddress show on them, etc.

Hope that can help!

zeerd commented 1 month ago

Seems it's a problem of packet_mreq.mr_type which is PACKET_MR_MULTICAST in the example code. tcpdump changed it to PACKET_MR_PROMISC and all programs that running at the same time will benefit from it.

Any way , it's a problem of multicast, I guess. Maybe the dest-MAC-address is not a multicast address?