Auto rip audio cd's with Halevt and abcde

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • 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

      Source Code

      1. sudo apt-get install abcde
      2. 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

      Source Code

      1. sudo nano /etc/halevt/halevt.xml

      and at the bottom but before the line

      Source Code

      1. </halevt:Configuration>

      add the following

      Source Code

      1. <halevt:Device match="hal.volume.disc.has_audio = true">
      2. <halevt:Insertion exec="/Scripts/"/>
      3. </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

      Source Code

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

      then make it executable

      Source Code

      1. chmod +x /Scripts/
    • Re: Auto rip audio cd's with Halevt and abcde

      then make a file in your home folder called .abcde.conf with the following content

      Brainfuck Source Code

      1. # -----------------$HOME/.abcde.conf----------------- #
      2. #
      3. # A sample configuration file to convert music cds to
      4. # MP3 format using abcde version 2.5.3
      5. #
      6. #
      7. # modifed by Matthew Horsell
      8. # -------------------------------------------------- #
      9. # Specify the encoder to use for MP3. In this case
      10. # the alternatives are gogo, bladeenc, l3enc, xingmp3enc, mp3enc.
      11. MP3ENCODERSYNTAX=lame
      12. # Specify the path to the selected encoder. In most cases the encoder
      13. # should be in your $PATH as I illustrate below, otherwise you will
      14. # need to specify the full path. For example: /usr/bin/lame
      15. LAME=lame
      16. # Specify your required encoding options here. Multiple options can
      17. # be selected as '--preset standard --another-option' etc.
      18. LAMEOPTS='--preset extreme'
      19. # Output type for MP3.
      20. OUTPUTTYPE="mp3"
      21. # The cd ripping program to use. There are a few choices here: cdda2wav,
      22. # dagrab, cddafs (Mac OS X only) and flac.
      23. CDROMREADERSYNTAX=cdparanoia
      24. # Give the location of the ripping program and pass any extra options:
      25. CDPARANOIA=cdparanoia
      26. CDPARANOIAOPTS="--never-skip=40"
      27. # Give the location of the CD identification program:
      28. CDDISCID=cd-discid
      29. # Give the base location here for the encoded music files.
      30. OUTPUTDIR="/yourmusicfolder/"
      31. WAVOUTPUTDIR="/tmp"
      32. # The default actions that abcde will take.
      33. ACTIONS=cddb,read,encode,tag,move,clean
      34. #ACTIONS=cddb,playlist,read,encode,tag,move,clean
      35. # Decide here how you want the tracks labelled for a standard 'single-artist',
      36. # multi-track encode and also for a multi-track, 'various-artist' encode:
      39. # Decide here how you want the tracks labelled for a standard 'single-artist',
      40. # single-track encode and also for a single-track 'various-artist' encode.
      41. # (Create a single-track encode with 'abcde -1' from the commandline.)
      44. # Create playlists for single and various-artist encodes. I would suggest
      45. # commenting these out for single-track encoding.
      48. # Put spaces in the filenames instead of the more correct underscores:
      49. #mungefilename ()
      50. #{
      51. # echo "$@" | sed s,:,-,g | tr / _ | tr -d \'\"\?\[:cntrl:\]
      52. #}
      53. # What extra options?
      54. MAXPROCS=3 # Run a few encoders simultaneously
      55. PADTRACKS=y # Makes tracks 01 02 not 1 2
      56. EXTRAVERBOSE=y # Useful for debugging
      57. EJECTCD=y # Please eject cd when finished :-)
      Display All

      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

      Source Code

      1. sudo /etc/init.d/halevt restart

      the following links will help you install Lame
      Change abcde to better suit your needs

      Kind Regards
    • Re: Auto rip audio cd's with Halevt and abcde

      Very nice :) That will come in handy for me and other people I'm sure.
      omv 4.1.12 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.11 plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • Re: Auto rip audio cd's with Halevt and abcde

      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:…ormal-letter-closings.htm

      PS- Thanks for the "How-to".
    • Re: Auto rip audio cd's with Halevt and abcde

      I have customers in the north east (primarily Maine) who sign "Kind Regards"...
      omv 4.1.12 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.11 plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • Re: Auto rip audio cd's with Halevt and abcde

      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.
    • Re: Auto rip audio cd's with Halevt and abcde

      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 to read :

      Source Code

      1. echo "Starting abcde..." > /tmp/abc.log
      2. sudo -u halevt /usr/bin/abcde -c /path/to/my/.abcde.conf -N -d /dev/sr0
      3. echo "Starting wind down..." >> /tmp/abc.log
      4. sudo -u halevt /bin/chmod -R a+w /path/to/my/OUTPUTDIR/*
      5. 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 :

      Source Code

      1. halevt ALL=(ALL) NOPASSWD:/usr/bin/abcde -c /path/to/my/.abcde.conf -N -d /dev/sr0
      2. 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 :

      Source Code

      1. 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:

      Source Code

      1. ​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.

    • 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.