GeekyCraig
Posts: 5
Joined: Sat Sep 03, 2016 3:58 pm
Location: San Francisco
Contact: Website

Seeking a solution to broadcast audio to multiple Androids

Mon Dec 12, 2016 12:43 am

I am looking to do something that seems pretty straight forward and simple, but it is turning out to be anything but. This is what I want to do. I want to broadcast live audio coming from a PlayStation 4 (or any other home entertainment system) to multiple Android devices. Essentially, I want several people to be able to hear a game, movie, or TV Show on the PS4 and giant monitor without speakers or the capability of disturbing anyone else. I was thinking of going the FM broadcast option, which is easiest, but it is becoming harder and harder to enable the FM radio receiver on Android phones. I am posting here, because I have a Raspberry Pi 3 that is already acting as a WiFi-to-WiFi router to bypass wireless isolation and enable remote play & the PS Android App, so figure I will use the Pi to do everything else. I am using Xubuntu 16.04 right now on it, since it was the easiest and quickest way of enabling the hotspot, and enabling support for a RTL8188EU USB WiFi adapter I had.

I have a lot of IT experience, as I work as an IT Network consultant, but 99% of my stuff is cloud based now, and I have never worked with streaming audio. The original idea I had, other than FM broadcasting, was to find a way of connecting multiple bluetooth headsets to the Pi, and using Android phones in place of the actual headsets. Instead of BlueTooth, it seems like it would be even easier to go IP, though I am open to the cheapest option. I want it to be a simple solution, just download an app, connect and listen. Video is completely unnecessary. I did try broadcasting remote play to a laptop and then broadcasting that audio, but I have been having issues with remote play and internal bandwidth recently, most likely limitations with the Pi Hotspot. I also tried YouTube broadcasting from the PS4 and had the same issue. I assume Twitch will also be a no-go. Real-Time streaming delay is also a big problem I need to avoid, as audio delays in a movie ruins the experience.

In terms of my environment, I am in shared workspace (tech loft/apartment dorm type thing in SF), and while I have awesome WiFi provided by Google Fibre, it has WiFi isolation as I noted, Nat 2, and EVERY port blocked, though I CAN access my internal network via a SSH tunnel between the Pi and one of my Google Cloud Servers, but I prefer to bypass the internet entirely. Also, for those unfamiliar with the PS4, it can NOT support A2DP. You can do 3.5" out of the wireless controller, USB audio works fine, such as USB speakers, can use an optical audio output, or HDMI. I do not have speakers on my monitor.

So, anyone have any ideas? I was amazed not to find a cheap ready-to-go option as it is a very useful thing to have, from public spaces to keeping a quiet household when your kids have friends over. Once I get it working, I will post a link to a ready to go image as a thank you, for anyone that wants it.

Basic flow:
(START(--[PS4]---audio line 3.5"/usb---->[Raspberry Pi 3]~~~~~wireless~~~~~~[Multiple Android Phones]------->[Headphones]-->[Ears]--(END)

Current Pi Setup:
-Raspberry Pi 3
-16 gb SDHC card
-3.5" Touch Screen LCD
-USB RTL8188EU WiFi Adapter (TL-WN725N)
-Xubuntu 16.04 Kernel 4.4.18
-Access Point enabled
-- BCM as WAN WiFI
-- RTL8188 as LAN WiFi Hotspot
-Planning on adding video streaming service to pi, such as PirateBox
"HIC SVNT DRACONES!!"

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Seeking a solution to broadcast audio to multiple Androi

Mon Dec 12, 2016 1:14 am

GeekyCraig wrote:So, anyone have any ideas? I was amazed not to find a cheap ready-to-go option as it is a very useful thing to have,
If you are driving multiple speakers or outputs that can be heard at the same time, you'll have to tightly sync everything and if there's video, you'll have to sync the sound to that so everything will need to be timed pretty tightly.

If you could cache ahead on each device and then sync that, it would probably work but this isn't trivial to build. I don't know if someone has that available to just download somewhere but it seems difficult to get right even if you are using some sort of multicast thing. You might google around that term and see if someone has something.

The FM radio idea pretty much avoids all that though since the latency is about nothing important, at least the difference in latency for each device is. The trouble I had doing that was getting a legal FM radio that would broadcast with enough gas to get to the various radios and do so cleanly and because there are so many radio stations, maybe over something else. Most of the legal hardware seems to be for use in cars without any other way to get your phone's output into the car stereo.

GeekyCraig
Posts: 5
Joined: Sat Sep 03, 2016 3:58 pm
Location: San Francisco
Contact: Website

Re: Seeking a solution to broadcast audio to multiple Androi

Mon Dec 12, 2016 1:55 am

Unfortunately, buffering audio won't work, as I am trying to sync the audio to live video on a monitor or a game, unless I could almost make a DVR type system for both. I have done more reading, and it looks like one option for me is SoundWire, it basically streams all sound from the Raspberry Pi to any Android device that has the app installed. So I could d 3.5" audio to the Pi, then SoundWire from that point. I am worried about lag, but they claim to have the lowest lag. I think another option might be UPNP Audio. Mostly, I want to have Movies and TV on the monitor, I could go without games for now. The reason I am focusing on PS4, instead of JUST using the Pi as the media player, is because I have not found a Raspberry Pi client for Playstation Vue, which is my TV service. I can watch via the web browser, but the experience is crappy. Anyone seen a Vue app on Ubuntu or Pi? They do have one for Android, actually, it is PS4 and Android only, no Windows app either.

I have not tested out Android on the Pi yet, but that could work... The only issue is that so far, my experience with Android hotspots has been very poor, and useless. I could just buy a pocket/travel wifi router, but that defeats the point of having a Pi....

Sorry for the rambling, thinking as I type, figure I might as well post it for others with the same issues (Hardware\Software\Mental) as myself :)
"HIC SVNT DRACONES!!"

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Seeking a solution to broadcast audio to multiple Androi

Mon Dec 12, 2016 6:23 am

FYI there is no official Android release for the Raspberry Pi:

https://groups.google.com/forum/m/#!forum/android-rpi
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

RpiName
Posts: 717
Joined: Sat Jul 06, 2013 3:14 am

Re: Seeking a solution to broadcast audio to multiple Androi

Mon Dec 12, 2016 1:08 pm

GeekyCraig wrote:I have a lot of IT experience, as I work as an IT Network consultant, but 99% of my stuff is cloud based now, and I have never worked with streaming audio. The original idea I had, other than FM broadcasting, was to find a way of connecting multiple bluetooth headsets to the Pi, and using Android phones in place of the actual headsets. Instead of BlueTooth, it seems like it would be even easier to go IP, though I am open to the cheapest option. I want it to be a simple solution, just download an app, connect and listen. Video is completely unnecessary. I did try broadcasting remote play to a laptop and then broadcasting that audio, but I have been having issues with remote play and internal bandwidth recently, most likely limitations with the Pi Hotspot. I also tried YouTube broadcasting from the PS4 and had the same issue. I assume Twitch will also be a no-go. Real-Time streaming delay is also a big problem I need to avoid, as audio delays in a movie ruins the experience.
See UV4L, the simplest, the most efficient, etc..:
http://linux-projects.org

Start from this:
http://www.linux-projects.org/rpi-video ... e-demo-os/

it's a 10min task provided that you read through the docs.

Return to “General discussion”