[LINUX] CD/DVD Spin Speed control? ...all CD/DVD playback is otherwise quite noisy
#1
Lightbulb 
Does XBMC attempt to reduce the rotation speed of the DVD drive such that it is quieter? It is quite noisy on playback as it plays at full speed.

These two threads suggest it is not working on Linux. Is this still the case?

http://forum.xbmc.org/showthread.php?tid=49767
http://forum.xbmc.org/showthread.php?tid=41823

Second does it work on windows?

I infer from the posts libcdio may be used to control the speed. If this is the case, would appreciate it someone would point to where in the code the libcdio library routine is called to reduce the speed. Would like to debug this, I'll find it in the code, but maybe some one knows off the top of their head where its called.

Mythtv does a good job of controlling the speed, I may be able to borrow some code from there.
Reply
#2
Thumbs Up 
I don't know how you can set this in Xbmc itself, but Linux has a few standard tricks to do this. Lets say your DVD drive is /dev/sr0 then one may on the command line either:

1. "hdparm -E4 /dev/sr0" (-E8 makes 8x and so on.....)

2. There is also a command line app (in Synaptic) called "setcd".

3. "eject -x4" (4 is a good low speed in principle) or eject --help for more info.

Succes Smile
Reply
#3
I had a patch for this a while back but since libcdio (the lib we use to control such things) doesn't seem to support it on any hardware found it wasn't usefull.

Libcdio have an executable that reports if it hw supports it, I have yet to see anyone having hw (Might be linux part of libcdio that makes it impossible) so when that works it should work to handle the speed.

Cheers,
Tobias
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#4
Topfs2 Wrote:I had a patch for this a while back but since libcdio (the lib we use to control such things) doesn't seem to support it on any hardware found it wasn't useful.

Would you mind sending me your patch, I`ll see if I can figure out what is wrong in the libcdio library.

What about Windows, is there the same problem of the drive running fast and noisy, or is speed properly controlled there? I ask since any patches I may come up with should address linux and windows.
Reply
#5
TBH I don't have the patch no longer. I never could test it against hw that actually worked so I forgot about it and it vanished in a format Smile, although it's a rather easy patch so if you can show you have the capability I can look into creating it again.

EDIT: Since libcdio is crossplattform it's equally good in windows, so if you can show that it can do it in windows thats as good for me. But know that anydvd can force it to a speed in windows so as a quick solution that might work equally good.

Cheers,
Tobias.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#6
Topfs2 Wrote:although it's a rather easy patch so if you can show you have the capability I can look into creating it again.

Since libcdio is cross platform it's equally good in windows, so if you can show that it can do it in windows thats as good for me. But know that anydvd can force it to a speed in windows so as a quick solution that might work equally good.

Hi, if you wouldn't mind help in recreating the patch I would appreciate it. My problem is that I am just getting started with the xbmc source code, there is one heck of a lot of code there and its gonna take sometime to navigate through and learn where everything is. I found the libcdio library, but just not sure where it is best in the xbmc code to call the speed set routine in the libcdio library.

To give you an idea of my coding capabilities, I have submitted many patches for mythtv before I jumped over to the mythtv camp. My largest patches are adding actors/actress support to mythvideo (#3585) and the tv channel/favorite grouping patch (#199). A more relevant, but smaller patch is this one http://svn.mythtv.org/trac/ticket/4025 to fix the eject (although someone broke it again since). My patche in that ticket are under maverik044, here I deal at the lowest level communicating with the drive. This patch corrected a deficiency in the linux kernel to do with the newer ATA drivers that treat the drives as SCSI devices. The deficiency in the kernel has been known since 2.6.12 or so, but the proposed fix was ignored.

As far as testing, I would test linux mainly, not really set up to compile in windows.
Reply
#7
Sure, need to check if you hw works though.

libcdio
./configure --prefix=/foo/bar/out
make && make install
and check and pastebin cd-info and will see if that will tell us something we want to here.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#8
I know that my DVD drive supports speed control as mythtv is able to control the speed with the same Linux configuration.

I'll check as you suggest if libcdio thinks it can control it, but my guess is that I'll need to figure out why libcdio doesn't.
Reply
#9
PLS help.

i tried hdparm and there is no changes Sad

Thanks.
Reply
#10
Moved to Live forum.

Not every drive can be adjusted by hdparm. Have a google about YOUR drive and speed settings in Linux. This goes beyond the scope of xbmc.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#11
Haggy Wrote:This goes beyond the scope of xbmc.
I do not think that this goes beyond the scope of XBMC, merging into the existing feature suggestion thread.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#12
Gamester17 Wrote:I do not think that this goes beyond the scope of XBMC, merging into the existing feature suggestion thread.

Hmm. How to use hdparm on Linux (and the fact that it unfortunately does not work on every drive) is certainly not - but as you wish Smile
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#13
Oh dear, waking up an old thread here...

Just wanted to tell you that I'm using Samsung SH-224BB drive - the speed is 48x - and setting the drive speed to 24x (setcd -x 24 /dev/sr0) works. However, Samsung states at the MAGIC SPEED page that it doesn't affect DVDs, only CDs. This could be somewhat true, because setting speed 10x has no effect on speed/noise, but setting speed 24x does it make it very silent.

So, I know my drive supports speed 24x for DVDs, too, via setcd (at least). How do I make it permanent? Setting it to rc.local doesn't seem to do the trick, as my (still ongoing) experiments suggest. Is it possible to make the command run every time right after the disc is inserted via the open/close tray menu item? Or perhaps during XBMC startup?

While I know my way around Linux, XBMC insights are all new to me. Any pointers? Home.xml?

Thanks all, in advance!
--
Direc
Reply
#14
Oh dear, I just couldn't go to bed until I got this done...

So, after some serious trial and error, I ended up with /lib/udev/rules.d/99-cdspeed.rules file like this:

Code:
ACTION=="change", SUBSYSTEM=="block", KERNEL=="sr0", ENV{ID_CDROM_MEDIA_STATE}=="complete", RUN+="/sbin/hdparm -E24 /dev/sr0"

The rule activates only after the disk mount is complete (or something). The only hiccup is that the speed actually changes only after the first read from the disk (when the playback starts), but I can live with that Smile. So there you go, a way to adjust the speed once and for all. I think the 24x option doesn't work for everybody, but try different values so that you find one that works.

Oh yeah, I'm running fresh XBMCBuntu 12.0 here, in case that matters.

Hope this helps someone else, too.
--
Direc
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX] CD/DVD Spin Speed control? ...all CD/DVD playback is otherwise quite noisy0