[MTCB Android Head Units Q&A] phorton2:
Pure Perl DLNA Server running in Ubuntu on Eonon G2110

I'm not sure if this post is on-topic or not, but if you're like me, and you happen to be searching for any shred of information about the Eonon G2110 Android 4.2 double din head unit, then you may want to see my post, which I wrote n Facebook, but a friend put on Reddit:

I learned a bit about this unit. Happy to answer any questions I can.

Hmm, forum won let me post a link to the reddit page. So here's the text, edited for context. Photos available at an unpostable webpage.

-----------------------------------------------------------------------------------------------------

I wrote a Pure Perl DLNA server on Windows, and run it in Perl in Ubuntu on my Android car stereo. It is also a DLNA control point and serves up a Chrome Packaged App that acts as the UI to the car stereo . This combination gives me unprecedented control over the entire organization and presentation of my music library.

———————————————–

So, here’s the latest project I’ve been slaving over. I got interested in Androids last year when I bought a little usb dongle that had a 1.72Ghz quad core processor, 1G RAM, 8G of SDRAM, HDMI, Wifi and Bluetooth, running Android 4.2 … I mean really this thing cost like $60 then ($25 now) and is just slightly bigger than a USB memory stick. I was replacing my defunct laptop anyways, so decided to pick up one of these dongles from ebay fun. I also got an $100 10.1” Android Chinese tablet.

I’m stilling writing PERL. Gobs of it. Mountains, streams, and rivers, with not the odd puddle or two.

Found a pure perl DLNA server that served as a starting point. The thing has been re-written 3 times since then, and I have gone to some weird places (i.e. didn’t like the available perl MP3 modules, and spent a month or two just delving into MP3 files, reading writing tags, streams, etc). The whole UPnP SSDP thing, once again, available as Perl, but you know me. How does it all work? So basically I ended up writing my own SSDP / UPnP / DLNA stuff from the socket level up. In pure Perl. Got this DLNA server working pretty good on Windows, happily serving tunes to the Android tablet, dongle, and WDTVLive.

I let Plex handle my videos, and currently my laptop is my ‘video’ server. But I have not found a DLNA server that I like with regards to music. I was used to the instant access to over 9000 songs that WinAmp provided, and drilling down thru a DLNA folder list on a touch screen is so tedious. Don’t get me wrong, I love the BubbleUPnP Android App, my main squeeze as it were, but the servers just don’t do what I want.

For my friends in the USA, please understand that I am guessing you live in a world where all your music is on the cloud and magically ordered and presented by a variety of world class tools. On the boat, everything must be local. It’s a nice restriction in some ways. In the marina, I usually get between 128 and 512Kbits. That’s right. “K” bits. And anywhere good at anchor there is no internet. So that’s my story, and I’m sticking to it.

My main boat stereo was a JVC MP3 capable in-dash CD/DVD player (hooked up to a monster 300W car stereo amp, powering 4 little 6” speakers around the boat). LOL, the stupid DVD motor span whenever it was on, buzzing, and using energy, and I had grown to hate it. So …

I got this double DIN Android 4.2 car stereo.

Chronologically, I already had Artisan running on the android by then. I did a lot of messing around with that little dongle, learning how to flash it with new OS’s, including a laborious effort to dual boot it to Ubuntu by flashing a pure Ubuntu OS. In the end, and this is key, it was fairly easy to chroot an Ubuntu from the existing running Android kernel, using an Android app called Complete Linux Installer, and custom ROMS are not needed, and considered a pain in the ass. About all I do with a new android is get root access and SSH running on it, and then do everything there. I used to use ADB extensively with new droids, but as they are so ubiquitous, I prefer to do as little as possible at low levels and rely on available high level ‘Google Store’ apps.

But Perl is mandatory.

And Perl on Android is a subject of some interest.

My solution: boot an Ubuntu (shell) on the droid and run the perl that comes with it.

So that’s what the new car stereo does. It boots Android 4.2, then mounts an ext file system with ubuntu, and as if by magic, chrooting boots up ubuntu on the existing android linux kernel. It’s weird, but cool. The ubuntu shares lots of the linux with the android, things like network routing tables, etc, are shared between the two otherwise distinct operating systems. Yet they have completely separate file systems, etc. And most importantly the ubuntu comes with Perl .. as well as all the linux stuff to manage it. I particularly like apt-get which made it super easy to install the half dozen or so extra perl modules (and their dependencies) I needed to get Artisan to run.

So, the car stereo boots up Android 4.2, then automatically starts Ubuntu and a shell, then starts my pure Perl DLNA Server … which I call ‘Artisan’ in it.

It also boots SSHDroid and FTPDroid so I can work on it from my Windows laptop, and BubbleUpNP which serves as my main music renderer.

——————————————-

ARTISAN WEB UI

So, now I could hit Artisan, running on the car stereo, from BubbleUp, also running on the car stereo. All my music is on a 128G stick attached to the car stereo (could be a hard disk, but I don’t want to spin a platter all day and night on batteries on the boat).

Since Artisan is a DLNA server, it’s also an HTTP Server. The original PDLNA (Pure Perl DLNA) had a prototype webUI, which I have taken to town.

Try to follow this. So Artisan serves up a Chrome Packaged App as a webpage. And Artisan acts as a DLNA control point, as well as a server. So that WebApp now has a full UI that controls any DLNA renderer, including BubbleUp which just happens to be running on the same android. After installing the Artisan app to the android’s homepage, we get this.

Android running Ubuntu running Pure Perl Artisan DLNA server. (the same server runs seamlessly on windows).

The Artisan server delivers a Chrome App that acts as a DLNA control point, as well as providing immediate low level access to the server, in whatever form I wish. Since it’s just a webpage, it’s also available on any machine, allowing me to administer the car-stereo database from my windows laptop, and or from the droid tablet, or my phone for that manner.

And I have complete control over the content and UI. Though at this moment I’m deep in thought about responsive design and css queries and how to restructure the whole thing again, already it’s a huge improvement over what I had before.

It takes a while. But like I said, I din’t like the store-bought DLNA servers and drilling down thru a stupid touch screen hierarchy.