# K3b - "No optical drive found."



## StreetDancer (May 29, 2017)

When launching K3b "The CD and DVD Kreator" in LXDE. I am receiving an error message box that says "No optical drive found." , along with "Make sure HAL daemon is running, it is used by K3b for finding devices." 

In regards to the HAL daemon; It was required for getting LXDE to run properly when I first installed in FreeBSD 11 and same with 12-Current (Which I am using now.) 

So I don't understand how it would be the HAL daemon. Since it is running and at boot time.

Any guidance would be greatly appreciated.


----------



## aragats (May 29, 2017)

First of all you're using FreeBSD 12, see: Topics about unsupported FreeBSD versions.
It's not unexpected that something is not working properly.

Secondly, sysutils/k3b-kde4 is just a front end to sysutils/cdrtools. So try using cdrecord(1) directly from the command line, e.g. try running `cdrecord -scanbus` to check if it can find devices. You can always set your device manually in /usr/local/etc/cdrecord.


----------



## StreetDancer (May 29, 2017)

aragats,

Thank you for the information. Like I said earlier, I also had this problem in FreeBSD 11. However, I ran the following and this is the output:

`cdrecord -scanbus`


```
Cdrecord-ProDVD-ProBD-Clone 3.01 (amd64-unknown-freebsd12.0) Copyright (C) 1995-2015 Joerg Schilling
Using libscg version 'schily-0.9'.
scsibus0:
   0,0,0     0) '' '' '' NON CCS Disk
   0,1,0     1) *
   0,2,0     2) *
   0,3,0     3) *
   0,4,0     4) *
   0,5,0     5) *
   0,6,0     6) *
   0,7,0     7) *
scsibus1:
   1,0,0   100) 'HL-DT-ST' 'DVD+-RW GA31N   ' 'A200' Removable CD-ROM
   1,1,0   101) *
   1,2,0   102) *
   1,3,0   103) *
   1,4,0   104) *
   1,5,0   105) *
   1,6,0   106) *
   1,7,0   107) *
scsibus3:
   3,0,0   300) '' '' '' NON CCS Disk
   3,1,0   301) *
   3,2,0   302) *
   3,3,0   303) *
   3,4,0   304) *
   3,5,0   305) *
   3,6,0   306) *
   3,7,0   307) *
```

How do I go about taking the data output from "scibus1" and configuring it into the cdrecord?


----------



## aragats (May 29, 2017)

You can follow the examples in /usr/local/etc/cdrecord.sample or just add a line to /usr/local/etc/cdrecord:
	
	



```
CDR_DEVICE=1,0,0
```


----------



## StreetDancer (May 29, 2017)

aragats,

Thank you kindly sir. That makes perfect sense. However, after saving this and restarting K3b, it's still displaying the same error. Do I need to restart any service to make it update?

Best Regards,

Brandon


----------



## aragats (May 29, 2017)

The services involved are _*hald*_ and _*dbus*_, you may try restarting it, but I'm doubting they communicate with cdrecord somehow.
I haven't used k3b for more than 12 years, but I remember there used to be a permission issue, the error reported may be not correct. It used to use _burning_ group or so.
Try running k3b as root to check it's indeed a permissions problem.


----------



## StreetDancer (May 29, 2017)

aragats,

12 years, wow. What are you using these days? Do you have a recommendation for something better?

I ran the command:

`k3b` from root and received the following error output:


```
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
unnamed app(93057): KUniqueApplication: Cannot find the D-Bus session server:  "Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken."

unnamed app(88570): KUniqueApplication: Pipe closed unexpectedly.
```

What would be the best approach to handling this error without restarting my entire laptop? I have lots going on 

Thanks again for all the assistance. I'm learning lots and enjoying talking with a Vet like yourself.

Best Regards,

Brandon


----------



## phoenix (May 29, 2017)

What are the permissions on the /dev/cd* files?  You need write permission on that device in order for K3B (or any burning software) to work.  Generally, this is done by adding a stanza to the /etc/devfs.conf file:

```
own  /dev/cd0  root:operator
perm /dev/cd0  660
link cd0       cdrom
```
That will link /dev/cdrom to /dev/cd0, set the ownership to *root* and group to *operator*, and change permission to allow read/write to the owner and the group and no one else.  Feel free to change the group to something else, or even to set the permissions to 666 if you want any user to be able to write to it.

While you can run the rc.d script to restart devfs and pick up the changes, it's easier to just reboot, as that gets HALd and dbus and kio and everything else restarted properly as well.

Then, in K3B, you can point it to either the link /dev/cdrom or the device node itself /dev/cd0

(Obviously, change cd0 to whatever cd? actually shows on your system.)


----------



## aragats (May 29, 2017)

StreetDancer said:


> What are you using these days? Do you have a recommendation for something better?


Well, when you start understanding how the stuff work at the lower level, you don't need those GUI applications anymore ;-)
I have a couple of shell scripts to write data and audio CD/DVDs .


----------



