 Cdred FAQ
===========

1. General information.
1.1 What is cdred?
1.2 What kernel version needs cdred?
1.3 Why is it called cdred? 
1.4 Can I use cdred for data cdroms?
1.5 Can I extract digital audio from a remote audio cdrom using cdred?
1.6 What ioctls are supported now?
1.7 Where do I get the latest version of cdred? 
1.8 Any mailing lists about cdred?
1.9 Jukeboxes (CD changers support).
1.10 My question isn't in this FAQ.

2.  Problems.
2.1 If I use cdred for listening to a cd I can't use other programs with the sound card at the same time.
2.2 The cd volume control in the sound card mixer hasn't any effect on cdred.
2.3 My cd player program works well with cdred (detects how many tracks has the cd, the tracks length, etc.) but fails when trying
    to play a track.
2.4 I hear small breaks when playing tracks.
2.5 When I use cdredd and cdred_server in the same computer for accessing a cdrom drive in that computer, some programs can't eject
    discs.
2.6 Cdred doesn't work in my system.
2.7 XMMS can't play tracks using cdred.
2.8 Error messages when compiling cdred.
2.9 How can I help?

1. General information.

1.1 What is cdred?

Cdred is a Linux driver and two programs that enables *any* CD player software (ascd, xfreecd,gtcd, etc.) to use audio CDs inserted
in other computer. In other words: you can listen to an audio cd in a Linux box that doesn't have that cd inserted and you can do 
that using any program.


1.2 What kernel version needs cdred?

Cdred was programmed in a computer  with kernel version 2.2.5, but it should work with any 2.2.x kernel. I have tested it personally
in a 2.2.19 kernel and it works.
Support for 2.4 kernels will be implemented later.


1.3 Why is it called cdred? 

In the beginning the project was called netcd, but there is other program for Macintosh with that name. The new name was suggested
by Juan Jess Muoz Esteban and means exactly the same as the old one, but in spanish.


1.4 Can I use cdred for data cdroms?

At present no, but maybe later this will be implemented. It isn't a priority because there are other things like NFS for doing this.


1.5 Can I extract digital audio from a remote audio cdrom using cdred?

This function will be added later.


1.6 What ioctls are supported now?

CDROMSTART, CDROMSTOP, CDROMPAUSE, CDROMRESUME, CDROMPLAYMSF, CDROMREADTOCHDR, CDROMREADTOCENTRY, CDROMPLAYTRKIND, CDROMVOLREAD, 
CDROMVOLCTRL, CDROMSUBCHNL, CDROMEJECT, CDROMEJECT_SW, CDROMMULTISESSION, CDROM_GET_MCN, CDROMRESET,CDROMCLOSETRAY, 
CDROM_SET_OPTIONS, CDROM_CLEAR_OPTIONS, CDROM_MEDIA_CHANGED, CDROM_DRIVE_STATUS, CDROM_DISC_STATUS, CDROM_LOCKDOOR,
CDROM_GET_CAPABILITY,CDROM_CHANGER_NSLOTS,CDROM_SELECT_DISC.


1.7 Where do I get the latest version of cdred? 

http://cdred.sourceforge.net


1.8 Any mailing lists about cdred?

The only list at this time is cdred-announe. New versions of cdred will be announced in this list.
You can subscribe to cdred-announce in http://lists.sourceforge.net/lists/listinfo/cdred-announce


1.9 Jukeboxes (CD changers support).

Cdred now supports jukeboxes (CD changers). Use the driver parameter n_slots to tell the driver how many slots has the 
jukebox. For example, if you have a jukebox with 4 slots use "insmod cdred_driver.o n_slots=4".

I don't have access to a jukebox drive, if you use cdred with such a drive please send me an email (hescolar@users.sourceforge.net)
and tell me if it works.


1.10 My question isn't in this FAQ.

Mail me: hescolar@users.sourceforge.net


2. Problems.

2.1 If I use cdred for listening to a cd I can't use other programs with the sound card at the same time.

This happens because cdred uses by default the DSP device of the sound card for audio reproduction. The DSP can be opened for only 
a program at the same time. Use the -E option to fix this problem. See question 2.3 for more info.

2.2 The cd volume control in the sound card mixer hasn't any effect on cdred.

This control adjusts the volume of cdrom drives connected to the sound card with a cable, but cdred reproduces audio using the DSP
device of the sound card.
You can adjust the volume of cdred using the volumen control of the DSP (it is called PCM in some mixer programs) or with
the volume control of your cd player program.


2.3 My cd player program works well with cdred (detects how many tracks has the cd, the tracks length, etc.) but fails when trying
to play a track.

This can happen due to various causes:

	-Other program is using the DSP of the sound card. It this is the cause of the error, cdredd will print the message 
	"Error opening soundcard". 
		
	Solution 1: Compile cdred with esound support (this is the default, simply type make) and lauch cdredd with
	the -E option. If you do this cdredd will use esound for audio output and will be able to share the soundcard with other 
	esound compatible programs like mpg123,xmms,enlightment,Enlightenment,Window maker, etc.

	Solution 2: Kill that program and try again. 

	-The cdrom drive in the server doesn't support the CDROMREADAUDIO ioctl. The server uses this ioctl to read the digital
	audio. If this is the problem, cdredd will print the message "Unrecoverable error getting frames from server". 
	There is no solution for this problem except using other cdrom drive that supports CDROMREADAUDIO.


2.4 I hear small breaks when playing tracks.

Use a bigger audio buffer. You can specify the buffer size in seconds using the -s option of cdredd.


2.5 When I use cdredd and cdred_server in the same computer for accessing a cdrom drive in that computer, some programs can't eject
discs.

This problem happens when the program that uses /dev/cdred doesn't tell the kernel that the device is opened just for issuing 
ioctl commands. The program only has to use the O_NONBLOCK flag when opening the device.
Due to reasons too big for explaining in this faq, this causes that the program can't eject the disc from the drive.

This problem has various solutions:
	-Use the cdred_eject program that comes with cdred for ejecting the cd. Don't forget to exit from the program who is using
	 cdred before using cdred_eject.
	-Use a cd player that uses the O_NONBLOCK feature, like kscd.
	-If you got the source code of the program, change the open("/dev/whatever,x) to open("/dev/whatever",x | O_NONBLOCK). 
	Recompile and all should work well.
	-Use the -l option in cdredd. Doing this will force cdred to ignore the cdrom drive lock requests.


2.6 Cdred doesn't work in my system.

Mail me (hescolar@users.sourceforge.net) explaining what is exactly your problem. Don't forget to include:

 Distribution (Redhat, Debian, Mandrake, etc.).
 cdred version.
 Kernel version.
 gcc version.
 glibc version.
 cd player program that you use.
 Cdrom drive: manufacturer, model, speed, type (IDE, SCSI, etc.).
* Cdredd and cdred_server output (use the -V option).
 cdred_driver output. This messages are printed to the system logs. If you add -DDEBUG to MODCFLAGS in the Makefile, the driver
  will print a lot of debug messages. Recompile, install the driver and try again including in your email all the driver messages.


2.7 XMMS can't play tracks using cdred.

At present cdred allows only a process using /dev/cdred at the same time. XMMS use pthreads internally, this means various processes
trying to use /dev/cdred at the same time. This causes plays to fail.
In future versions cdred will support more than one process and this problem will be fixed.


2.8 Error messages about esd when compiling cdred.

You haven't the esound-devel package installed. Install it and recompile if you want cdred to use esound.

If you wan't to compile without esound support, delete "-DESD_SUPPORT" (in CFLAGS_DAEMON) and "-lesd" (in the cdredd rule) in the 
Makefile.

2.9 How can I help?

Send me patches, documentation, bugs, bug fixes, comments, new features you want cdred to have, etc.

If cdred works well in your system I'm very interested about your system: kernel version for server and client machines, 
cd-player that you use, cdrom drive speed, etc.


