# CDROM keeps making noise on FreeBSD 8.0



## alie (Dec 12, 2009)

Hi,

I got strange problem tih my CD-ROM on FreeBSD 8.0. Everytime i boot up the CDROM keeps making noise, seems reading something...

1 thing that i observed, everytime i turn of hald_enable my CD ROM will not behave strange anymore


----------



## DutchDaemon (Dec 12, 2009)

Is the CD-ROM first in the boot order in BIOS? If it is, push it down the list.


----------



## alie (Dec 12, 2009)

DutchDaemon said:
			
		

> Is the CD-ROM first in the boot order in BIOS? If it is, push it down the list.



Nope, its the second in BIOS. 

This problem really annoying because i worried it will harm my CDROM 

Just noticed this happens only if there's a CD/DVD inside my CDROM Drive


----------



## Beastie (Dec 12, 2009)

Tell HAL to stop polling the CD drive: `# hal-disable-polling --device /dev/your_cd_device`.

And if you don't really *need* HAL, disable it once and for all.

It's near EOL so it won't bother us too much longer. Be patient.


----------



## alie (Dec 13, 2009)

Beastie said:
			
		

> Tell HAL to stop polling the CD drive: `# hal-disable-polling --device /dev/your_cd_device`.
> 
> And if you don't really *need* HAL, disable it once and for all.
> 
> It's near EOL so it won't bother us too much longer. Be patient.



Thanks it works. Btw i need HAL to make my mouse and keyboard functioning. Is there any way to make mouse and keyboard work properly without HAL ?


----------



## mickey (Dec 13, 2009)

alie said:
			
		

> Btw i need HAL to make my mouse and keyboard functioning. Is there any way to make mouse and keyboard work properly without HAL ?



Add proper _InputDevice_ sections for your mouse and keyboard to your xorg.conf, then you wont need HAL to detect them.


----------



## alie (Dec 13, 2009)

mickey said:
			
		

> Add proper _InputDevice_ sections for your mouse and keyboard to your xorg.conf, then you wont need HAL to detect them.



Is there any simple way means automatic configuration for this ? I am not familiar with xorg.conf. Is there any util that i can use to configure my setting automatically ?


----------



## mickey (Dec 13, 2009)

alie said:
			
		

> Is there any simple way means automatic configuration for this ? I am not familiar with xorg.conf. Is there any util that i can use to configure my setting automatically ?



You could try `# Xorg -configure`, which will probe all available hardware, and write out an initial config file, which you may then further customize, or copy/paste the mouse/keyboard section from it.

The _InputDevice_ sections for mouse and keyboard are also described in detail with some examples in kbd(4) and mousedrv(4).

If you need some special keyboard layout and have been using HAL until now, then you probably have most of the needed options buried in HAL's config, presumably somewhere in /usr/local/etc/hal/fdi/policy.


----------



## Beastie (Dec 13, 2009)

Some DEs may need HAL, so I don't know if this will work for you.

Close X.

Disable HAL and D-Bus:
`# /usr/local/etc/rc.d/hald forcestop`
`# /usr/local/etc/rc.d/dbus forcestop`

In /etc/X11/xorg.conf, add:

```
Section "ServerFlags"
[...]
     Option "AutoAddDevices" "FALSE"
[...]
EndSection
```
(The *ServerFlags* section will not be there by default IIRC).

You should have 2 *InputDevice* sections for the keyboard and mouse. `# Xorg -configure` will create them. The generated mouse section should look like this:

```
Section "InputDevice"
[...]
     Driver "mouse"
     Option "Protocol" "auto"
     Option "Device" "/dev/sysmouse"
[...]
EndSection
```

In /etc/rc.conf add:

```
moused_enable="YES"
```
Start the mouse daemon: `# /etc/rc.d/moused forcestart`. Move the mouse. You should now see a cursor.

Remove HAL and D-Bus from /etc/rc.conf if the whole thing worked.


----------



## alie (Dec 14, 2009)

@Beastie: My Keyboard and mouse are working fine now, but i am getting new problem after i removed HAL and DBUS from rc.conf my KDM wont allow me to login to my desktop


----------



## mickey (Dec 14, 2009)

alie said:
			
		

> @Beastie: My Keyboard and mouse are working fine now, but i am getting new problem after i removed HAL and DBUS from rc.conf my KDM wont allow me to login to my desktop



Xorg is by far not the only port, having some sort of dependency upon HAL. But you are now able to run Xorg without it needing HAL.

To get completely rid of HAL, you would have to identify all other parts that still require HAL, and recompile/install them with HAL support disabled in their options. Even then, there is a chance that with some ports HAL support is not optional, and thus cannot be disabled.

I might be wrong, but I guess disabling dbus is not such a good idea, when using a DE like KDE or Gnome.


----------



## Beastie (Dec 14, 2009)

As I said, some DEs require HAL, and I think both GNOME and KDE do. You can just reenable HAL and D-Bus and disable CD polling.
I have HAL and D-Bus installed (Xorg deps), but I just couldn't stand them anymore so I disabled them months ago.


----------

