CD speed discovery

Bastien Nocera hadess at hadess.net
Sun Jan 18 01:44:21 EET 2004


On Sat, 2004-01-17 at 22:02, David Zeuthen wrote:
> On Sat, 2004-01-17 at 18:44, Bastien Nocera wrote:
> > Heya,
> > 
> > So, I've managed to get around getting the speed problem sorted.
> > Patch attached. 
> 
> Thanks. I've applied and committed this patch with the following change
> 
> original patch
> 
>   +                       if (read_speed) 
>   +                           ds_property_set_int(d, 
>   "storage.cdrom.write_speed", write_speed);
> 
> changed patch
> 
>   +                       if( write_speed>0 ) 
>   +                           ds_property_set_int(d,
>   "storage.cdrom.write_speed", write_speed);

Oh, dang. Thanks to you for reviewing the code properly :)

> It also only seems to work for ide-scsi, not ide-cd which the cdrw drive
> on my test system is using, so some more work is required. What is the
> unit of the numbers?
> With ide-cd I get storage.cdrom.read_speed==3528 so I assume this is
> kb/s, yes? (the file /proc/sys/dev/cdrom/info suggest 20x and 20 times
> 150-something is ~= 3528)

It's in kB/sec. You can use that to calculate the CD speed (divide by
176), and the DVD speed (divide by 1385, from the top of my head).

> I think ide-scsi comment goes for your DVD[+-]RW patch as well - I
> haven't got any DVD writers to test. I've added an item in doc/TODO so
> we don't forget this.
> 
> Btw, isn't ide-scsi going away in Linux 2.6?

Hmm, it should work fine with all MMC-2 compliant drives, be them IDE or
SCSI. The drive I tested that on is an IDE drive, without ide-scsi (as
it is indeed deprecated, and even non-working).

It doesn't work for you? Unless you have the drive connected to the port
of your SoundBlaster 16 (old skool), it really should.

> > I snuck in a patch to open the CD drive O_EXCL, to avoid
> > colliding with a running application using the CD.
> > 
> 
> Makes sense.
> 
> > PS: libbacon's CD drive discovery code is much cleaner with HAL support
> > http://www.hadess.net/files/patches/hald-dvd-support/libbacon-hal-with-speed.patch
> 
> Woow, cool.

As soon as the next release of HAL is out, I shall merge this code in.

Cheers

---
Bastien Nocera <hadess at hadess.net> 
You have to be 100% behind someone, before you can stab them in the
back.




More information about the xdg mailing list