Rip Audio CD to Flac & Burn From Flac + toc

Share your own howto's etc. Not for support questions!

Postby julian67 » 2009-04-08 10:21

curly wrote:
julian67 wrote:..........It definitely works :D


Fantastic! Actually I couldn't see any reason why it wouldn't since ripit is very similar to abcde. But I'm no programmer so thanks for the experiment.

julian67 wrote:I meant the abcded daemon runs as root, not when the regular user runs abcde from the terminal.
\

Yeah. This was something bothering me. All the rips, folders, files are owned by root so there's an extra step to chmod/chown. I unashamedly use foobar2000 on windoW$ XP to tag and organize (lately). It's really the best and easiest for me to use that I've found anywhere. So when I check the tags or rename files folders, I need write permissions. I will still have to be vigilant with the tags since freecddb can be a real mess sometimes. Foobar2000 is about the only reason I keep a windows machine around.

So you set it up like you described? An init script to run as your user? That would be ideal, I think.

I guess my next step is to figure out whether I can have a DVD-combo drive for dynamic playing in addition to the dedicated CD-ripit drive used by the daemon.


You define the drive in ripit's config so it should be easy enough to have it use one and ignore the other.

I didn't bother with an init script. I started ripit with
Code: Select all
$ ripit & disown
....and then forgot about it.
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Postby julian67 » 2009-04-08 18:03

If you just want ripit to start up in the background on boot as your regular user you can make /etc/init.d/ripit

Code: Select all
#! /bin/sh
start-stop-daemon -c julian --start -b --exec /usr/bin/ripit
exit



Replace my username with yours and make the script executable and update-rc.d.

It's crude and there's no pid file or clean stop so you can inadvertently start several ripits by mistake but the start-stop-daemon is good for backgrounding a process that would normally produce some output.

Initially I followed the example /etc/init.d/skeleton but ripit doesn't produce a pid file and making one with start-stop-daemon didn't help, so I had no quick and easy way to have the init script quit on finding a running instance, or stop a running instance. So laziness and incompetence triumphed and compelled me to do it the easy crude way :D
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Postby curly » 2009-04-08 20:33

How bout this? I just replaced "abcde" with "ripit" in the abcde.init script. I think there may be something missing, but I haven't tried it yet.

(edit:) I realize it's missing the directive to run as a specified user but I'm not quite sure where to put that. I'll see if I can figure it out.

Code: Select all
#!/bin/sh

##########
# The first argument tells what to do.
##########

RUNNING=`ps -ef|grep [r]ipit|awk '{ print $2 }'`

state=$1

case $state in
start)

        if [ -n "$RUNNING"  ]; then
                echo "ripit daemon already running."
                exit 0
        fi

        echo "Starting ripit daemon"
        ripit &
        echo "Done."
        ;;
stop)
        if [ -n "$RUNNING"  ]; then
           /bin/kill -9 $RUNNING > /dev/null
           if [ $? = 0 ]; then
                echo "ripit daemon killed"
           fi
        fi
        ;;
restart)
        $0 stop
        $0 start
        ;;
*)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac


And here's the abcded daemon script which may be unnecessary - I haven't tried to modify this yet but just as an example. The abcded script included in the abcde examples would not work properly for me. I found this version at some Finnish guy's DVR blog but I modified it slightly to just use the /etc/abcde.conf file.


[code]
#!/bin/sh
DATE=`date +%Y-%m-%d_%Hh%Mm%S`
DELAY=10
CDPARANOIA=â€
curly
 
Posts: 8
Joined: 2009-04-06 19:28

Postby julian67 » 2009-04-08 20:59

I can only suggest trying it out.

To have a scripted command run as a different user in bash you can use

Code: Select all
su -c 'command' $USER


and as it's an init script it's running as root and no password is needed.

You just need to define USER with the other variables at the beginning of the script, i.e.

USER='curly'

If you use the start-stop-daemon it's a -c $USER to run as a different user

I'm actually happy to do it my crude and bad way because I have a headless machine with a DVD/CD drive which I'd not even thought about for ripping until you mentioned the idea of a completely automated ripping box (thanks btw!) and I never use the optical drive for anything. It's a slimline slotloader and won't fit in anything else I have, and the machine runs Debian stable and only gets rebooted for kernel updates...that is pretty rare. So I don't need to be able to stop or restart ripit, it can just run in the background forever. But I think it's very neat that I just push a CD in and a few minutes later it spits it out and I didn't have to do anything, not even push a tray shut or press a button :D
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Postby curly » 2009-04-09 18:26

julian67 wrote:.. the idea of a completely automated ripping box (thanks btw!)


Well, thank YOU! I'm glad you found it useful. I was actually starting to wonder if I was crazy or not...

julian67 wrote:...and I didn't have to do anything, not even push a tray shut or press a button :D


