After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 350082 - An error in Rhythmbox burning dialog - endless list of repetitive speed values
An error in Rhythmbox burning dialog - endless list of repetitive speed values
Status: RESOLVED FIXED
Product: nautilus-cd-burner
Classification: Deprecated
Component: cd-burner
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus CD Burner Maintainers
Nautilus CD Burner Maintainers
: 353862 358657 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-08-05 17:25 UTC by Mateusz Drożdżyński
Modified: 2006-10-01 01:39 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
patch (1.33 KB, patch)
2006-09-29 17:40 UTC, William Jon McCann
none Details | Review

Description Mateusz Drożdżyński 2006-08-05 17:25:32 UTC
There is an error in the cd burning dialog in rhythmbox. I get a default write speed of 0x, and if I try to change it I get an endless list of progressive values. 

All this is on an updated edgy; rhythmbox version: 0.9.5-1ubuntu3

Steps to reproduce:
1. Open Rhythmbox
2. Add any tracks to any playlist
3. Try burning this playlist to the CD.

This bug was originally reported in Ubuntu:
     https://launchpad.net/distros/ubuntu/+source/rhythmbox/+bug/55327
Comment 1 Sebastien Bacher 2006-08-06 10:29:14 UTC
From the Ubuntu bug: http://librarian.launchpad.net/3816010/samsung-bug

"Drive:
  name:			SAMSUNG CD-R/RW DRIVE SW-252F
  device:		/dev/hdc
  door:			closed
  type:			CD-R, CD-RW, CD
  is mounted:		FALSE
  max read speed:	176 KiB/s (CD 1.1x, DVD 0.1x)
  max write speed:	9173 KiB/s (CD 61.1x, DVD 6.7x)
  write speeds:		9173 KiB/s (CD 61.1x, DVD 6.7x)
			9172 KiB/s (CD 61.1x, DVD 6.7x)
			9171 KiB/s (CD 61.1x, DVD 6.7x)
			9170 KiB/s (CD 61.1x, DVD 6.7x)
			9169 KiB/s (CD 61.1x, DVD 6.7x)
			9168 KiB/s (CD 61.1x, DVD 6.7x)
			9167 KiB/s (CD 61.1x, DVD 6.7x)
...
After looking at the output from list_cddrives I think that this bug is filled against the wrong package. I can reproduce it in nautilus' CD/DVD creator and therefore I change to package to nautilus-cd-burner."

Reassigning according to that
Comment 2 Nafallo Bjälevik 2006-08-11 10:44:11 UTC
I can reproduce this bug on up-to-date edgy :-).
Comment 3 Fabio Bonelli 2006-08-12 15:33:02 UTC
Hi!

Can you paste the output of lshal | grep write_speeds ?
Comment 4 Mateusz Drożdżyński 2006-08-12 15:47:45 UTC
Here you are:

matid@yumi:~$ lshal | grep write_speeds
  storage.cdrom.write_speeds = {'8467', '7056', '5645', '4234', '2822', '2112', '1764', '1411', '706'} (string list)
Comment 5 Fabio Bonelli 2006-09-01 18:13:17 UTC
*** Bug 353862 has been marked as a duplicate of this bug. ***
Comment 6 Fabio Bonelli 2006-09-01 18:18:45 UTC
I can't reproduce it here with 2.15.7. Does it happen every time?
Comment 7 Nafallo Bjälevik 2006-09-01 20:11:05 UTC
Yes, still true for everything using nautilus-cd-burner.
Comment 8 Sebastien Bacher 2006-09-10 12:18:18 UTC
Other Ubuntu bug about that: https://launchpad.net/distros/ubuntu/+source/nautilus-cd-burner/+bug/57174
Comment 9 Michael R Head 2006-09-10 16:06:28 UTC
So I've got two machines here, one that exhibits the problem, one that doesn't. I went to the source and found out why the difference was occuring.

On the thinkpad (which works):
burner@phoenix:/tmp/nautilus-cd-burner-2.16.0/src$ lshal |grep write_speed
  storage.cdrom.write_speeds = {'4234', '2822', '2117', '1411', '706'} (string list)
  storage.cdrom.write_speed = 4234  (0x108a)  (int)

The write_speeds hal entry is populated by the driver.

On the desktop (which has a CDROM drive and a DVD burner, and is hit by this bug):
burner@firestorm:/tmp/nautilus-cd-burner-2.16.0/src$ lshal |grep write_speed
  storage.cdrom.write_speed = 8468  (0x2114)  (int)
  storage.cdrom.write_speed = 0  (0x0)  (int)


Now, in the hal_drive_from_udi() function in nautilus-burn-drive-monitor.c, we have this:
	if (drive->priv->write_speeds == NULL) {
		fill_write_speeds (drive);
	}

