Sign up here and you can log into the forum!

In-car player - need for automatic playback function

Discussion, features, plugins--everything about zoster's UMSP UPnP Media Server software

In-car player - need for automatic playback function   

Postby thebigbadwolfguy » Thu Jul 18, 2013 10:37 pm

Hi there,

tl;dr
need for a plugin to remember the actual playing track and position, and then when device got bootet next time, it should start from that moment.

Long version:
I just realized that WD TV gen. 1 would be a great in-car media player.
So I've got the original TV screen, additional amplifiers to have better sound and of course three RCA connectors for audio and video signal.
I've tried with an iPhone and it works great, but later on I thought, that better as an mobile phone would be stationery player without any moveable parts, cables and problems with battery, connecting/disconnecting every time, blocking, unblocking the screen and looking while driving to change to another song and so on.
So the WD TV fits perfect here. It is powered by 12V mains, has RCA connection, has hadrware remote control, USB (is better than syncing an iPhone with iTunes every time you want new tracks added), can drive a small 2,5 inch 160GB USB drive..

So everything is pretty set up.
The only things remaining is "how to automatically stop playback when you get out the car?" and "how to continue playback from the last position?"
So I thougt again (sish!) that it would be a great plugin/feature to have some background process that writes every, say, 30 seconds the actual function (menu position i.e. audio, movies..), status (stopped, pause, playing) and of course position in track. And then when booting up the WD TV, the same plugin reads it's previously written file and switches to that place and position. Simple; handsfree; awesome. Why 30 second? Could be also 5 seconds, but it does not matter much, when you have to hear or watch last 1-30 (depends on the ticking marker) seconds of your favourite song or movie again. Great, huh?

Yeah, but I am not a programmer. I've barely done my previous skinning project to fit in 4:3 small in-car TV screen. There was many to do with virtual linux box, with vi editor and endles mounting and umountig the image and trying if it works. But it worked in the end as I wanted :-)


So, are there any ready to use plugins, or maybe.. you know, somebody, who could quickly wirte such plugin, or at least give some advices? Maybe some cron job and some shell script? Will it blend? How to force the player to play without pressing any remote controll buttons?

Thank you for reading (an hopefully for any help).


P.S. I would love to share with you with my in-car setup, how it's made, show some pictures of that system working, etc.
thebigbadwolfguy
n00b
 
Posts: 17
Joined: Wed Mar 28, 2012 4:53 am
Location: Poland

Re: In-car player - need for automatic playback function   

Postby thebigbadwolfguy » Tue Jul 23, 2013 12:00 am

Yeah, I am starting today to project some schematic for specialized power supply unit to have the power automatic turned on and off in all-day's situations.

The main goals of that supply unit are:
#1 turn off power after 1 minute when key is beeing removed or set in position 0 (1 min to avoid booting everytime while starting/stopping the engine)
#2 turn off power after 20 minutes when key is inserted or in position 1 (normally any stock radio plays then)
#3 turn on power after 5 seconds when the key is in pos 1 (play radio) or 2 (ignition) - avoid turning on while starting the engine
#4 have small spare 12V battery to minimize voltage drops when starting the engine (i.e. playing on #2 or #3 and then starting the engine)
#5 have everything set up so, that the physical disconnection of the supply unit and spare battery is done after those 20 minutes (#2) to avoid shortcuts and other unusual situations when the car is sleeping (fire risk and so on..)
#6 ..and of course secured by fuse
thebigbadwolfguy
n00b
 
Posts: 17
Joined: Wed Mar 28, 2012 4:53 am
Location: Poland

Re: In-car player - need for automatic playback function   

Postby mad_ady » Tue Jul 23, 2013 4:46 am

It can be done with some shell scripting, but you'd probably have to get your hands dirty - I'm not sure you'll find people to do it for you.
I'm not sure all the bits and pieces are there for the gen1, but you should take a look at some app.bins that do video playback (e.g. videoscreensaver.app.bin) and see what they do and adapt their code for your setup.

Basically, the script is an infinite loop that checks the device's status (e.g. - playing) and when it's not playing it starts a specific video playback. You'd need to get the status, get the current played media and save it to persistent storage periodically (and maybe running sync afterwards). On bootup you should read that file and play it. Problem is - what happens after the file has played? The player will go back to the OSD by default. For advanced features you'd have to implement some sort of playlist management (it might have been done in other projects).

My advice, if you are not scared of the shell take a look at such an app.bin and try to take it apart and learn how it works. Make the necessary changes and test often and you will get your result, plus you will have learned something new!

By the way, once you get done with the schematics/testing of your power supply rig, you should share it with us/others. Might benefit others too.
User avatar
mad_ady
Developer
 
Posts: 4561
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania


Return to UMSP Media Server

Who is online

Users browsing this forum: No registered users and 3 guests

cron