## StreetDancer (May 29, 2017)

phoenix said:


> What are the permissions on the /dev/cd* files?  You need write permission on that device in order for K3B (or any burning software) to work.  Generally, this is done by adding a stanza to the /etc/devfs.conf file:
> 
> ```
> own  /dev/cd0  root:operator
> ...



phoenix,

Thank you very much for that information and steps to take to ensure it's working properly in X. Your time is appreciated. I will give those steps a shot. 

Best Regards,

Brandon


----------



## StreetDancer (May 29, 2017)

aragats said:


> Well, when you start understanding how the stuff work at the lower level, you don't need those GUI applications anymore ;-)
> 
> aragats,
> 
> I have a couple of shell scripts to write data and audio CD/DVDs .


I will for sure have to learn; shell scripting is on my list of things that I am planning on learning and utilizing on a daily basis. I just recently switched over from OpenSuse LEAP 42.2. So the heavy command line; while awesome, still is a learning curve for me. You should see me with my notebooks and tabs for all the BSD's and their commands, and configuration locations, etc. It's just a matter of time before I will be fluent. 

Thank you for the encouragement of dropping GUI applications. I'm looking forward to that day!

Best Regards, 

Brandon


----------



## aragats (May 29, 2017)

StreetDancer , here are some simple scripts. Those are for bash(1) since I use bash much for work, but it's not a part of the base FreeBSD.
	
	



```
#!/usr/local/bin/bash
# create an audio CD from .wav files supplied as the script's arguments
# e.g. <this_script> path/to/my/songs/*.wav

cdrecord -v speed=8 -pad -audio $*
```


```
#!/usr/local/bin/bash
# create an audio CD from .mp3 files in current directory

for i in *.mp3
do
    mpg123 --cdr - "$i" | cdrecord -v speed=8 -audio -pad -nofix -
done
cdrecord -fix
```


```
#!/usr/local/bin/bash
# create a data CD/DVD
# e.g. <this_script> path/to/dir

FS_CMD="/usr/local/bin/mkisofs -R -l -joliet-long -iso-level 3"
FIFO=128m
REC_CMD="/usr/local/bin/cdrecord -v fs=$FIFO"
BLOCKS=`$FS_CMD -print-size -quiet "$@"`
MB=$(($BLOCKS/512))

getch ()     # gets one char from kbd, no "Enter" necessary
{
    OLD_STTY=`stty -g`
    stty cbreak -echo
    GETCH=`dd if=/dev/tty bs=1 count=1 2>/dev/null`
    stty $OLD_STTY
}

echo -e \\nAre you about recording the following file\(s\):\\n\\n"$@"\\n\\n$BLOCKS blocks = ${MB} MB? Press y/N

getch
case $GETCH
    in
       Y|y) $FS_CMD "$@" | $REC_CMD tsize=${BLOCKS}s -  ;;
       *) echo -e "\\nNot sure? Quiting. See you later.\\n" ;;
esac
```


----------



## StreetDancer (May 30, 2017)

aragats,

Awesome share! I was looking at bash tutorials just a last week or so. I can understand quite a bit of those.It's nice to see a working example of how they can be used to simplify Unix tasks. Thanks you kindly for sharing your scripts with me. 

Best Regards,

Brandon


----------



## StreetDancer (May 31, 2017)

phoenix said:


> What are the permissions on the /dev/cd* files?  You need write permission on that device in order for K3B (or any burning software) to work.  Generally, this is done by adding a stanza to the /etc/devfs.conf file:
> 
> ```
> own  /dev/cd0  root:operator
> ...



Phoenix,

I just want to let you know that after setting those 3 lines on /etc/devd.conf ... after restarting my system last night my USB mouse and my Network would not work at all.

I ended up having to take a screen shot with my camera of the boot error and nano the lines off to get it to boot back up normally today.

So either I was supposed to change some variables in those lines (That I don't understand at this point.) , or for some reason on 12-Current it doesn't work and causes other problems.

Best Regards,

Brandon


----------



## aragats (May 31, 2017)

I guess the correct file is /etc/devfs.conf.
The man page devfs.conf(5) explains everything very well.


----------



## phoenix (May 31, 2017)

aragats said:


> I guess the correct file is /etc/devfs.conf.
> The man page devfs.conf(5) explains everything very well.



Argh!  Crap.  You're right.  I copied from the correct file on my FreeBSD box, but wrote the wrong filename in my post.  

/etc/dev*fs*.conf NOT /etc/dev*d*.conf


----------



## StreetDancer (Jun 2, 2017)

phoenix said:


> Argh!  Crap.  You're right.  I copied from the correct file on my FreeBSD box, but wrote the wrong filename in my post.
> 
> /etc/dev*fs*.conf NOT /etc/dev*d*.conf


phoenix,

Thank you for the update! I have put those 3 lines in /etc/devfs.conf ; however I am still receiving the same error message when opening K3B.

And this time the mouse and network worked just fine after reboot! Thanks


----------