This check gets skipped on the working drive, and triggered on the other drive. So what does fill_write_speeds look like?
static void
fill_write_speeds (NautilusBurnDrive *drive)
{
	int max_speed;
	int i;

	max_speed = drive->priv->max_speed_write;
	drive->priv->write_speeds = g_new0 (int, max_speed + 1);

	for (i = 0; i < max_speed; i++) {
		drive->priv->write_speeds[i] = max_speed - i;
	}
}

OK, so there's a loop there. What's max_speed going to be? Well, it turns out it's the same value as the hal entry "storage.cdrom.write_speed" above -- in the order of thousands. So why not modify fill_write_speeds so that it does something like this instead:

fill_write_speeds (NautilusBurnDrive *drive)
{
	int max_speed;
	int i;
        int divisor = 1;

	max_speed = drive->priv->max_speed_write;

#define MAX_N_WRITE_SPEEDS 20
        if (max_speed > MAX_N_WRITE_SPEEDS) {
           divisor = max_speed/MAX_N_WRITE_SPEEDS;
        }
	drive->priv->write_speeds = g_new0 (int, max_speed/divisor + 1);

	for (i = 0; i < max_speed/divisor; i+= divisor) {
		drive->priv->write_speeds[i] = max_speed - i;
	}
}

Or something like that.
Comment 10 Michael R Head 2006-09-10 16:53:18 UTC
BTW, the loop logic in my code snippet is a bit off, but you get the idea ;-)
Comment 11 Michael R Head 2006-09-15 05:31:48 UTC
Since I didn't see this problem with Dapper/GNOME 2.14 before upgrading, I checked out the source from 2.14, and found that little has changed in fill_write_speeds, though the source has been rearranged a little. 

Here's the version from 2.14: http://cvs.gnome.org/viewcvs/nautilus-cd-burner/nautilus-burn-drive.c?hideattic=0&rev=1.62&view=markup

Since the code is about the same, and though I believe a sanity check "drive->max_speed_write" is necessary and will fix the symptom, I'm curious about why hal seems to be returning less information about some drives now. 
Comment 12 William Jon McCann 2006-09-29 17:40:57 UTC
Created attachment 73659 [details] [review]
patch

I'd appreciate it if someone can test this patch.  I'm going to commit this to CVS so it'll make the release today.  Thanks.
Comment 13 Sebastien Bacher 2006-09-29 22:16:03 UTC
I've uploaded a package with the patch to Ubuntu edgy, I'll let you know when people who had that issue will comment on the bug about it
Comment 14 Michael R Head 2006-09-29 22:27:55 UTC
Sweet! Thanks to William and Sebastien. I'll give it a try on my bad machine when I get home tonight. I'm still curious as to why hal is returning less information, but this should clear up the problem.
Comment 15 Nafallo Bjälevik 2006-09-29 22:53:01 UTC
I built this locally and tried it out. It does work now, but the reported DVD-speed is 4.something on a burner that can do 16x. Better than nothing, but still needs more work IMO.
Comment 16 Jonathan Matthew 2006-09-29 23:14:58 UTC
The patch fixes this problem for me.
Comment 17 William Jon McCann 2006-09-29 23:21:24 UTC
Cool.  Marking this fixed then.

We should really find out why all these drives aren't reporting storage.cdrom.write_speeds.

Thanks.
Comment 18 Michael R Head 2006-09-30 22:57:30 UTC
I concur with Christian, it works well, but it's perfect, though at this point, I guess it's a HAL problem. There are more speeds than fit on my 1600x1200 screen, but nautilus-cd-burner appears on the screen and is usable immediately.

Here's the output I now get from list_cddrives (it is a 16X DVD burner, so it's surprising that it says it can only burn DVDs at 6.2X):

burner@firestorm:~$ /usr/lib/nautilus-cd-burner/list_cddrives 
Drive:
  name:                 DVDRW IDE 16X
  device:               /dev/hdc
  door:                 closed
  type:                 CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, DVD+R DL, DVD+RW, CD, DVD
  is mounted:           TRUE
  max read speed:       8450 KiB/s (CD 56.3x, DVD 6.2x)
  max write speed:      8468 KiB/s (CD 56.4x, DVD 6.2x)
  write speeds:         8400 KiB/s (CD 56.0x, DVD 6.2x)
                        8250 KiB/s (CD 55.0x, DVD 6.0x)
                        8100 KiB/s (CD 54.0x, DVD 5.9x)
                        7950 KiB/s (CD 53.0x, DVD 5.8x)
                        7800 KiB/s (CD 52.0x, DVD 5.7x)
                        7650 KiB/s (CD 51.0x, DVD 5.6x)
                        7500 KiB/s (CD 50.0x, DVD 5.5x)
                        7350 KiB/s (CD 49.0x, DVD 5.4x)
                        7200 KiB/s (CD 48.0x, DVD 5.3x)
                        7050 KiB/s (CD 47.0x, DVD 5.2x)
                        6900 KiB/s (CD 46.0x, DVD 5.1x)
                        6750 KiB/s (CD 45.0x, DVD 4.9x)
                        6600 KiB/s (CD 44.0x, DVD 4.8x)
                        6450 KiB/s (CD 43.0x, DVD 4.7x)
                        6300 KiB/s (CD 42.0x, DVD 4.6x)
                        6150 KiB/s (CD 41.0x, DVD 4.5x)
                        6000 KiB/s (CD 40.0x, DVD 4.4x)
                        5850 KiB/s (CD 39.0x, DVD 4.3x)
                        5700 KiB/s (CD 38.0x, DVD 4.2x)
                        5550 KiB/s (CD 37.0x, DVD 4.1x)
                        5400 KiB/s (CD 36.0x, DVD 3.9x)
                        5250 KiB/s (CD 35.0x, DVD 3.8x)
                        5100 KiB/s (CD 34.0x, DVD 3.7x)
                        4950 KiB/s (CD 33.0x, DVD 3.6x)
                        4800 KiB/s (CD 32.0x, DVD 3.5x)
                        4650 KiB/s (CD 31.0x, DVD 3.4x)
                        4500 KiB/s (CD 30.0x, DVD 3.3x)
                        4350 KiB/s (CD 29.0x, DVD 3.2x)
                        4200 KiB/s (CD 28.0x, DVD 3.1x)
                        4050 KiB/s (CD 27.0x, DVD 2.9x)
                        3900 KiB/s (CD 26.0x, DVD 2.8x)
                        3750 KiB/s (CD 25.0x, DVD 2.7x)
                        3600 KiB/s (CD 24.0x, DVD 2.6x)
                        3450 KiB/s (CD 23.0x, DVD 2.5x)
                        3300 KiB/s (CD 22.0x, DVD 2.4x)
                        3150 KiB/s (CD 21.0x, DVD 2.3x)
                        3000 KiB/s (CD 20.0x, DVD 2.2x)
                        2850 KiB/s (CD 19.0x, DVD 2.1x)
                        2700 KiB/s (CD 18.0x, DVD 1.9x)
                        2550 KiB/s (CD 17.0x, DVD 1.8x)
                        2400 KiB/s (CD 16.0x, DVD 1.7x)
                        2250 KiB/s (CD 15.0x, DVD 1.6x)
                        2100 KiB/s (CD 14.0x, DVD 1.5x)
                        1950 KiB/s (CD 13.0x, DVD 1.4x)
                        1800 KiB/s (CD 12.0x, DVD 1.3x)
                        1650 KiB/s (CD 11.0x, DVD 1.2x)
                        1500 KiB/s (CD 10.0x, DVD 1.1x)
                        1350 KiB/s (CD 9.0x, DVD 0.9x)
                        1200 KiB/s (CD 8.0x, DVD 0.8x)
                        1050 KiB/s (CD 7.0x, DVD 0.7x)
                        900 KiB/s (CD 6.0x, DVD 0.6x)
                        750 KiB/s (CD 5.0x, DVD 0.5x)
                        600 KiB/s (CD 4.0x, DVD 0.4x)
                        450 KiB/s (CD 3.0x, DVD 0.3x)
                        300 KiB/s (CD 2.0x, DVD 0.2x)
                        150 KiB/s (CD 1.0x, DVD 0.1x)

Media:
  label:                'TheFrozenThrone'
  type:                 Commercial CD or Audio CD (has-data)
  is writable:          FALSE
  is appendable:        FALSE
  capacity:             480.98 MiB approx. or 54 mins 44 secs
  size:                 480.98 MiB approx. or 54 mins 44 secs
---
Drive:
  name:                 ATAPI CDROM
  device:               /dev/hdd
  door:                 open
  type:                 CD
  is mounted:           FALSE
  max read speed:       4224 KiB/s (CD 28.1x, DVD 3.1x)
  max write speed:      0 KiB/s (CD 0.0x, DVD 0.0x)
  write speeds:
Media:
  label:                ''
  type:                 Couldn't open media
  is writable:          FALSE
  is appendable:        FALSE
  capacity:             Could not be determined
  size:                 Could not be determined
---
Comment 19 William Jon McCann 2006-10-01 01:39:41 UTC
*** Bug 358657 has been marked as a duplicate of this bug. ***