Ain't it just da bomb?!?!

As a sort of side note, I did find a patch for abcde to get a TOC, http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg213298.html in case anyone wants that.

I'm looking forward to trying ripit, though.

It will probably be a few days before I have time to trial and error this since I still have to learn ripit first, as well. I'll post back my working config (fingers crossed).
curly
 
Posts: 8
Joined: 2009-04-06 19:28

Re: Rip Audio CD to Flac & Burn From Flac + toc

Postby lifeeyum » 2009-08-06 12:01

Thanks for the tutorial. It was easy to follow, informative and delivered as promised.

I am facing one small problem though. I'm running with loop and eject and all is well except that the CD drive does not give me enough time to grab the disk out and change it before it closes the tray. Sometimes it's less than one second, sometimes it's a few seconds, once it was about 15 seconds.

Ideally it would wait for me to change the disk and close the tray myself.

Any ideas on what's going wrong here?

Cheers
lifeeyum
 
Posts: 1
Joined: 2009-08-06 11:53

Re: Rip Audio CD to Flac & Burn From Flac + toc

Postby julian67 » 2009-08-06 12:53

This isn't an issue with ripit, it can happen in different circumstances. Have a look at the tool eject (it's in the repos) and if you still have trouble it's better to open a new thread.
Wisdom from my inbox: "do not mock at your pottenocy"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Re: Rip Audio CD to Flac & Burn From Flac + toc

Postby nadir » 2010-09-15 12:29

julian67 wrote:....
Ripit exists in Debian main as version 3.6.0-1 but it has a bug with CDDB lookups. This is fixed in the upstream version which can be obtained from http://www.suwald.com/ripit/ripit.html I use ripit-3.7.0-beta20090308 and recommend you do the same until a fixed version appears in Debian repos.
...


The link is or seems to be dead.
It took me a while to find it online, though i used google.
You may want to change it. I think it is:
http://www.suwald.com/ripit/news.php

if wrong: ignore.

darn, that should be a pm. now i will leave it here.
Well, once it is here i can also ask my question. :-)
I had problems to install the version from the maintainers site with dh_make (error was "dh_usrlocal debian/ripit/usr/local/bin/ripit no such directory") That is version 3.9.0.
The version for squeeze/sid is 3.8.0.
Is it ok to take the debian version, or is there a main advantage in using the 3.9.0 version?
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.
User avatar
nadir
 
Posts: 5965
Joined: 2009-10-05 22:06
Location: away

Re: Rip Audio CD to Flac & Burn From Flac + toc

Postby julian67 » 2010-09-15 13:09

I changed the link, thanks.

Building ripit 3.9.0 from upstream tarball:

I recall having an issue with dh_make and the upstream makefile. Solution:

Unpack tarball, cd into ripit directory, edit makefile and change

prefix = $(DESTDIR)/usr/local

to

prefix = $(DESTDIR)/usr

`dh_make -s -n`
`rm debian/*.ex`
`fakeroot debian/rules binary`

Well maybe you don't want a locally built package in /usr/bin when really it should be in /usr/local/bin but I'm lazy, it was the first thing I changed and it works.

Advantages of 3.9 over earlier versions:

it depends a lot on what you are interested in. Some people might not find any great reason to change from the version in Debian testing/unstable. I moved to 3.9.0 because it has the option to embed cover art in the tracks as part of the rip and encode process, something I like a lot. I always scan the cover and booklet when I rip my CDs (or anyone else's ha ha) and now I just need to make a small jpg of the cover and name it appropriately and it gets embedded in the tags when I run ripit. Very neat, it displays automatically on my portable players. I have ripit run replaygain as well. I'm not aware of any other ripper which can securely rip, encode to multiple codecs, name, tag, replaygain, add cover art, all automatic and in the one run and with a single command (or just by pushing the CD into the slot).

Other good new options: the ability to use custom mp3 id3 tags so you're not restricted to the limited official range. It annoyed me for a long time that there is a huge variety of different tags for electronic/dance/pop music but apparently every piece of European music made before the 20th century is "Classical". Bloody ignoramuses.

There are some good new options for dealing properly with various artists tagging as well. I don't think I tried the other new options yet.
Wisdom from my inbox: "do not mock at your pottenocy"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Re: Rip Audio CD to Flac & Burn From Flac + toc

Postby nadir » 2010-09-16 10:15

Yes, changing the prefix did work (took a bit less then 2 minutes, alltogether and including to install the deb). Thanks for the help, all that is a bit too heavy for me.
(thanks for the explanations about changes in ripit-versions too. Doesn't sound like my kind of interest, but perhaps in the future).

:D
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.
User avatar
nadir
 
Posts: 5965
Joined: 2009-10-05 22:06
Location: away

Previous

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable