[HOWTO] Automated CD ripping, tagging and adding to collection - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: FAQ and Guides (https://moodeaudio.org/forum/forumdisplay.php?fid=9) +--- Thread: [HOWTO] Automated CD ripping, tagging and adding to collection (/showthread.php?tid=1670) |
[HOWTO] Automated CD ripping, tagging and adding to collection - aknaggbaugh - 08-27-2019 I remember this was requested as a feature some time ago but was not considered of wide enough interest because mostly you might want to rip CDs on a separate computer. Well I built my Moode player into a 3U 19" case with the Raspberry Pi 7" touchscreen and wanted an audio source that was pretty independent of needing another computer, so I added a CD-ROM drive and set about integrating it. The idea is to be as simple as possible: without user interaction, on inserting an audio CD, rip it, tag it, add cover art, move to a sensible place on my Moode player USB storage and add to the mpd collection so it's immediately available to play from Moode's UI. For anyone else who may find this useful, here's what I did: 1. Research the optical drive, some get better results with CDParanoia than others. I went for a well regarded LiteOn unit. 2. Add a udev rule: Put the following in /etc/udev/rules.d/99-srX_change.rules Code: KERNEL=="sr[0-9]", ACTION=="change", ENV{ID_CDROM_MEDIA}=="1", ENV{ID_CDROM_MEDIA_TRACK_COUNT_AUDIO}=="[0-9]|[0-9][0-9]", RUN+="/bin/systemctl start cd-rip.service" 3. Add the systemd service. We will use a oneshot service that can be called but doesn't persist. This is needed because tasks called directly from udev that take longer than 60s get timed out. Put the following in /etc/systemd/system/cd-rip.service Code: [Unit] 4. Create the directory /home/pi/bin and add the following into abcde-rip.sh in that directory: Code: #!/bin/bash chmod 755 abcde-rip.sh 5. You need to install some stuff: sudo apt-get update sudo apt install abcde flac mkcue eject (The items you need to install may vary depending on what format you want to rip to: I'm ripping to flac.) 6. Edit /etc/abcde.conf. You only need to uncomment lines if you want to change the default. My config file is shown below and it will definitely get you going, but you may wish to tweak to taste: Code: # Personal preference, this works well for me Ensure the directory /media/cdrips exists. On my system it is a symlink to one of my USB storage devices. You can point the OUTPUTDIR somewhere else in abcde.conf but the advantage of doing it this way is that the ripping script calls mpc update on this specific location on completion so that the moode collection is automatically updated. As soon as the disk is ejected you should be able to browse to the newly ripped CD in your collection. RE: [HOWTO] Automated CD ripping, tagging and adding to collection - TheOldPresbyope - 08-27-2019 @aknaggbaugh Very clean description, but shouldn't that be "/etc/udev/rules.d/..." and not /etc/udev/udev.d/..."? Also, the script /home/pi/bin/abcde-rip.sh needs to be marked "executable". I ultimately chose to keep ripping on a desktop system with interactive control over naming, tagging, and adding coverart but abcde worked fine for me on an RPi running moOde. Your HowTo should be attractive to those who want to keep everything in one system. For my tests of abcde in moOde I bought an inexpensive LG GP65NB60 Slim Portable DVD Writer. It worked fine on the RPi4B I was using. Regards, Kent RE: [HOWTO] Automated CD ripping, tagging and adding to collection - aknaggbaugh - 08-27-2019 Yes, you're quite right about rules.d - I'll edit the main post so as not to confuse. The nice thing about handling ripping through udev is that if there is no CD player in the system or while it's not being used there's no overhead, although abcde does pull in a fair amount of dependencies. RE: [HOWTO] Automated CD ripping, tagging and adding to collection - benmcl - 07-16-2021 Thanks for that! I'm here to report that your instructions were clear enough for a linux newbie to follow with success. A did add a few minor tweaks on abcde.conf: - 'musicbrainz' wasn't assigned the correct genres for my music. So I added all the sources. Updated line: CDDBMETHOD=musicbrainz,cddb,cdtext - For some strange reasons yet to be diagnosed, the album art wasn't showing in moOde. So I removed the 'embedalbumart' and the art is now added as a separate jpg file that moOde displays. Updated line: ACTIONS=cddb,read,encode,tag,getalbumart,cue,move,clean I added this to the end of /etc/samba/smb.conf so I could manage my music collection from my desktop computer: Code: [USB] To make the directory for the ripped CDs writable, I did "sudo chmod 775 /media/cdrips" (Originally it was readable, but not writable) RE: [HOWTO] Automated CD ripping, tagging and adding to collection - jason_a69 - 09-17-2021 This works really well on a Pi, I did have one problem with my Asus USB drive in that it was underpowered on a Pi 4, a powered hub sorted that out if anyone else is having similar problems. |