Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 199940 - sys-apps/hal-0.5.9.1-r3: cdrom is not detected and doesn't send any events
Summary: sys-apps/hal-0.5.9.1-r3: cdrom is not detected and doesn't send any events
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Project Gentopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-22 03:06 UTC by Dima Ryazanov
Modified: 2007-12-06 06:03 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dima Ryazanov 2007-11-22 03:06:20 UTC
HAL stopped detecting my cdrom drive, and won't send notifications when a CD is inserted or removed. I can't see the CD if I open media:/ in Konqueror, and it doesn't appear when I run "lshal". (USB storage devices work fine, though.)

I can still mount it manually (as root). I'm not sure when this happened - whether it's new HAL, or new kernel, etc.

Once in a while, the CD actually appears after I restart my computer - but then it doesn't disappear when ejected. Also, in Konqueror's media:/, it has a hard drive icon, and not a CD one.

Some possibly irrelevant facts: I had links /dev/cdrom2 and /dev/cdrw2, but not /dev/cdrom and /dev/cdrw; my cdrom drive was listed three times in /etc/udev/rules.d/70-persistent-cd.rules.


Reproducible: Always

Steps to Reproduce:
1. Insert CD

Actual Results:  
Nothing happens

Expected Results:  
HAL should send an event, KDE should show a notification, etc.

lshal does mention the cdrom driver, but not the device itself (/dev/hdc):

udi = '/org/freedesktop/Hal/devices/pci_1106_571_ide_1_0'
  ide.channel = 0  (0x0)  (int)
  ide.host = 1  (0x1)  (int)
  info.bus = 'ide'  (string)
  info.linux.driver = 'ide-cdrom'  (string)
  info.parent = '/org/freedesktop/Hal/devices/pci_1106_571'  (string)
  info.product = 'IDE device (master)'  (string)
  info.subsystem = 'ide'  (string)
  info.udi = '/org/freedesktop/Hal/devices/pci_1106_571_ide_1_0'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'ide'  (string)
  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:11.1/ide1/1.0'  (string)


Contents of /proc/sys/dev/cdrom/info:

CD-ROM information, Id: cdrom.c 3.20 2003/12/17

drive name:             hdc
drive speed:            40
drive # of slots:       1
Can close tray:         1
Can open tray:          1
Can lock tray:          1
Can change speed:       1
Can select disk:        0
Can read multisession:  1
Can read MCN:           1
Reports media changed:  1
Can play audio:         1
Can write CD-R:         1
Can write CD-RW:        1
Can read DVD:           1
Can write DVD-R:        1
Can write DVD-RAM:      0
Can read MRW:           1
Can write MRW:          1
Can write RAM:          1


emerge --info:

Portage 2.1.3.19 (default-linux/x86/2007.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.23-gentoo i686)
=================================================================
System uname: 2.6.23-gentoo i686 AMD Athlon(tm) XP 2000+
Timestamp of tree: Thu, 22 Nov 2007 02:00:01 +0000
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r6
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.23-r1
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=athlon-xp -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS=" http://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://cudlug.cudenver.edu/gentoo/ http://mirror.usu.edu/mirrors/gentoo/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ "
LC_ALL="en_US.UTF-8"
LINGUAS="en uk ru"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac aalib acl acpi alsa ao avi bitmap-fonts cairo cdr cli cracklib crypt cups dbus dlloader dri dv dvd dvdr dvdread emboss encode fam firefox fortran gdbm gif glut gpm gstreamer hal iconv imlib ipv6 isdnlog jpeg kde kdeenablefinal kdehiddenvisibility kdrive lm_sensors mad midi mikmod mmx mmxext mng mp3 mpeg mudflap ncurses nls nptl nptlonly nsplugin ogg openexr opengl openmp pam pcre pdf perl png ppds pppd python qt3 qt3support qt4 quicktime rdesktop readline reflection samba scanner sdl session slang spell spl sse ssl svg tcpd tetex tiff truetype truetype-fonts type1-fonts udev unicode usb vorbis wifi win32codecs x86 xcb xcomposite xine xinerama xml xorg xscreensaver xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="mouse keyboard evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en uk ru" USERLAND="GNU" VIDEO_CARDS="radeon ati"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Doug Goldstein (RETIRED) gentoo-dev 2007-11-24 04:00:49 UTC
Can you post the result of:

hal-device `hal-find-by-property --key 'block.device' --string '/dev/hdc'`
Comment 2 Dima Ryazanov 2007-11-24 04:26:37 UTC
I got this output - both with and without a CD in the drive:

udi = '/org/freedesktop/Hal/devices/storage_model_PIONEER_DVD_RW_DVR_108'
  storage.media_check_enabled = false  (bool)
  storage.firmware_version = '1.10'  (string)
  storage.removable.media_available = false  (bool)
  storage.size = 0  (0x0)  (uint64)
  storage.hotpluggable = false  (bool)
  block.storage_device = '/org/freedesktop/Hal/devices/storage_model_PIONEER_DVD_RW_DVR_108'  (string)
  storage.bus = 'ide'  (string)
  block.major = 22  (0x16)  (int)
  block.is_volume = false  (bool)
  storage.drive_type = 'disk'  (string)
  info.capabilities = { 'storage', 'block' } (string list)
  info.udi = '/org/freedesktop/Hal/devices/storage_model_PIONEER_DVD_RW_DVR_108'  (string)
  storage.no_partitions_hint = false  (bool)
  linux.hotplug_type = 3  (0x3)  (int)
  storage.model = 'PIONEER_DVD-RW_DVR-108'  (string)
  storage.originating_device = '/org/freedesktop/Hal/devices/pci_1106_571_ide_1_0'  (string)
  storage.requires_eject = false  (bool)
  linux.sysfs_path = '/sys/block/hdc'  (string)
  storage.physical_device = '/org/freedesktop/Hal/devices/pci_1106_571_ide_1_0'  (string)
  info.category = 'storage'  (string)
  storage.automount_enabled_hint = true  (bool)
  storage.removable = true  (bool)
  info.parent = '/org/freedesktop/Hal/devices/pci_1106_571_ide_1_0'  (string)
  block.device = '/dev/hdc'  (string)
  block.minor = 0  (0x0)  (int)
  storage.vendor = ''  (string)

Then I restarted hal, with the CD in the drive, and tried again. I started getting this (both with and without a CD):

udi = '/org/freedesktop/Hal/devices/volume_label_Fedora_7_KDE_Live_i386'
  block.minor = 0  (0x0)  (int)
  org.freedesktop.Hal.Device.Volume.method_names = { 'Mount', 'Unmount', 'Eject' } (string list)
  volume.ignore = false  (bool)
  volume.label = 'Fedora-7-KDE-Live-i386'  (string)
  info.capabilities = { 'volume', 'block' } (string list)
  volume.is_partition = false  (bool)
  volume.mount_point = ''  (string)
  info.category = 'volume'  (string)
  info.product = 'Fedora-7-KDE-Live-i386'  (string)
  volume.is_disc = false  (bool)
  volume.is_mounted = false  (bool)
  block.is_volume = true  (bool)
  volume.linux.is_device_mapper = false  (bool)
  block.storage_device = '/org/freedesktop/Hal/devices/storage_model_PIONEER_DVD_RW_DVR_108'  (string)
  info.parent = '/org/freedesktop/Hal/devices/storage_model_PIONEER_DVD_RW_DVR_108'  (string)
  volume.block_size = 2048  (0x800)  (int)
  volume.num_blocks = 1405976  (0x157418)  (int)
  volume.fsversion = ''  (string)
  block.device = '/dev/hdc'  (string)
  volume.uuid = ''  (string)
  volume.fsusage = 'filesystem'  (string)
  volume.is_mounted_read_only = false  (bool)
  org.freedesktop.Hal.Device.Volume.method_argnames = { 'mount_point fstype extra_options', 'extra_options', 'extra_options' } (string list)
  info.interfaces = { 'org.freedesktop.Hal.Device.Volume' } (string list)
  storage.model = ''  (string)
  volume.size = 719859712  (0x2ae83000)  (uint64)
  info.udi = '/org/freedesktop/Hal/devices/volume_label_Fedora_7_KDE_Live_i386'  (string)
  volume.mount.valid_options = { 'ro', 'sync', 'dirsync', 'noatime', 'nodiratime', 'noexec', 'quiet', 'remount', 'exec', 'utf8', 'uid=', 'mode=', 'iocharset=' } (string list)
  org.freedesktop.Hal.Device.Volume.method_signatures = { 'ssas', 'as', 'as' } (string list)
  block.major = 22  (0x16)  (int)
  volume.fstype = 'iso9660'  (string)
  org.freedesktop.Hal.Device.Volume.method_execpaths = { 'hal-storage-mount', 'hal-storage-unmount', 'hal-storage-eject' } (string list)
  volume.unmount.valid_options = { 'lazy' } (string list)
  linux.hotplug_type = 3  (0x3)  (int)
  linux.sysfs_path = '/sys/block/hdc/fakevolume'  (string)

So it seems that HAL checks the state of the cdrom drive just once when it starts, and doesn't notice any changes.
Also, usually after I reboot the computer HAL doesn't mention "hdc" at all. (Maybe because I compiled ide-cd as a module, so it may not load soon enough?)
Comment 3 Doug Goldstein (RETIRED) gentoo-dev 2007-11-24 15:09:05 UTC
storage.media_check_enabled = false  (bool) is the key piece of information here. You have manually configured HAL not to check for media. Your CD-ROM drive is detected just fine and HAL is behaving as you have instructed it. Now I say you have instructed it assuming that you don't have one of the very rare few drive models that is known to be broken with media detection and HAL is hardcoded to never allow checking that drive.

Whether you used powertop (Intel's power usage tool) or whether you used hal-disable-polling or some other tool to disable it, I can't tell you. But the solution is simple:

hal-disable-polling --enable-polling --device /dev/hdc

And you'll be set.
Comment 4 Dima Ryazanov 2007-11-24 22:27:37 UTC
I don't think I've used any such tool... When I ran "hal-disable-polling --enable-polling --device /dev/hdc", I got:

Cannot find fdi file /etc/hal/fdi/information/media-check-disable-storage_model_PIONEER_DVD_RW_DVR_108.fdi. Perhaps polling wasn't disabled using this tool?

The /etc/hal/fdi/information/ directory doesn't have anything besides .keep_sys-apps_hal-0.
Comment 5 Kevin Parent 2007-12-03 18:27:58 UTC
Had the same problem.  Enabling "legacy /proc/ide/ support" in the kernel solved the problem.  It's under Device Drivers->ATA/ATAPI/MFM/RLL support.

Hope this helps.
Comment 6 Dima Ryazanov 2007-12-06 06:03:37 UTC
Oh nice, that fixed it. Thanks!