hal does not properly enumerate USB devices unless CD-ROM inserted as first device

Bug #438316 reported by Roderick B. Greening
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
devicekit-disks (Ubuntu)
Invalid
Undecided
Unassigned
hal (Ubuntu)
Invalid
Undecided
Unassigned
mountall (Ubuntu)
Invalid
Undecided
Unassigned
udev (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: hal

I have been unsuccessful in isolating this bug, but it does appear specific to this Acer I have, and not one of the other 3 models.

Karmic Alpha5 worked as expected, and HAL, DeviceKit-Disks and Solid all presented me with the USB stick when inserted and allowed me to mount via the device notifier under Kubuntu Desktop. Sometime just prior to Alpha6, this behaviour broke and has remained broken, even when testing via a live daily image (Ubuntu and Kubuntu tried).

Originally, I thought the issue specific to Kubuntu/KDE, and tried the Ubuntu Desktop, which uses DeviceKit-Disks (afaik) to handle the USB detection. This also resulted in failure.

If I disable HAL (sudo stop hal), DeviceKit-Disks sees the USB stick, and in usb-creator-kde, for example, it sees the stick and allows me to work with it. However, HAL->Solid is then unusable. I assume there are other parts which also still require HAL to work.

I am attaching some additional files and logs which may help locate the issue. It may be that mountall, or udev may be causing me this issue.

ProblemType: Bug
Architecture: amd64
Date: Mon Sep 28 15:59:11 2009
DistroRelease: Ubuntu 9.10
Package: hal 0.5.13-1ubuntu7
ProcEnviron:
 LANGUAGE=en_US:en
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-11.36-generic
SourcePackage: hal
Uname: Linux 2.6.31-11-generic x86_64

Revision history for this message
Roderick B. Greening (roderick-greening) wrote :
Revision history for this message
Roderick B. Greening (roderick-greening) wrote :
Revision history for this message
Roderick B. Greening (roderick-greening) wrote :
Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

Here is a diff between when HAL is running and when stopped. The by-disk, by-uuid, and by-path are notably missing when HAL is running. Not sure what this points to, but it is obviously preventing it from working.

Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

dmesg output showing the device being inserted and being picked up.

Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

One thing I am noticing (maybe its important) is that each time I remove and insert and USB stick, the "Attached scsi generic sg3 type 0" device is incremented by one (started at 7, then 8 then 9) - so it shows "sd 9:0:0:0: Attached scsi generic sg3 type 0" currently. Maybe this is irrelevant.

Revision history for this message
Roderick B. Greening (roderick-greening) wrote :
Revision history for this message
Roderick B. Greening (roderick-greening) wrote :
Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

Here is a diff from the previously attached lshw output, from HAL running and not running.

I think these are the relevant bits:

                 logical name: /dev/sdc1
+ logical name: /media/WIN98

"logical name" appears twice when working (i.e. no HAL)

- configuration: FATs=2 filesystem=fat
+ configuration: FATs=2 filesystem=fat mount.fstype=vfat mount.options=rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,utf8,errors=remount-ro state=mounted

And here, when HAL is not running, we get the mount options available so it can be automounted. Without these, it will not automount.

summary: - hal does not properly present USB media on Acer Aspire 6930
+ hal does not properly enumerate USB devices unless CD-ROM inserted as
+ first device
Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

I've updated the description as I have now narrowed it further.

If I insert a CD into the system first (/dev/sr0 for example) it shows up correctly in device notifier and is mountable via that. Next, I insert any USB stick into one of the available USB ports and HAL correctly enumerates the devices.

In fact, if I use a Memorex U3 Smart USB which creates a fake CD device in addition to the USB media, this works.

So it seems that (at least on this Acer 6930) HAL is unable to enumerate the devices correctly unless there is at least one device on /dev/srX, which seems odd.

I have tried both the 32 and 64 bit images on this system and various live images including one from yesterday, along with a current up to date 64 bit system. In each case this problem exists.

Martin Pitt (pitti)
Changed in mountall (Ubuntu):
status: New → Invalid
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Closing the udev task, this sounds increasingly like a HAL issue

Changed in udev (Ubuntu):
status: New → Invalid
Revision history for this message
Martin Pitt (pitti) wrote :

Let's throw some more logging at this, maybe something will turn up. You'll need a couple of open Terminal windows for this.

Please set up the situation which fails (i. e. no CD-ROM inserted), and do not plug in the USB stick yet.

Terminal 1:
sudo /usr/lib/devicekit-disks/devkit-disks-daemon --replace > /tmp/dk-disks-debug.txt 2>&1

Terminal 2:
devkit-disks --monitor-detail > /tmp/dk-disks-monitor.txt

Terminal 3:
udevadm monitor --udev -e > /tmp/udev.txt

Terminal 4:
sudo killall hald
sudo hald --verbose=yes --daemon=no > /tmp/hal-debug.txt 2>&1

Terminal 5:
lshal -m > /tmp/lshal-monitor.txt

Now insert the USB stick and confirm that it wasn't detected. Wait a couple of seconds, then press Control-C in all five terminals. Do

  sudo hald

to start the background hal process again.

Now attach the five log files in /tmp/*.txt.

Thanks!

Changed in hal (Ubuntu):
status: New → Incomplete
Changed in devicekit-disks (Ubuntu):
status: New → Incomplete
Revision history for this message
Martin Pitt (pitti) wrote :

Another question, does hal work if you uninstall devicekit-disks? If you want to keep the package installed, you can also temporarily disable it with

  sudo killall devkit-disks-daemon
  sudo chmod 0 /usr/lib/devicekit-disks/devkit-disks-daemon

and re-enable it with

  sudo chmod 755 /usr/lib/devicekit-disks/devkit-disks-daemon

after testing.

Revision history for this message
Roderick B. Greening (roderick-greening) wrote : Re: [Bug 438316] Re: hal does not properly enumerate USB devices unless CD-ROM inserted as first device

> Another question, does hal work if you uninstall devicekit-disks? If you
> want to keep the package installed, you can also temporarily disable it
> with
>
> sudo killall devkit-disks-daemon
> sudo chmod 0 /usr/lib/devicekit-disks/devkit-disks-daemon
>
> and re-enable it with
>
> sudo chmod 755 /usr/lib/devicekit-disks/devkit-disks-daemon
>
> after testing.
>

It doesn't seem as though devkit-disks-daemon is running at the time I have
the issue. I did try the above, but no difference. The device shows up in
dmesg, but that's it.
_______________________________________
Roderick B. Greening, B.Sc.
Paradise, NL Canada
E-mail/MSN: <email address hidden>
LP: launchpad.net/~roderick-greening
Wiki: wiki.ubuntu.com/rgreening
Blog: roderick-greening.blogspot.com
Twitter: twitter.com/rgreening
Identica: identi.ca/rgreening

Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

> Let's throw some more logging at this, maybe something will turn up.
> You'll need a couple of open Terminal windows for this.
>
> Please set up the situation which fails (i. e. no CD-ROM inserted), and
> do not plug in the USB stick yet.
>
> Terminal 1:
> sudo /usr/lib/devicekit-disks/devkit-disks-daemon --replace >
> /tmp/dk-disks-debug.txt 2>&1
>
> Terminal 2:
> devkit-disks --monitor-detail > /tmp/dk-disks-monitor.txt
>
> Terminal 3:
> udevadm monitor --udev -e > /tmp/udev.txt
>
> Terminal 4:
> sudo killall hald
> sudo hald --verbose=yes --daemon=no > /tmp/hal-debug.txt 2>&1
>
> Terminal 5:
> lshal -m > /tmp/lshal-monitor.txt
>
> Now insert the USB stick and confirm that it wasn't detected. Wait a
> couple of seconds, then press Control-C in all five terminals. Do
>
> sudo hald
>
> to start the background hal process again.
>
> Now attach the five log files in /tmp/*.txt.
>
> Thanks!

Attaching the files from the test.

_______________________________________
Roderick B. Greening, B.Sc.
Paradise, NL Canada
E-mail/MSN: <email address hidden>
LP: launchpad.net/~roderick-greening
Wiki: wiki.ubuntu.com/rgreening
Blog: roderick-greening.blogspot.com
Twitter: twitter.com/rgreening
Identica: identi.ca/rgreening

Changed in devicekit-disks (Ubuntu):
status: Incomplete → Confirmed
Changed in hal (Ubuntu):
status: Incomplete → New
Changed in devicekit-disks (Ubuntu):
status: Confirmed → New
Revision history for this message
Martin Pitt (pitti) wrote :

Roderick B. Greening [2009-10-12 15:02 -0000]:
> It doesn't seem as though devkit-disks-daemon is running at the time I have
> the issue.

It's auto-spawned when something uses it. That indeed shouldn't happen
during normal KDE usage (since that uses hal). From what I can see,
the only thing in KDE which uses devicekit-disks should be the
usb-creator.

> I did try the above, but no difference. The device shows up in
> dmesg, but that's it.

Thanks for testing. So it seems it's indeed isolated to hal.

Revision history for this message
Martin Pitt (pitti) wrote :

That looks strange indeed. There are tons and tons of change events for the CD-ROM (/dev/sr0) before and after udev/dk-disks finally see /dev/sdc1 (RW047SDHC Reader).

 * Is the USB stick you mention indeed an SD card reader?

 * Did you really fiddle with the CD so much for this test, or is it a strange side effect?

 * Do you happen to have any of those devices in /etc/fstab ? (It ideally should only contain the fixed HD partitions which are required for Kubuntu)

 * Can you please attach /var/log/kern.log after this?

Changed in hal (Ubuntu):
status: New → Incomplete
Changed in devicekit-disks (Ubuntu):
status: New → Invalid
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as requested in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the "Status" column, and change the status back to "New". Thanks again!

Changed in hal (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.