[kde-freebsd] k3b freebsd contact

Heiner h.eichmann at gmx.de
Wed Oct 14 22:24:40 CEST 2009


On Wednesday 14 October 2009, Andriy Gapon wrote:
> 1. Without this k3b doesn't find my DVD writer. It seems that it tries
> cam_open_pass on /dev/cd0 which fails.
> Index: libk3bdevice/k3bdevice.cpp
> ===================================================================
> --- libk3bdevice/k3bdevice.cpp	(revision 1034980)
> +++ libk3bdevice/k3bdevice.cpp	(working copy)
> @@ -157,7 +157,7 @@
>  #ifdef Q_OS_FREEBSD
>  K3b::Device::Device::Handle K3b::Device::openDevice( const char* name,
> bool write ) {
> -    K3b::Device::Device::Handle handle = cam_open_pass (name, O_RDWR,0 /*
> NULL */); +    K3b::Device::Device::Handle handle = cam_open_device( name,
> O_RDWR ); kDebug() << "(K3b::Device::openDevice) open device " << name <<
> ((handle)?" succeeded.":" failed.") << endl;
>      return handle;

Hi!

I am not sure, if this is a good idea. FreeBSD requires two devices to access 
the CD: the /dev/cdX and the /dev/passX device (and sometimes the bus, targt, 
lun ids). On the console, I read during the k3b startup:

(BSDDeviceScan) number of matches 23
(BSDDeviceScan) periph: cd0
(BSDDeviceScan) periph: pass0
(BSDDeviceScan) add device /dev/cd0:2:0:0 (/dev/pass0)
(K3bDevice::Device) /dev/cd0: init()
(K3bDevice::openDevice) open device /dev/pass0 succeeded.

This means, that my /dev/cd0 is aquivalent to /dev/pass1 and has the ids 
2:0:0. From your error description, I guess, that on your system the cdX and 
passX are mixed. So I expect the following on your console:

(BSDDeviceScan) number of matches 23
(BSDDeviceScan) periph: pass0                      <- should be cd0
(BSDDeviceScan) periph: cd0                          <- should be pass0
(BSDDeviceScan) add device /dev/pass0:2:0:0 (/dev/cd0)    <- wrong!!
(K3bDevice::Device) /dev/pass0: init()              <- should be cd0
(K3bDevice::openDevice) open device /dev/cd0 failed.   <- should be pass0

Your patch would make init run on your system but break it on other systems. 
Furthermore other things won't work on your system as well (if cdX is 
expected).

I would recommend to look at K3bDevice::DeviceManager::BSDDeviceScan(). 
Obvioulsy in FreeBSD 8 the cam has changed and the devices might be ordered 
differently. The code you see there was initially taken from the camcontrol 
sources, so looking, what "camcontrol devlist" in its sources does is a good 
start. I guess, that something has changed here since FreeBSD 7.x A fix 
should make sure, that device->m_passDevice always points to a passX and 
cddev to the cdX.

> 2. Without this k3b doesn't find cdrecord and mkisofs (what Jason said). It 
looks
> that if k3b doesn't find cdrecord at the first path it tries (in my case it 
was

Which k3b version you are working on?


Best regards,


Heiner


More information about the kde-freebsd mailing list