# Can't access CDs or DVDs



## robspop (Nov 16, 2011)

I cannot access audio CDs or DVDs and I am not sure why. I'm using 9.0-RC1 amd64. I have added atapicam to loader.conf and the device is detected on boot:

```
Nov 16 10:23:41 BSD kernel: cd0 at ata0 bus 0 scbus4 target 0 lun 0
Nov 16 10:23:41 BSD kernel: cd0: <HL-DT-ST DVDRAM GSA-4167B DL11> Removable CD-ROM SCSI-0 device 
Nov 16 10:23:41 BSD kernel: cd0: 33.300MB/s transfers (UDMA2, ATAPI 12bytes, PIO 65534bytes)
Nov 16 10:23:41 BSD kernel: cd0: cd present [52685 x 2048 byte records]
```
`# camcontrol devlist` appears to give expected output:

```
# camcontrol devlist
<ST3500418AS CC38>                 at scbus0 target 0 lun 0 (ada0,pass0)
<Hitachi HDS721032CLA362 JPFOA39C>  at scbus3 target 0 lun 0 (ada1,pass1)
<HL-DT-ST DVDRAM GSA-4167B DL11>   at scbus4 target 0 lun 0 (cd0,pass2)
```
I can successfully mount and read a data cd:

```
# mount -t cd9660 /dev/cd0 /mnt
# ls /mnt
.cshrc          HARDWARE.TXT    boot.catalog    media           stand
...
```
but I cannot seem to access it with an audio CD in the drive (or a DVD either). I've tried direct access:

```
# cdda2wav -D /dev/cd0 -t 1
cdrom device (/dev/cd0) is not of type generic SCSI. Setting interface to cooked_ioctl.
307200 bytes buffer memory requested, transfer size 129024 bytes, 4 buffers, 27 sectors
#Cdda2wav version 3.00_freebsd_9.0-current_amd64_amd64, real time sched., soundcard, libparanoia support
Segmentation fault (core dumped)
```
or, rather desperately:

```
# cdda2wav -scanbus
cdda2wav: Inappropriate ioctl for device. CAMIOCOMMAND ioctl failed. Cannot open or use SCSI driver.
```
I've also tried a range of CD players including VLC, Rhythmbox, xcd, bebocd, etc., but only get a variety of device error messages. It is not a sound problem, I can listen to mp3 files, and I do not think it has anything to do with whether or not there is a cable attaching the drive to the sound card.


----------



## darcsis (Nov 16, 2011)

Did you recompile your ports after upgrading to 9.0? As I know, cdparanoia is broken on 9.0 due to kernel changes. I assume this has something to do with your problem. You are supposed to rebuild cdrtools if possible and then give it a try.


----------



## robspop (Nov 16, 2011)

It was a fresh install of 9.0, not an upgrade: does this still apply?


----------



## zeissoctopus (Nov 16, 2011)

darcsis said:
			
		

> Did you recompile your ports after upgrading to 9.0? As I know, cdparanoia is broken on 9.0 due to kernel changes. I assume this has something to do with your problem. You are supposed to rebuild cdrtools if possible and then give it a try.



Please update your ports tree , cdparanoia had been patched for 9.0 's new SCSI IO API please refer PR 161760

rebuild cdparanoia to solve 9.0 problem

You can use mplayer with CDDA support to enjoy your audio CD in 9.0


----------



## wblock@ (Nov 16, 2011)

robspop said:
			
		

> It was a fresh install of 9.0, not an upgrade: does this still apply?



It's usually worth updating to the latest ports tree.  But rebuilding all ports is only necessary when the OS has been upgraded from one major version to another, like 8.x to 9.x.


----------



## robspop (Nov 16, 2011)

Ok, thanks; "just in case" I did refresh the ports tree and re-installed cdrtools and cdda2wav and it does seem to have made some difference. I can now play CDs, but still can't listen to them. E.g., xcd runs and gives what looks like correct track information, and cdda2wav can rip the tracks. But, I cannot find a way of simply listening to them. The CD device is wired to the sound card. I do not know for certain which players use the direct cable link and which treat the CD essentially as data but have tried a variety. vlc plays DVDs with no problem but won't play an audio CD. xmms just gives lots of error messages. rhythmbox cannot seem to find the device. What do other people use?


----------



## wblock@ (Nov 16, 2011)

Try cdcontrol(1).


----------



## robspop (Nov 16, 2011)

I probably should have said that it was one of the ones I tried and it does the same as the more successful of the others, inasmuch as the disk starts to spin and there are no error messages, the light on the drive indicates activity, but still no sound. I have checked mixer settings and all the levels are adequate. I have tried this both as root and as normal user.


----------



## wblock@ (Nov 16, 2011)

If the CD spins and cdda2wav works, it implies that the problem is hardware.  Maybe the cable from the drive to the audio card or motherboard, or maybe something more subtle like the wrong audio input.

Some people just play CDs digitally, using the output from cdda2wav.


----------



## robspop (Nov 16, 2011)

Thanks for the responses and perhaps I will go with that as a solution, at least for now, as I hate to be ultimately defeated by such issues. I take your point about the hardware though playing a DVD in the same drive does produce sound, and booting the machine with a live linux image does allows me to play CDs with sound, so if there is a hardware problem it must be related to how it works with the FreeBSD drivers rather than a general fault. Mostly I cannot tell what is happening except that the disk is spinning, though I have now had some error messages from vlc which I include in case they give anyone a clue:

```
...
cdda access error: cannot read sector 269021
cdda access error: Could not set block size
...
cdda error: Could not set block size
cdda error: cannot read sector 269180
es error: cannot peek
es error: cannot peek
es error: cannot peek
es error: cannot peek
```


----------

