[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] Re: Submission of new mmc function for libcdio

From: Thomas Schmitt
Subject: [Libcdio-devel] Re: Submission of new mmc function for libcdio
Date: Sun, 31 Jan 2010 08:42:41 +0100


> I am still here reading what is said (very interesting), and understand
> better now (I had never heard about MMC commands until Wednesday).

I was quite overwhelmed when i began to read
MMC, SPC, SBC a few years ago. Nevertheless it
is much better written than ECMA-167 plus UDF
Download all the specs you can find. They have
the habit to vanish in the internet.
(I still could bite my ass that i did not
 save the copy of the first RRIP specs which
 i once had on my screen. Now i can only find
 second and third generation. The lost one
 specified the now vanished RR entry.)

> For a "mmc_get_disc_information" function ("mmc_get_discmode" could be
> confusing with "cdio_get_discmode"), we need to define what information
> about the media we need: type (dvd, cd...), content (blank, iso9660, udf,
> audio... => maybe we'll need per track content) session state, size,
> capacity, 'capabilities' (writable, rewritable) ...

This is quite some list of properties.
Did i already praise the educational value of
dvd+rw-mediainfo, the companion of growisofs ?

Load the tray with a DVD and execute
  dvd+rw-mediainfo /dev/... 

This reports
  INQUIRY:                [HL-DT-ST][BD-RE  GGW-H20L ][YL03]
   Mounted Media:         14h, DVD-RW Sequential
   Media ID:              RITEKW01    
   Disc status:           appendable
   Number of Sessions:    27
   State of Last Session: empty
   "Next" Track:          27
   Number of Tracks:      27
   Track State:           complete incremental
   Track Start Address:   0*2KB
   Free Blocks:           0*2KB
   Track Size:            954496*2KB
   Last Recorded Address: 954495*2KB

The headlines are the names of MMC commands.
Sometimes slightly altred. The info lines
interpret the outcome.

A second argument triggers verbosity mode:
  dvd+rw-mediainfo /dev/... extra

which tells a lot of MMC entrails:
  INQUIRY:                [HL-DT-ST][BD-RE  GGW-H20L ][YL03]
   0000:  00 40 00 00 00 41 00 00 00 42 00 00 00 43 00 00
          00 50 00 00 00 12 00 00 00 11 00 00 00 15 00 00
          00 16 00 00 00 14 01 00 00 13 01 00 00 1a 00 00
          00 1b 00 00 00 2b 00 00 00 10 01 00 00 09 00 00
          00 0a 00 00 00 08 00 00 00 02 00 00
  READ DISC INFORMATION:  00 20 11 01 1b 1b 1b 20 00 00 00 00 00 00 00 00
  READ TRACK INFORMATION[#1]:     00 2e 01 01 00 04 21 02 00 00 00 00 00 00 00 

Regrettably it only works for DVD. But most of
the commands may be applied to CD to.
The table-of-content of a CD should be examined
via the existing capabilities of libcdio.

For determining media manufacturers and product
ids, be invited to make use of:

Be aware that examining media has the potential
to spoil ongoing burn runs on CD and DVD-R[W].
One should use libcdio access mode
if one has to expect the presence of burn
programs. Well, if the burn program participates
in a locking protocol at all. cdrecord does not,
growisofs (but not dvd+rw-mediainfo), wodim,
libcdio (MMC_RDWR_EXCL), and libburn use
open(O_EXCL) on Linux. This is a nearly
undocumented feature of device files which
re-uses a standard open() flag for other
purposes. Cough.
On FreeBSD, libcdio and libburn use flock(2).
I hope to get growisofs into that club, too.
... or to get better locking by the system
developers. FreeBSD tapes are said to be
auto-locking for exclusive access. 

Have a nice day :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]