Tux !

About
Status
History
Install
FAQ
Develop
Download
Contact
Lists
SVN
CDemu at SourceForge

SourceForge.net Logo

Valid HTML 4.01!

Valid CSS!

CDemu for Linux
About

CDemu is a kernel module for Linux. It is designed to simulate a CD drive + CD with just simple cue/bin files, which are pretty common in the Windows world. It includes an user space program to control the kernel module. You can use it to watch an SVCD or mount the data track of an bin/cue. However, for watching an SVCD, we would recommend MPlayer which can play bin/cue images directly with the patch a friend and I made for it (more under History). The CDemu project is licensed under the GPL (v2 or later) !

News
2006-08-05

This is CDemu 0.8.0, a CD drive emulator for Linux.

  • 2.6.16 and higher only (no more 2.4).
  • cdemu has file access like in a loop module (Nico Huber).
  • should work on amd64 & SMP systems.
  • .mds, .ccd, .nrg support (Henrik Stokseth).
  • .iso (Calin A. Culianu).
  • some docs.
  • bug fixes.

Sources are available from:

Any bug reports, comments, feature requests are welcomed.

Status

- Using CDemu on multi user systems should be safe now. Any user can mount an image in an empty CDemu slot while only the user (and root) can unmount a slot that is already in use.
- Many users have reported SMP issues (varying from lock ups to very poor performance). We've had an user send us a threading patch to avoid locking issues, but it is 2.4-centric. So, before it can be added to SVN, it needs to be generalized to support 2.4 and 2.6. Unfortunately, none of the CDemu developers have access to SMP systems so the best testing we can do involves 'it looks good' :). CDemu-0.6 final should resolve these issues.
- Looking ahead: CDemu was first created to support bin/cue images. Ideally, we'd like to be able to support Nero (.nrg), Disc Juggler (.cdi), Clone CD (.ccd), etc... Anyone with spare time and spare patches would be appreciated :).

History

It all started like this: I got some movies from friends on a firewire disk which where bin/cue files. They told me I would need to burn them or use Daemon Tools under Windows in order to watch them. That was to much for me, booting Windows just to watch a movie? So a friend (Justus Schwartz) and I decided that we should make a patch for our favored video player (MPlayer). After one night we had a proof of concept; 2 weeks later we had a good patch and we submitted it. It was accepted by the MPlayer team and starting with 0.9rc3, our patch is included. The syntax is as follows:

$ mplayer cue://<cue file>[:track] [options]

After that was done, I thought, hey it's not that hard, so I resolved to make something like Daemon Tools, but for Linux. And so I started to write my first kernel module and after 1 week it worked; some bug fixes later we had my first public version.

I changed the name to CDemu because the company which owns the rights to the name "Virtual CD" asked me to do so.

Install

The install is quite simple:

  1. you need the source of your current running kernel.
    /lib/modules/$(shell uname -r)/build/include needs to point at it.
  2. extract the archive (release tarball):
    $ tar -jxvf cdemu-<VER>.tar.bz2
    or checkout the code from svn:
    $ svn co https://svn.sourceforge.net/svnroot/cdemu/trunk cdemu
  3. cd into that dir
    $ cd cdemu-<VER>
    or
    $ cd cdemu
  4. build the module:
    $ make
  5. install the module and user space utilities:
    $ sudo make install
  6. now simply load the kernel module:
    $ sudo modprobe cdemu
    (no message should be displayed after running modprobe)
  7. to load a bin/cue image:
    $ cdemu 0 image.cue
    $ sudo mount /dev/cdemu0 /mnt/cdrom
    (some things may be different on your system, YMMV)
  8. for more information, please review the help output:
    $ cdemu -h
FAQ

Q: Why should I use the CDemu Kernel Module when i can just mount the ISO9660 filesystem over a loopback device ? (mount -o loop mymovie.iso /mnt/mymovie for example)
A: That only works with ISO images. In other words, only one data track. Many bin/cue images contain more than one track and often times are in the raw format (that means the image also contains the error correction codes from the cd ... an exact binary image). You can't mount these types of images directly.

Q: I am trying to mount an [S]VCD but the mount command keeps failing!
A: Of course it does not work ! An [S]VCD contains no real filesystem. You need to read it in raw mode.
e.g. use MPlayer or xine to watch the movie. Just point the player to the virtual device (i.e. /dev/cdemu/0)
But Windows does you say !? Windows lies to you ;-) Windows has the problem that it can't read cds in raw mode, so the ATAPI driver creates a virtual file system, so Windows programs can read it. This layer is not needed in Linux since we can just handle the raw format with our media players. ;-)

Q: Whenever I try to mount an image I get an error like "mount: you must specify the filesystem type".
A: Usually when you run mount you don't have to specify the filesystem type, but sometimes you do. Just add another option to the mount command, "-t iso9660" like so:
$ mount -t iso9660 /dev/cdemu/0 /mnt/cdrom

Develop

The user space program is written in our beloved language Python. If you would like to make a GUI program for it, you should take a look at libcdemu.py. All important user space code is there. If you've made a GUI program to control the CDemu Kernel Module, please contact us. We would love to include the code here on our site :).

Download

Work-in-progress packages:
There are unofficial packages of the next version of cdemu to be found here: cdemu.kabelkaos.net
After cdemu 0.8 was released with support for a lot of new CD-images, it was concluded that the core design of cdemu was inherently broken, so it was eventually rewritten from scratch by Rok Mandeljc and given the nickname userspace-cdemu. The stability of the software should at this point actually be better than that of the last official version (0.8). If you have some problems getting cdemu 0.8 to work, I recommend that you try userspace-cdemu. We are interested in bug reports primarily on this upcoming release. We are also interested in getting help both with development work and documentation in particular. Patches are most welcome.

Current Release: 0.8
This release supports 2.6.16 and later Linux kernels.
cdemu-0.8.tar.bz2

KCDemu:
Wolfgang Koller <viras at suselinuxsupport dot de> has made a KDE klicker applet!

Older Releases:
The following supports Linux 2.4 and 2.6
0.7: cdemu-0.7.tar.bz2
0.6-beta: cdemu-0.6_beta.tar.bz2
0.6-alpha: cdemu-0.6-alpha.tar.bz2
The following only support Linux 2.4
0.5.3: cdemu_0.5.3.tar.bz2
0.5.2-alpha: cdemu_0.5.2_alpha.tar.bz2
0.4: virtualcd-0.4.tar.bz2
0.3: virtualcd-0.3.tar.bz2

Misc Files:
Thanks to Fredrik Henriksson, we have a simple test cue/bin file: cdemu_example.tar.gz

Contact

Bug Reports / Questions / Etc:
CDemu Development List

Maintainers:
Paweł Różański (current maintainer)
Robert Penz (original author)

Developers:
Mike Frysinger
Marc Thoben
Henrik Stokseth
Rok Mandeljc