Blog

Gravatar

Bluetooth MP3 player for my Motorbike

Feb 16

Written by: Ilpo Juvander
2/16/2014 6:32 PM  RssIcon

For the past years I have been using my navigator as a MP3 player, but I have now listened so many times all of my MP3 songs that it was time for a new solution.

After searching I found my self looking into Google Music service and it’s offline capabilities. I will need to use this in offline mode in order to save data connection costs for trips outside of Finland.

Next was to find proper hardware for it with following:

  • minimum of 64GB free storage
  • WLAN and bluetooth

Android devices with proper amount of memory are hard to find and those which would have Android 4.2 or newer with support for sdxc memory card even harder. Android 4.2 is important to have as Google Music supports storing of it’s offline files into memory card in that version forward.

One option would have been Apple iPad, but would not want to carry extra cable for nothing with me just to charge it and also those devices are bigger as well.

I was trying to get MP3 files out from Google Music as well and at first it was looking all good (I do not have any usage over the band name etc. stored in the files as I don’t see them anyhow and Google is stripping all these away) only to discover that only some of the files were DRM free and most of them were not…

After thinking and researching this again for few weeks I finally started looking at my old Samsung Galaxy S2 phone and its limitations (11½GB internal storage available for files) I decided to try with that.

I found out that it would be possible to swap this folder that Google Music is using to store it’s files into another one on external memory card I was sold.

And after two days of playing with it I have now system up and running which

  • can store 64GB’s worth of music
  • boots phone when it receives power from charger
  • starts Google Music Player and starts playing music when certain Bluetooth device is connected
  • turns itself off when charger is no longer delivering power for the device

And here’s how it was all done:

All good phones need to be rooted so that one can work with it. In case of Samsung Galaxy S2, instructions for this are found in here. I just took the one with SuperSU + Busybox (which is needed later on).

For the phone to automatically turn on when it receives power original file /system/bin/playlpm need to be replaced with this version:

#!/system/bin/sh
/system/bin/reboot

File permissions etc. need to be same as on the original file. Instructions on this came from here.

In order to start Google Music playing music when it gets connected with my Bluetooth module I installed and configured Bluetooth connect & Play –app. This was the one I found working best and did not have any extra to mess with my system, it just works. It will also set the volume to the level I want.

To turn device off I already had found this little page to show how to build GPS tracker out from Android phone and it also included Halttimer application to turn off the phone X minutes after charger has been disconnected. Little rude how it does it, but works just fine.

Thing that gave me most trouble was redirecting Google Music files into external memory card.

Normal mount –command did not do the trick as after each reboot it was gone, symlink did not work either since this internal file system is fat and it does not support those…

So I needed some way of executing this mound –command on every boot and eventually I managed to do exactly that using Script Manager – SManager.

Command that I used in terminal to accomplish this was simply

mount -o bind /storage/extSdCard/com.google.android.music/ /storage/sdcard0/Android/data/com.google.android.music/

but when executing these under Script Manager it gave some permission errors and that mount command was not found… I had created script entry pretty much based on the instructions in here.

This was really weird until I found somewhere a hint to use this instead:

busybox mount -o bind /storage/extSdCard/com.google.android.music/ /storage/sdcard0/Android/data/com.google.android.music/

And it worked! After couple of reboots mount was still there!

Now I can just store this phone somewhere in my phone and pretty much forget it once I have downloaded my MP3 files into it, it does not need any SIM card either when I’m On The Road.

Only thing that is still a bit open is that I would like to pause and skip songs and for that purpose I’m trying to find Bluetooth HID remote control and this far best option seems to be Satechi Bluetooth Multi-Media Remote, still trying to find confirmation that this works with Android. At least S2 should have HID profile…

Next is some field testing in my car, I will just store this somewhere there and leave it to see how this works!