By vita78 on V 18, 2007
cdrw command can print media type
The cdrw command has undocumented debugging flag -V. Once I encountered a blank media and it was not obvious if it's a CD or DVD, there was no indication of media type on it. I searched how to find the information simply by software. I found nothing, however, later when I was looking at the cdrw code, I found that this tool actually reads the media type, but prints it only with debug turned on. See get_media_type() in usr/src/cmd/cdrw/device.c source file. When I discovered this, it was already too late. But next time I could use:
cdrw -M -V
Which would print among other things something like: "CD-ROM found" or DVD-RAM, DVD+R, DVD-R, etc.
set/get the read speed of CD/DVD drive
Sometimes I want listen to music or watch a film on Solaris from the CD/DVD media. However, the drive is spinning the media at full speed and this is quite noise. Especially, when I listen music the drive constantly switches between noise and silence according to how the player buffers data. Yes, the best workaround is not to run playback from CD/DVD. The other option is to limit the spinning speed by software. I found some usefull code again in cdrw. The cdrw command allows you to specify writing speed using -p option. Hmm, it still didn't help, I want to set reading speed. Reading the source code of cdrw, one can find that the function used to control write speed can also control the read speed, but currently no command line option allows this. I've helped myself with mdb(1) debugger, writing short script, which calls a particular function with arguments saying that I want to control the read speed of the drive. It's really not clean solution, but workaround. It works for me about two years. You may download the script cdspeed. The syntax is:
Usage: cdspeed [speed]
If invoked without speed argument, it gets the read speed, otherwise it attempts to set the read speed to given value. Before running the command, make sure that there is a media in the drive. Also I doubt that script works on drives, which are not burners - I cannot try as I don't have one. The script supports x86 platforms only. But if it after all still works for you, you can enjoy listening or watching from CD/DVD!