For the PlayerZ
Well i've been stuck in the house for various reasons so i've been doing a lot of solid work on the audio player software for the mele box.
It's not feature complete but it all works:
Removable drives are automatically detected and mounted or unmounted if they contain filesystems. They are mounted read-only via their UUID. This is implemented only using kernel calls and libblkid.
Detected drives are scanned and media files are indexed into a persistent database. Arbitrary trees on the filesystem can also be indexed.
Multiple secondary indices are genereated including title and author.
Deleted, changed, or added files are updated properly when they are scanned.
Various relational database constraints are implemented - albeit manually.
The music player supports all the basic features like pause, volume, mute, fast-forward, rewind, next and previous file.
It can be controlled via the Mele airmouse.
It's somewhat robust to media being removed while in use. I've already hit a bug in the kernel so it may be the limiting factor here.
Scalable, space, and time efficient algorithms are used throughout.
It's about 2KLOC of plain C and a couple of libraries.
It is already or is very close to 'valgrind clean'.
I'm using posix message queues for communicating between the processes with a simple C struct serialisation mechanism. I'm not using threads as yet, the player just runs as a single thread. This means it can block while reading from libavformat but it greatly simplifies the player logic.
At the moment i'm just running it on my 'workstation' so I don't know how much work - if any - will be required to get it going on the mele, or how it will handle the processes and so on. For example if the disk indexer will overload the cpu or i/o.
Anyway here is a high-level diagram of the processes and various bits that make it up. Sorry it's a bit shit, but well, openoffice draw is a fucking headache to work with.
For it to be feature complete there isn't much left. Some sort of playlist mechanism and/or other ways to navigate the files beyond disk+file-path order. Shuffle should be easy. Network streams would be nice.
With no user interface beyond 2 leds (and given they're in the same hole that just means 2 colours) it can't get too complicated without resorting to an additional service for external maniplation. But that is of course possible.
The things I want to look at are playlists and other ways to navigate the files (other than file-path order), and network streams.
Bored as Fuck
Haven't left the house for a full week at this point. I was sick for a few days but now i'm just miserable for other reasons. This stuff is keeping me well occupied but yeah it's kind of pointless. Even my knees fucking hurt.
I'm wondering whether i should just go back to work early since there's still a couple of weeks before I would otherwise. I don't think I could face it though.
I'm also a bit pissed off that I think I drowned and killed a chilli plant i've been growing for weeks just as it started to kick into gear. We had a couple of hot days and i overwatered it i think. Actually not much is growing very well this year and I can't seem to water it properly either. Too much or too little. Water is so expensive here.
Oh, I also wasted a couple of hours playing with yacy. The idea of decentralised internet services certainly appeals. But it was just slow and provided almost no relevant results to any search I tried - it just didn't work for me. Solr/Lucene just does a weighted sub-string index which isn't very sophisticated. It's also configured for some big server so running it on this little vps was difficult even after fighting with the complex configuration system.
I'm not eating much at least so maybe i can lose some of the weight I keep putting on.