Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: RAMS: Remote Audio Metadata Server (and media player)  (Read 590 times)

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
RAMS: Remote Audio Metadata Server (and media player)
« on: September 14, 2017, 11:26:37 pm »

As a long time user of WinAmp, I was very disapointed when I could not get it working on Linux (via WINE), and none of the Linux based players had features that were must haves in my book.

Most people would have grumbled, and used the best thing they could find, but I was unwilling to settle for that. I wrote my own.



RAMS is made from 3 parts:
  • The interface (pictured above).
  • A player daemon.
  • RAMS itself.

Most of my complaints about existing media players revolve around two things: Difficulty of maintaining a shared library, and lack of sorting options in the interface.

RAMS is a simple creature at heart, it takes JSON queries via HTTP and returns information from an SQLite data base as more JSON. To make it easier on the interface the server also handles album art, but really this has nothing to do with its main purpose. The metadata database is self contained, if it wasn't for serving the album art (which is temporary) it wouldn't need to be acess the media library at all.

The interface is written in JS/HTML/CSS using Vue.js and a tiny bit of JQuery. Basically all it does is display data from RAMS and send instructions/display state for the player. Less than a 1000 lines of code total.

The player is also simple. It takes input by listening for mediakeys on its host and external commands via HTTP. Playback is acomplished with libVLC, the same code that powers VLC media player. External aplications can request a (JSON) dump of the player's current state via HTTP. The player gets information about where to find the actual media files from RAMS. Currently it takes portable paths, and uses them to load media from a SMB share, but it would be easy to change it to load from a streaming server or something.

This setup acheves most of my goals, and the ones it misses are just a bit of work away!

Features:
  • Centralized media library shared by all computers on the network.
  • You can copy the media library onto a single computer for trips and such without any real effort.
  • You can sort albums, artists, and tracks by many different criteria, many more han most players offer.
  • You can run each part on different machines, for example the player can run on a HTPC, RAMS on the NAS with the music, and the interface on a tablet.
  • If I don't like something, I can change it. Particularly easy since the whole thing is less than 5000 SLOC.
  • In therory each part can run on Linux, Windows, and OSX without modification (I haven't tested on all platforms).

Stuff that Sucks:
  • The UI is kinda ugly.
  • Album art can only be loaded from loose files right now, I need to make album art the job of the player daemon.
  • The player in particular has losts of places where I crash if it hits an error instead of recovering properly.
  • Each part is currently configured by editing variables at the top of each part's main file and rebuilding. This is obviously unaceptable.

All in all this was (and is) a fun project. It will probably keep me busy for some time yet, but it has reached the point where all the basics work, so I decided to share.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS