Results 1 to 7 of 7

Thread: Setting the DVD drive speed

  1. #1
    Join Date
    Sep 2010
    Location
    Hindås, Sweden
    Beans
    31
    Distro
    Ubuntu Studio

    Setting the DVD drive speed

    Hi!

    There are a few threads that describes how to control the DVD drive speed to reduce the acoustic noise from the drive while watching a movie, usually by "eject -x <speed>" or by the "speedcontrol" program. Works fine, except for one thing: The drive speed setting is cleared and returned to maximum whenever media is changed, which is very annoying. You have to bring up the Terminal every time you want to watch another movie.

    Is there any way to set this permanently?
    Or some automount initscript connected to the /dev/cdrom or /dev/dvd mount event, where the "eject -x <speed> can be added?

    Ultimately, a drive speed setting in totem would be preferred.
    Or maybe a general system setting exists?


    BN

  2. #2
    Join Date
    Nov 2007
    Location
    Sweden
    Beans
    2,182

    Re: Setting the DVD drive speed

    Quote Originally Posted by bnilsson View Post
    Is there any way to set this permanently?
    Yes, there is a permanent fix. I simply don't remember it exactly though, but...

    You can use the hdparm command with the -e parameter. See the man page for more details. I am not sure if that's the correct way of slowing it down permanently as it supposed to work by itself, I think that your Ubuntu system lacks important packages to make this happen. libdvdcss is an important package to have installed, and once you go there, more packages should get added in the process.
    Operating system: Debian Wheezy 7.0.
    Computer: Celeron 2 ghz laptop, 2 GB RAM.
    Linux user since -99.

  3. #3
    Join Date
    Sep 2010
    Location
    Hindås, Sweden
    Beans
    31
    Distro
    Ubuntu Studio

    Re: Setting the DVD drive speed

    Sorry to hear you didn't remember, since hdparm is also cleared when changing media.

  4. #4
    Join Date
    Nov 2007
    Location
    Sweden
    Beans
    2,182

    Re: Setting the DVD drive speed

    Well, I have never known it exactly, so I'm not sorry.

    I simply installed some non-free system libraries which made me able to watch DVD movies and by installing libdvdcss and some other system packages solved it for me.

    For Ubuntu you should concentrate on Medibuntu, that's where the solution is, somewhere. As I'm more used to Debian, I simply drag down source tar balls and go from there, but that isn't exactly necessary nowadays.
    Operating system: Debian Wheezy 7.0.
    Computer: Celeron 2 ghz laptop, 2 GB RAM.
    Linux user since -99.

  5. #5
    Join Date
    Sep 2010
    Location
    Hindås, Sweden
    Beans
    31
    Distro
    Ubuntu Studio

    Re: Setting the DVD drive speed

    [SOLVED)

    Found a solution.
    I installed halevt, which is catching the hardware event then a dvd is mounted/inserted.
    The installation script for it is currently broken, however, a workaround is found at http://ubuntuforums.org/showthread.php?t=1770231
    A config file (dvd-speed.xml) for what I wanted to do is found at http://forum.xbmc.org/showthread.php?t=62923, to be placed in /etc/halevt directory. This file gives the command "hdparm -E4 /dev/dvd" when the dvd insertion event is detected.
    Finally, to make it work I had to change the default user for the halevt daemon, since it got "permission denied" for the hdparm command. Changing the user to myself in /etc/default/halevt fixed this.

    Now the DVD drive speeds up for a few seconds when inserted, then spins down to a barely audible level and the speed is still enough to play the movie.

  6. #6
    Join Date
    Sep 2010
    Location
    Hindås, Sweden
    Beans
    31
    Distro
    Ubuntu Studio

    Re: Setting the DVD drive speed

    A final comment:
    Setting the username for the daemon as myself did not work when logged in as someone else; still permission denied to modify the /dev/dvd speed.
    Setting the username to root worked.

    /etc/default/halevt:
    # Default settings for halevt initscript

    # Set this to yes if you want the halevt init-script to start a system-wide daemon
    START_DAEMON=yes

    # Run halevt has user/group
    HALEVT_USER=root
    HALEVT_GROUP=plugdev

  7. #7
    Join Date
    Sep 2010
    Location
    Hindås, Sweden
    Beans
    31
    Distro
    Ubuntu Studio

    Re: Setting the DVD drive speed

    Decided to try a much simpler solution:
    Create the file /etc/udev/rules.d/dvd-speed.rules:
    DEVNAME=="dvd", ACTION=="change", RUN+="/sbin/hdparm -E4 /dev/sr0"
    or, which is more clear for the reader
    DEVNAME=="dvd", ACTION=="change", RUN+="/usr/bin/eject -x 8 /dev/dvd"

    I selected the latter and removed halevt.
    You probably need to do "sudo stop udev" and "sudo start udev" to activate.

    I prefer "eject" before "hdparm" as the docs on how to control the speed is better.

    See "man udev", and you may also try
    # udevadm monitor --env
    while changing media in the dvd drive to get more details on the udev events.
    Last edited by bnilsson; January 8th, 2012 at 12:32 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •