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 317529 - n-c-b detecting blank disc of size = 0
n-c-b detecting blank disc of size = 0
Status: RESOLVED FIXED
Product: nautilus-cd-burner
Classification: Deprecated
Component: cd-burner
2.12.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus CD Burner Maintainers
Nautilus CD Burner Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-09-29 14:43 UTC by Gustavo Carneiro
Modified: 2005-12-16 16:13 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
Patch against version 2.10.2 to support MMC1 drives (2.27 KB, patch)
2005-12-14 02:35 UTC, Jason D. Hildebrand
none Details | Review
Patch against cvs head to support MMC1 drives (2.68 KB, patch)
2005-12-14 02:36 UTC, Jason D. Hildebrand
none Details | Review

Description Gustavo Carneiro 2005-09-29 14:43:32 UTC
I can't burn an ISO with n-c-b because it always complains "Please put a
CD-R/CD-RW, with at least 637 MiB free, into the drive.

list_cddrives gives me this:

[...]
name: SAMSUNG CD-R/RW DRIVE SW-224B device: /dev/hdd max_speed_read: 40
door: closed
type: CD Recorder/CD ReWritable/CD Drive
media type: CD-R (blank)
media size: 0.00 MiB approx. or 0 mins 0 secs
CD-Recorder/SCSI devices only: max_speed_write: 40 id: /dev/hdd
---
So I guess the problem is that it detects size = 0 instead of size = 700 MiB.
Comment 1 Jason D. Hildebrand 2005-12-13 22:03:13 UTC
This has been failing for me, too -- even since upgrading from 2.8 to 2.10.x
several months ago.  The output from list_cddrives (using n-c-b 2.10.2) on my
machine is:

name: Hewlett-Packard CD-Writer cd16r device: /dev/hdd max_speed_read: 16
type: CD Recorder/CD Drive
media type: Unknown Media (rewritable) (has-data)
media size: -0.00 MiB
CD-Recorder/SCSI devices only: max_speed_write: 10 id: /dev/hdd

After blanking the media (using cdrecord blank=fast), it reports:

name: Hewlett-Packard CD-Writer cd16r device: /dev/hdd max_speed_read: 16
type: CD Recorder/CD Drive
media type: Unknown Media (rewritable) (blank)
media size: -0.00 MiB
CD-Recorder/SCSI devices only: max_speed_write: 10 id: /dev/hdd


I just pulled n-c-b from CVS, and it reports:

Could not determine drive profile: non-MMC unit?
name: Hewlett-Packard CD-Writer cd16r device: /dev/hdd max_speed_read: 16
door: closed
type: CD-R, CD-RW, CD
media type: Unknown Media (rewritable) (blank)
Could not determine drive profile: non-MMC unit?
media size: Could not be determined
CD-Recorder/SCSI devices only: max_speed_write: 16


The hunt "non-MMC unit" doesn't seem to be correct, though, since cdrecord
-prcap returns:

[some output removed]
Device seems to be: Generic mmc CD-RW.

Drive capabilities, per MMC page 2A:

  Does read CD-R media
  Does write CD-R media
  Does read CD-RW media
  Does write CD-RW media
  Does not read DVD-ROM media
  Does not read DVD-R media
  Does not write DVD-R media
  Does not read DVD-RAM media
  Does not write DVD-RAM media
  Does support test writing
[subsequent output removed]

I activated some commented-out debug output in dvd_plus_rw_utils.cpp, which
provided a further clue: 

:-[ GET CONFIGURATION failed with SK=5h/ASC=20h/ACQ=00h]: No such device

This comes in response to a 0x46 (GET CONFIGURATION) command.  After some more
testing, it appears that the "no such device" is printed because errno is
already set because of a previous error -- in any case the device _does_ exist,
so that's a red herring.

Further digging... according to the MMC-2 spec (see
http://www.t10.org/drafts.htm), this error translates to "INVALID COMMAND
OPERATION CODE".

So it appears that my CD-RW drive does not support this command.  I suspect it
conforms to the MMC-1 spec, but not MMC-2.   It was purchased in 2000, so it's
far from new, but it's still working nicely so I consider it a bug that n-c-b
doesn't support it (seeing as it was supported in gnome 2.8). 

In terms of implementation, it should be possible to determine the disc type
(i.e. cd-r, cd-rw, etc) without relying on the MMC-2 command set (specifically:
without using the GET CONFIGURATION command).  Probably whoever put that code in
there didn't know that it doesn't work with all drives.

If I have time I may work at implementing this, but even if I don't I hope this
information will be of use... I certainly know a lot more about cd burning than
I did a few hours ago.
Comment 2 William Jon McCann 2005-12-13 23:13:26 UTC
Jason, that is a very nice analysis.  I suspect you are right.

This error doesn't occur for me and that is one of the reasons why it hasn't
been fixed :)

You may have noticed that the code in dvd_plus_rw_utils.cpp is pretty messy - it
is mostly a copy from dvd+rw-tools - though I may have broken it since the copy
was made.  HAL has equivalent functionality that has been entirely rewritten. 
Unfortunately, HAL only works on Linux at the moment.  So, you may find some
clues in what HAL does.

Does HAL correctly identify your hardware and media?

If you find a solution I'm sure you'll make a lot of people very happy.
Comment 3 Jason D. Hildebrand 2005-12-14 02:35:33 UTC
Created attachment 55968 [details] [review]
Patch against version 2.10.2 to support MMC1 drives
Comment 4 Jason D. Hildebrand 2005-12-14 02:36:04 UTC
Created attachment 55969 [details] [review]
Patch against cvs head to support MMC1 drives
Comment 5 Jason D. Hildebrand 2005-12-14 03:40:46 UTC
Thanks for your response, William.  Unfortunately HAL does not properly detect
the media in my drive either.  The volume.disc.type property simply contains
"unknown".

I've created a patch whichs add some fallback logic to detect the media in
drives which don't support the GET CONFIGURATION command.  I've attached the
patch against 2.10.2 and against CVS head (I'm using debian, so 2.10.2 was the
easiest version for me to work with).

I've tested the 2.10.2 patch using both list_cddrives and the UI, and it allows
n-c-b to correctly detect the presence and size of blank CD-Rs as well as blank
and/or writable CD-RWs, so this fixes the problem for me.  It also detects
non-writable CDs and so will not attempt to write to them.

The CVS-head patch is the same; it's just been adjusted to apply cleanly.  I
don't have time or diskspace to build the required dependencies to test the UI,
but I've tested using list_cddrives it is working correctly from there.
Comment 6 William Jon McCann 2005-12-16 16:13:44 UTC
I committed your patch in two parts to HEAD and gnome-2-12.  Thanks much!