sea_hawk_12
Posts: 7
Joined: Mon Dec 11, 2017 5:23 pm

Multicast Client

Mon Aug 06, 2018 5:50 pm

Hi,

I am working on a multicast client project, were the Raspberry Pi 3 Model B is the client and my Cisco switch is the server where there are multiple devices connected and subscribing to the multicast group. The Raspberry Pi is connected by Ethernet.

I’ve already written the C code on the Raspberry Pi allowing it to subscribe to the multicast audio stream via Ethernet.

The part I’m stuck on is once I am receiving multicast packets via the Ethernet port on the Raspberry Pi, how do I take these packets and output them using the onboard audio jack? Does the Pi have an audio CODEC I need to communicate with?

Any help/thoughts is much appreciated.

Thank you.

User avatar
allfox
Posts: 433
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: Multicast Client

Mon Aug 06, 2018 6:53 pm

Is there any encoding or compression with the audio stream?

If they are RAW data, you could just redirect them to aplay:

./your-program | aplay [parameter to define RAW format]

https://en.m.wikipedia.org/wiki/Aplay

sea_hawk_12
Posts: 7
Joined: Mon Dec 11, 2017 5:23 pm

Re: Multicast Client

Tue Aug 07, 2018 7:29 pm

Thanks for the reply.

As of now, no, there is no encoding or compressing of the audio stream. I am receiving packets in SDP format. I will be sure to play with aplay. I guess the question I should be asking is: can the Raspberry Pi receive audio over Ethernet?

Thank you.

mfa298
Posts: 1301
Joined: Tue Apr 22, 2014 11:18 am

Re: Multicast Client

Tue Aug 07, 2018 8:17 pm

I wonder if there's some confusion here about things.
sea_hawk_12 wrote:
Tue Aug 07, 2018 7:29 pm
As of now, no, there is no encoding or compressing of the audio stream. I am receiving packets in SDP format. I will be sure to play with aplay. I guess the question I should be asking is: can the Raspberry Pi receive audio over Ethernet?
From what I remember SDP is just a protocol that describes a multimedia stream, it doesn't contain any media (video or audio) itself.
sea_hawk_12 wrote:
Mon Aug 06, 2018 5:50 pm
I am working on a multicast client project, were the Raspberry Pi 3 Model B is the client and my Cisco switch is the server where there are multiple devices connected and subscribing to the multicast group. The Raspberry Pi is connected by Ethernet.

I’ve already written the C code on the Raspberry Pi allowing it to subscribe to the multicast audio stream via Ethernet.

The part I’m stuck on is once I am receiving multicast packets via the Ethernet port on the Raspberry Pi, how do I take these packets and output them using the onboard audio jack? Does the Pi have an audio CODEC I need to communicate with?
For media there's nothing different to using a multicast source to a unicast udp stream. Within an Layer2 Ethernet the only difference is that instead of sending to a unicast address the media source send to a multicast group. The clients will then subscribe to that same group and a suitably intellegent switch will control (via IGMP) what ports the data goes out of (if it doesn't do IGMP snooping the stream should just get sent out all ports)

In a layer 3 environment other stuff comes into play with protocols like PIM and extra devices such as RP and BSR, these are just to help support the multicast network, they don't provide any content themselves.

I'm a bit confused as to how you think the Cisco switch is the server ? It might help if you described a bit more of the setup - maybe with some diagram. If your able to share some of the (hopefully commented code) that may help others to help you.

Also as a starting point it's possible to use things like vlc and ffmpeg to act as both a multicast source and client. As a starting point it might make sense to get something working with those first then look at making your own client to receive and process the data using vlc and ffmpeg as the source.

sea_hawk_12
Posts: 7
Joined: Mon Dec 11, 2017 5:23 pm

Re: Multicast Client

Fri Aug 10, 2018 4:54 pm

Thank you mfa298 for the thorough response.

You mentioned using VLC which sparked many ideas. I have been preoccupied with learning and trying to get VLC working like you said. This is the reason for the late reply. I will get back to your questions and this post as soon as I get VLC working.

Thanks again.

sea_hawk_12
Posts: 7
Joined: Mon Dec 11, 2017 5:23 pm

Re: Multicast Client

Tue Sep 18, 2018 9:00 pm

It has been a while since I last visited this topic, but long story short, I was able to send and receive multicast data between 2 Raspberry Pi's using VLC and then with my C code. The Cisco is not a server as I stated in my original post. It just receives multicast data and outputs it to any listening port.

I am at a point where the Raspberry Pi is connected to the Cisco switch and is receiving multicast data with both VLC and or my C code running on the Pi, which is great news. The one issue and probably the last phase of this project is that I can't here any incoming audio. I hear audio when the audio is in MP3 format, but unfortunately I the audio I am working with is not in MP3 format.

I am going to make a new post with more details regarding that issue.

Return to “Networking and servers”

Who is online

Users browsing this forum: No registered users and 8 guests