Volumio CD player

A year ago I had a vision for how I wanted to listen to my music - I love my physical records, and listening to whole albums. At the same time I want to get a backup copy, and be able to edit them. So I started coding, and the result is a now functional CD player written in Python and some C: github.com/petli/codplayer

Then I got stuck, trying to find a useful platform to run it. It had to be fanless, with wifi and USB. I tried running Linux on an Rikomagic MK802III stick, but the kernel really, really didn’t like dealing with wifi traffic at the same time as sending sound to the USB DAC. Then Volumio found me on Twitter, when I mentioned RaspyFi.

So codplayer is finally running in my living room! Really, really smoothly on a RaspberryPi B connected to a simple USB CD-ROM and my trusty old first-gen Cambridge DacMagic.

The stuff that’s not sound is a bit rough still. The shell command user interface might be a bit daunting for most people, and it needs to be hooked up to udev so it starts playing when I insert a disc. The next item on my list (after fixing the daemon support I clumsily broke a while back) is a simple little web GUI to control it. I’m going to write that in Node.js and socket.io, because I want to learn that environment. It could also be integrated into the Volumio web GUI, since the CD player status is just written to a simple JSON file, and the player daemon is controlled by sending commands over a FIFO. The next step after that is the record database administration tool. I’ll post updates here.

Yes! Let’s integrate it in the webui! This will be amazing! If you need any kind of support just ask!

wow that’s cool. :slight_smile:

It would be great to have this option…
I’m looking for simply automatic cd ripper.

Now I’ve got codplayer to run with a simple little web UI to support it. There’s even some basic installation instructions over on github.com/petli/codplayer now.

However, I ended up shutting down the standard volumio web UI since it interfered with my configuration of the system. The main frustration was that it seemed to shut down udev and overwrite /etc/rc.local. Since I’m not going to use this as an mp3 player I’m not worried about losing that functionality, and I much rather have full control of the system myself.

Sound is not perfect all the time, there are some small glitches. Next up is doing a backup and running rpi-update to see if that might improve matters. Hopefully that also gets rid of the syslog spamming by some part of the sound/DAC drivers in the kernel which means that I’m right now discarding all kern.debug messages in rsyslog.conf (after having reenabled it - I do like to know what the system is doing…)

We can work it out, disabling all checks and keep udevd alive… Let me know if you’re interested

My code is still very experimental, so I need to do more work on figuring out how to run it really well. But it would be a good topic for a thread in one of the other forums here to discuss how to structure volumio so it’s easier to tinker with it.

I’ve now documented some stuff about my system setup for codplayer here:
github.com/petli/codplayer/wiki … up-@-petli

I’d like to point out adding “options snd-usb-audio nrpacks=1” to the modprobe conf, as that got rid of the messages spamming syslog about unexpected delays on the DAC (and I just guess that was also responsible for some of the improvements in the sound playback).

I love the idea of being able to add a CD drive to play physical disks with Volumio. I have a decent size collection of cds and enjoy having the physical copy with the artwork. It would be nice to be able to ditch my clunky CD player, but retain the ability to pop a cd into the drive and listen, maybe even be able to monitor track info on an app or something similar.

Just wanted to throw out a big thumbs up for this project!

The clicks was reduced drastically when I plugged the DAC USB cable directly into one of the two USB ports on the RPi B, instead of into a USB hub. And damn, pushing the bits over USB instead of S/PDIF to the DAC improved the sound a lot! I didn’t expect that.

I never thought of codplayer as something packaged, but it starts to sound like a good idea.

There’s a web control interface that I’m now tweaking the layout and style of to make it behave nicely in a phone browser as well as an iframe:d widget in a full web GUI, but the whole design of the system is intended to allow many ways to control it. If someone builds a RPi box with physical controls and a LCD display it could also be used to control codplayer, and I’d happy get one of those boxes. :slight_smile:

An update after more hacking. I got the DAC working without any pops, and the solution is described over here:

Softwarewise the web control GUI is now at least half decent, and INSTALL.md describes how to set it up. This together with the DAC fix means that codplayer is now deployed as my CD player, retiring the DVD player I’ve used to drive the DAC until now.

