Auto rip audio cd's with Halevt and abcde

  • Hey all,
    Not sure if this is was the right place to post this,


    I spent the evening last night seting up abcde and halevt so that when i insert a cd into the front of my OMW server it rips the cd to mp3 spits the disk out and then move the new music into my media folders where minidlna kindly picks up the new music :) anyway might be usefull to someone else so here goes.



    you will need a working ssh connection to the server,
    1st install both abcde and halevt

    Code
    sudo apt-get install abcde
    sudo apt-get install halevt


    this will install both of them and set them up to start on boot.
    next is to modify the halevt conf file found under /etc/halevt/halevt.xml

    Code
    sudo nano /etc/halevt/halevt.xml


    and at the bottom but before the line

    Code
    </halevt:Configuration>


    add the following

    Code
    <halevt:Device match="hal.volume.disc.has_audio = true">
    <halevt:Insertion exec="/Scripts/abcde_launch.sh"/>
    </halevt:Device>


    his tells halevt to launch a custom script on start up contents, The reason i did this was becasue i had problems with the new files being owned by root i tried a few fix's including add the following command to the above script but it didn't work so i made a file called
    /Scripts/launch_abcde.sh

    Code
    su yourusername -c "abcde -c /home/matthew/.abcde.conf -N"


    then make it executable

    Code
    chmod +x /Scripts/abcde_launch.sh
  • then make a file in your home folder called .abcde.conf with the following content



    you need to change the output folder to your preferred location thats almost all of it :)


    last part is to install the Lame if you want mp3 files, the above scripts can be changed to suit your needs and are just as i use them for my own collection.
    you will also need to restart halevt to accept the new config


    Code
    sudo /etc/init.d/halevt restart


    the following links will help you install Lame
    http://deb-multimedia.org/
    Change abcde to better suit your needs
    http://www.andrews-corner.org/abcde.html


    Kind Regards
    Matthew

    • Offizieller Beitrag

    Very nice :) That will come in handy for me and other people I'm sure.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • To all Euros:


    I don't know why they teach you to say "kind regards" in your english classes. I've never seen an American use it, ever.
    We might formally say in a letter "Best Regards" or "Warmest Regards". Couold a Brit please tell me if you use this in
    the UK?? an Aussie?? Americans are far more apt to just write, "Sincerely". All these are kind of formal for a forum. Best to just
    say, "Thanks". One of my best friends e-mails me all the time. He spoke french growing up and he always ends his e-mails
    with "Kind Regards".... Argh!!! Please don't be offended but this "Kind Regards" stuff is on my pet peeve list.


    For Americans these are all common:


    http://jobsearch.about.com/od/…ormal-letter-closings.htm


    PS- Thanks for the "How-to".

    • Offizieller Beitrag

    I have customers in the north east (primarily Maine) who sign "Kind Regards"...

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Ryeco, don't you think it's weird how many non-english speakers were taught to use it though. I mean the text books seem to lead them to believe that that closing is as common as "Goodbye". Look at how often they use it in forum. Also, that kind of close would be something you would use in a letter.

  • indeed it is something brits use, I am british myself, although i must admit it probably is left over from writing letters. It's also polite considuring that i don't know anyone on here :)

  • I tried this but had to make some mods due to my using sudo, and a cd+rw which was /dev/sr0 and needed permissions giving to halevt (also needed to install another package).


    Will post something later when I'm awake :)

  • Righty ho, here is my mod on this, which works with sudo (if you didn't opt for an OMV root account)...


    Follow the apt-get instructions in the OP, and install any other packages you are prompted for (I was asked for one).


    If you (like me) used a DVD+RW instead of a plain CDR, you may find your device is /dev/sr0
    If not, modify the following to suit your setup...


    I modified my launch_abcde.sh to read :


    Code
    echo "Starting abcde..." > /tmp/abc.log
    sudo -u halevt /usr/bin/abcde -c /path/to/my/.abcde.conf -N -d /dev/sr0
    echo "Starting wind down..." >> /tmp/abc.log
    sudo -u halevt /bin/chmod -R a+w /path/to/my/OUTPUTDIR/*
    echo "Ending..." >> /tmp/abc.log


    The above just tells me wether or not a rip finished. Anything that barfs will stop "Ending..." appearing.


    I then ran visudo and added the following lines :


    Code
    halevt  ALL=(ALL) NOPASSWD:/usr/bin/abcde -c /path/to/my/.abcde.conf -N -d /dev/sr0
    halevt  ALL=(ALL) NOPASSWD:/bin/chmod -R a+w /path/to/my/OUTPUTDIR/*


    The above lets the halevt user (created when halevt is installed) run the sudo commands to call abcde AND chmod


    The chmod instruction is key (for me), as my rips are all stored in a NAS directory, accessed by me via Samba/CIFS. If I don't chmod the files, I can't move them from Windows, which is a PITA....


    I also had to grant the halevt user access to the cdrom group, otherwise when sudo ran abcde it couldn't read the disk.


    To do this :


    Code
    usermod -a -G cdrom,plugdev halevt


    You then need to ensure your .abcdef.conf file is public, otherwise halevt can't read it.


    That should sort you. It all works spotlessly for me.

  • i tried installing this, and im pretty sure halevt works cause it says in the log that it runs the script, but nothing happends before it trys to search devices, then it keeps spamming an error something simmular to this:


    Code
    end_request i/o error dev sr0


    i tried diffrent drives and discs but its all the same and nothing works so far, and funny thing is i tried the same drives in ubuntu and it works fine ...
    what could i be doing wrong and why does it keep spamming this error from any drive or disc i try?
    do i need to install a driver or something becourse its a dvd drive?


    thanks in advance for any help.


    regards
    Halvhjearne

  • Hello new here cause of this post. I went through the steps and wasn't able to get it to run. /var/log/messages showed that the even was being handled and the script was executing, but halevt user wasn't able to run the script.


    What I found was that halevt didn't have a shell to execute the script in. I changed the shell from /bin/false to /bin/bash and the script started working. I did have to had the halevt user to cdrom and I made sure that the directory where the cddb was being created had granted permissions to halevt.


    I'm not sure if it is possible to keep the shell at /bin/false and in the /etc/halevt/halevt.xml to execute "/bin/bash <then your script>". Maybe I will check that and post back.


    Word to the wise, what I did isn't best practices. The user halevt has access to a shell now as a user.


    Namaste


    ~mouse

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!