Difference between revisions of "CDemu"

From ArchWiki
Jump to: navigation, search
(Troubleshooting)
Line 5: Line 5:
 
{{i18n_entry|简体中文|CDemu虚拟光驱}}
 
{{i18n_entry|简体中文|CDemu虚拟光驱}}
 
{{i18n_links_end}}
 
{{i18n_links_end}}
{{stub}}
 
  
== About ==
+
'''About'''
  
[http://cdemu.sourceforge.net/ CDemu] is a kernel module that emulates a CD- or DVD-ROM device.  It enables you to use disc images that contain more than a standard ISO-9660 filesystem, like .bin/.cue, .nrg, or .ccd images.  It's needed only because <tt>mount</tt> can only directly handle .iso disc images, which can only contain a single filesystem, but many CDs have multiple sessions, mixed data/audio tracks, etc. CDemu enables you to get to the full, original contents of these CD images.
+
[http://cdemu.sourceforge.net/ CDemu] enables you to use disc images that contain more than a standard ISO-9660 filesystem, like .bin/.cue, .nrg, or .ccd images.  It's needed only because <tt>mount</tt> can only directly handle .iso disc images, which can only contain a single filesystem, but many CDs have multiple sessions, mixed data/audio tracks, etc. In short you can mount nearly any kind of image file with ease using cdemu.
  
The original CDemu is currently at version 0.8.  As you can read on the [http://cdemu.sourceforge.net/ CDemu website], development has stopped on that line of CDemu, and a rewrite is under way, dubbed userspace-cdemu.  userspace-cdemu should be even more stable than the original version at this point.
+
'''Installing CDemu:'''
  
== Using Original CDemu ==
+
$ pacman -S cdemu-client
  
CDemu can be found in the unsupported section of [[AUR]] under the obvious name of <tt>cdemu</tt>.
+
This will install the dependencies as well.
  
TODO: somebody with more experience with original CDemu please fill this out.
+
$ modprobe vhba
  
== userspace-cdemu ==
+
edit /etc/conf.d/cdemud
  
userspace-cdemu has a different architecture than the original.  Instead of a single kernel module that does all the work parsing image files and presenting the data to the user, userspace-cdemu takes advantage of a kernel module (<tt>vhba</tt>) that simply emulates a SCSI CD/DVD device, putting off as much work on the existing kernel code as possible. Then the cdemud daemon (<tt>cdemud</tt>) runs in the background communicating with the kernel module.  The image parsing code has been abstracted out into a library (<tt>libmirage</tt>), and can be easily extended for future formats.  The daemon responds to [[dbus]] commands from clients.  The userspace-cdemu package comes with two example clients: one that simply runs from the command line (<tt>cdemu-client</tt>), and a [[GNOME]] panel applet (<tt>gcdemu</tt>).
+
$ /etc/rc.d/cdemud start
  
=== Installing userspace-cdemu ===
+
If you want start cdemu at boot add vhba to the modules and cdemud to the daemons section in /etc/rc.conf.
  
The userspace-cdemu suite can be found under the unsupported section of [[AUR]].  A search for "userspace-cdemu" should turn up all the necessary packages.
+
'''Using CDemu:'''
 +
[From man]
  
You'll need to install at least following packages, in roughly this order:
+
              Loading a single image to first device:
* <tt>vhba</tt> or <tt>vhba-module</tt>
+
              cdemu load 0 ~/image.mds
* <tt>libmirage</tt>
+
* <tt>cdemud</tt> or <tt>cdemu-daemon</tt>
+
  
From here, you've got options of what client you want to use.  The simple command line client is <tt>cdemu-client</tt>, and the [[GNOME]] panel applet is <tt>gcdemu</tt>. You'll need at least one, but you can install both too as they don't conflict.
+
      Loading multiple-file image to first device:
 +
              cdemu load 0 ~/session1.toc ~/session2.toc ~/session3.toc
  
=== Using userspace-cdemu ===
+
      Loading a text-based image in non-ASCII/non-Unicode encoding:
 +
              cdemu load 0 ~/image.cue --encoding=windows-1250
  
Once all the requisite packages are installed, you'll want to start the daemon.  You can do that by simply running:
+
      Loading an encrypted image with password provided as an argument:
# /etc/rc.d/cdemud start
+
              cdemu load 0 ~/image.daa --password=seeninplain
as root.
+
  
Add <tt>cdemud</tt> to the list of <tt>DAEMONS=</tt> in /etc/rc.conf to have the daemon start when the system boots.  The cdemud rc script inserts the vhba kernel module, so you don't need to worry about adding <tt>vhba</tt> to <tt>MODULES=</tt>.
+
      Unloading first device:
 +
              cdemu unload 0
  
Now you're ready to use all those .bin CD images you have lying around.  The command line client is simple enough:
+
      Displaying device status:
$ cdemu load 0 <imagefile>
+
              cdemu status
will load the imagefile to the first (and only by default) emulated device.
+
  
'''NOTE:''' If you run cdemud by initscript, you may need to add '-b system' option when calling cdemu.
+
      Displaying device mapping information:
$ cdemu -b system load 0 <imagefile>
+
              cdemu device-mapping
  
Or, to use the [[GNOME]] panel applet, right click on a panel and click "Add to Panel...", scroll all the way down and add the "gCDEmu Applet".  Then simply click on the icon and click on whatever device to bring up the open file dialog, select an image file, and hit ok.
+
      Setting daemon debug mask for the first device:
 +
              cdemu daemon-debug-mask 0 0x01
  
Now, you can mount the virtual CD so you can get to the data on it:
+
      Obtaining library debug mask for the first device:
# mount -t iso9660 /dev/sr1 /media
+
              cdemu library-debug-mask 0
<tt>/dev/sr1</tt> is the device that cdemud will create if you already have one real CD/DVD device (which would be <tt>/dev/sr0</tt>).  Tailor that line to suit your system.
+
  
From here, you can browse the CD's data contents in <tt>/media</tt> like it was any regular CD.
+
      Disabling DPM emulation on all devices:
 +
              cdemu dpm-emulation all 0
  
==Troubleshooting==
+
      Enabling transfer rate emulation on first device:
If you ever run into problems with the following line at the beginning:
+
              cdemu tr-emulation 0 1
<pre>ERROR:dbus.proxies:Introspect error</pre>
+
 
Add the following line to /etc/dbus-1/system.d/cdemud-dbus.conf, after '''<policy context="default">''':
+
      Changing device ID of first device:
<pre><allow send_interface="org.freedesktop.DBus.Introspectable"/></pre>
+
              cdemu device-id 0 "MyVendor" "MyProduct" "1.0.0" "Test device ID"
 +
 
 +
      Enumerating supported parsers:
 +
              cdemu enum-supported-parsers
 +
 
 +
      Enumerating supported fragments:
 +
              cdemu enum-supported-fragments
 +
 
 +
      Enumerating supported daemon debug masks:
 +
              cdemu enum-daemon-debug-masks
 +
 
 +
      Enumerating supported library debug masks:
 +
              cdemu enum-library-debug-masks
 +
 
 +
      Displaying daemon and library version:
 +
              cdemu version

Revision as of 20:22, 2 October 2009

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n links end

About

CDemu enables you to use disc images that contain more than a standard ISO-9660 filesystem, like .bin/.cue, .nrg, or .ccd images. It's needed only because mount can only directly handle .iso disc images, which can only contain a single filesystem, but many CDs have multiple sessions, mixed data/audio tracks, etc. In short you can mount nearly any kind of image file with ease using cdemu.

Installing CDemu:

$ pacman -S cdemu-client

This will install the dependencies as well.

$ modprobe vhba

edit /etc/conf.d/cdemud

$ /etc/rc.d/cdemud start

If you want start cdemu at boot add vhba to the modules and cdemud to the daemons section in /etc/rc.conf.

Using CDemu: [From man]

             Loading a single image to first device:
             cdemu load 0 ~/image.mds
      Loading multiple-file image to first device:
             cdemu load 0 ~/session1.toc ~/session2.toc ~/session3.toc
      Loading a text-based image in non-ASCII/non-Unicode encoding:
              cdemu load 0 ~/image.cue --encoding=windows-1250
      Loading an encrypted image with password provided as an argument:
              cdemu load 0 ~/image.daa --password=seeninplain
      Unloading first device:
             cdemu unload 0
      Displaying device status:
             cdemu status
      Displaying device mapping information:
             cdemu device-mapping
      Setting daemon debug mask for the first device:
             cdemu daemon-debug-mask 0 0x01
      Obtaining library debug mask for the first device:
             cdemu library-debug-mask 0
      Disabling DPM emulation on all devices:
             cdemu dpm-emulation all 0
      Enabling transfer rate emulation on first device:
             cdemu tr-emulation 0 1
      Changing device ID of first device:
             cdemu device-id 0 "MyVendor" "MyProduct" "1.0.0" "Test device ID"
      Enumerating supported parsers:
             cdemu enum-supported-parsers
      Enumerating supported fragments:
             cdemu enum-supported-fragments
      Enumerating supported daemon debug masks:
             cdemu enum-daemon-debug-masks
      Enumerating supported library debug masks:
             cdemu enum-library-debug-masks
      Displaying daemon and library version:
             cdemu version