I’ve started on a disc database admin web interface, but will probably not get that running well until after one or two weekends.

What about integrating it natively onto Volumio? What do you think?

Let’s see, at least this would be necessary (I assume you mean that it should be part of the web UI fully):

Configuration UI:

  • Set database location
  • Optionally initialise a new database
  • Select CD device
  • Perhaps setup usage of USB mouse as remote control (just added script for that)
  • Use same sound device as rest of volumio

Control widget:

  • Do a skinning of the the web control widget that fits into the volumio UI (I gratefully accept CSS help here. :slight_smile:

System setup:

  • Enable udev to allow disc insert/eject integration (and it is needed to handle hotplugging USB DACs too, isn’t it?)

I’m happy to support questions and with python fixes, but PHP is not my language.

My focus right now is also on the database administration web interface, followed by some features in the player that the admin interface will enable. I have intended that interface to run on the file server directly, but it could, in a pinch, also be run from the volumio box.

Small update: the admin GUI is getting somewhere, and I’ve added a photo and a conceptual drawing to help explain the system setup over on github.com/petli/codplayer/wiki … up-@-petli

If anyone is setting up this kind of system, I advise not to get a stock USB DVD reader. They are noisy, vibrates a lot, probably are bad for the disk, take a long time to get going (at least the one I had), are fiddly to fit the disc, and in general not worth the money. Get a full-size 5.25" SATA reader with a proper tray and a USB-SATA adapter instead.

High time for an update: I’ve completely refactored the player core, since the minestrone thread soup was barely in control on a constrained environment like the raspberry pi. It was no problems playing normally from start to end, but pausing and skipping between tracks was really shaky. The new core is solid and fully unittested.

This also enabled adding the first of the disc editing features. The admin GUI now allows track to be set to skipped when playing, and to insert forced pauses between tracks (e.g. after the last regular track to avoid it heading straight into bonus tracks – I’m looking at you, 90’s Ziggy Stardust CD and the deluxe edition of Dusty in Memphis).


it’s a very good idea to add an dvd player with the raspberry but i have many questions:

Is it possible to install the code for control the dvd player without ripping the cd?

How can we control the cd player? with webgui?

Later is it possible to control the player with an Iremote?

Sorry for my bad english and thanks for your opinions

codplayer is specifically designed for ripping CDs, so I don’t know how to play CDs and DVDs directly. Possibly xmbc/vlc or something like that? It might be better to start a new thread with that question, to get better answers.

codplayer, itself, is designed to allow different control mechanisms. Right now I’ve implemented a web GUI (that works well as a dashboard widget on e.g. MacOSX) and a daemon that uses a cordless mouse as a “remote”. The latter could be modified to also listen to remote keyboards, including IR remotes that show up as a USB keyboard.

My own plan is however to get a loose IR sensor and connect it to the GPIO pins, and then write a daemon that listens to the IR codes sent by my Cyrus amplifier remote. That way I can control everything with a single remote.

codplayer can now be installed much easier with pip and npm, instead of having to clone the repository. Details here:
github.com/petli/codplayer/blob … INSTALL.md

This also means that it has a version number, which I set to 0.9. Before I want to call it 1.0 the ripping process will be revamped to use a combination of cdparanoia and cdrdao, instead of just cdrdao alone as today.

codplayer just reached 1.0: pypi.python.org/pypi/codplayer/1.0

The big change that merits dropping the initial zero is the aforementioned ripping code, which has now been completely rewritten to rip in two phases: cdparanoia for the audio, and cdrdao for the TOC only. This results in better quality rips, both in terms of sound fidelity on bad disks and overall better handling of pregaps, indices, hidden tracks and all the other silly stuff that can lurk on a CD.

Not mentioned before is that codplayer can be controlled via ZeroMQ, which should make it easier to integrate into various other environments.

My next goals are now to add support for IR remotes and to show player status on an LCD display, bringing the whole thing closer to ye olde world.

Looking good. I too wanted this functionality in a music player - to play/rip CDs! Will acquaint myself with your github project…