Author Topic: 1204/1404 HAL replacement !!! Please read!  (Read 6563 times)

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
1204/1404 HAL replacement !!! Please read!
« on: March 21, 2015, 02:19:48 am »
Hey there LMCE'ers!   :o

A major change within the linux community has driven a need for a change to the hardware detection methods within the lmce smart home automation system.  This change will affect all users of LMCE1204 (Ubuntu Precise) and up, including the pre-pre-alpha LMCE1404 (Ubuntu Trusty).

The linux community dropped support for hald (the hal daemon) which provided hardware detection events and information to applications, including lmce, for many years.  This change happened about 4 years ago.  LMCE has been sheltered from the changes because Ubuntu has maintained support for hald through the 1204 LTS release.  As of Ubuntu 1404 LTS hald has been discontinued completely.

In order to maintain our level of automatic hardware detection, and ultimately improve it beyond its' current capabilities, hal detection is being replaced with udev based device detection with appropriate device detected/removed event notifications for dcerouter.

udev is the hardware event notification system that has replaced the hald (hal daemon) in the general linux community.  udev has been incorporated into the new systemd (system daemon) which is becoming the standard for boot managment and service launching under the linux kernel.  LMCE will also support systemd launching in the near future.

In the next few days we will be pushing an updated version of the HAL daemon that linuxmce uses to detect devices.  The HAL daemon was named for its interface to the hald.  The updated version of our HAL daemon will now interface with udev directly rather than hald.  The package in question is "pluto-hald".  At the moment the pkg name will not change to avoid issues with upgrades.  Eventually the package name will change to reflect the new "lmce-" package naming convention.

Once the update is deployed you will need to
Code: [Select]
apt-get update
apt-get dist-upgrade
your lmce core and MD devices to receive the new device detection system.  I am doing everything I can to mitigate issues that people may encounter during this upgrade process and I can offer the following observations so far:
  • Some devices may trigger the Setup Wizard to appear.  This is usually the Wizard confirming that the new device is actually the old device.  i.e.  My Zwave dongle is re-detected (due to changes in device identification) but recognizes that it is actually the old (original) device and simply requests confirmation of that fact.
  • GSD devices may need to have their serial ports reset (as they may be lost) and saved, followed by a router reload.  No issues have been observed after this with serial devices.

As always we ask you to remember that this is ongoing alpha software with very few developers contributing.  If you have any issues please file tickets in the trac system (contact posde in IRC for credentials).  Please watch http://wiki.linuxmce.org/index.php/LinuxMCE-1204_pre-alpha to follow changes to the 1204 development version, including when this change hits release.

Thanks everyone and enjoy LinuxMCE!

(J.)ason
« Last Edit: March 23, 2015, 06:07:06 am by phenigma »

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3675
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #1 on: March 22, 2015, 06:38:08 pm »
Jason,

I'm up-to-date with all the latest packages, and haven't seen any ill behavior so far.

Great job!

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #2 on: March 23, 2015, 05:52:05 am »
Excellent!  Thank you.  Please keep me apprised of any ill behaviour you may experience.   :D

Jason.

maverick0815

  • Administrator
  • wants to work for LinuxMCE
  • *****
  • Posts: 858
    • View Profile
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #3 on: March 25, 2015, 08:18:21 pm »
I don't know, if this is really related, but since the update, I noticed some decrease in performance, qorbiter takes long to load and display the viewpoint.....also internet access seems slower. I checked my connection in the fritzbox...there it's fine.

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #4 on: March 25, 2015, 08:39:00 pm »
There is no way that the new HAL could affect performance of your system.  qOrbiter is under a lot of changes atm and HAL is completely unrelated to it.  There is no affect that HAL could have on your internet connection either.  Talk to golgo about the qOrbiter issues in the qOrbiter thread.

To be sure you can always check if HAL is chewing cpu using top at the command line, but it sits consistently at 0% cpu usage on all my test systems, including rpi1 & rpi2.

J.

maverick0815

  • Administrator
  • wants to work for LinuxMCE
  • *****
  • Posts: 858
    • View Profile
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #5 on: March 25, 2015, 11:42:52 pm »
I have no more access to my drives in the core...
Phenigma was so kind as to try to assist me. I will attach the output file generated by HAL, until it terminated. Maybe this will help.

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #6 on: March 25, 2015, 11:46:50 pm »
Thanks Mav, I'll check the output and get a fix out asap.

J.

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #7 on: March 26, 2015, 04:03:53 am »
The fix for this issue is in the repo.
Code: [Select]
apt-get update
apt-get upgrade
will bring the fix.

It's probable that this is not the only/last issue.  Please report back any other issues or crashes of the Hardware Abstraction Layer.  I will be sure to help fix things as quickly as possibe.

Some tips if you're having issues:
Code: [Select]
ps ax | grep HAL
should show multiple lines of output.  If you only get one line, then hal is not running and has likely crashed for some reason (most likely my incompetence as a programmer :P ).

If you're running on the core and through the test above you determine that HAL is not running.  Please do the following:
Edit /etc/pluto.conf and add ",34,35" to the LogLevels= variable.
Reload the DCERouter.
Then:
Code: [Select]
/usr/pluto/bin/HAL -d 16 -r localhost | tee out.txt
If you didn't see HAL running earlier then I expect this might crash. 

If it crashes... and only if it crashes please pastebin the output file 'out.txt' by running:
Code: [Select]
pastebinit out.txt
That will paste the complete output of the HAL daemon up until the possible crash and likely point me directly to the problem with extremely specific information ;).

Thanks for helping troubleshoot this one Mav!  Seemingly un-related missing hard drives brought us back to the HAL daemon changes.  I really (can't emphasize enough) REALLY appreciate the time you spent with me to figure out the problem!

J.
« Last Edit: March 26, 2015, 08:06:28 pm by phenigma »

maverick0815

  • Administrator
  • wants to work for LinuxMCE
  • *****
  • Posts: 858
    • View Profile
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #8 on: March 26, 2015, 10:36:54 am »
No need to thank me....I'm glad I can contribute at least this way. On the other hand, I still couldn't revive the drives. I'm really considering a fresh install. After a kernel upgrade on the core I always have to reinstall asterisk. Kernelupgrades on the core give me dependency errors. So many guess is, something went wrong earlier. This way we can see how the new system works on a fresh install.

maverick0815

  • Administrator
  • wants to work for LinuxMCE
  • *****
  • Posts: 858
    • View Profile
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #9 on: March 26, 2015, 01:19:01 pm »
So, I checked a little more. I removed the devices from the configuration and did a reboot. The disks were immediately recognised, but they don't get online. I tried setting them in the webadmin, but that doesn't do anything. After reboot the tick for online is gone again too.

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #10 on: March 26, 2015, 08:08:57 pm »
I'm not sure what is up there Mav.  I added an internal drive here and it was detected and stays online with both router reloads and reboots.  So I'm at a bit of a loss.  You can try running /usr/pluto/bin/StorageDevices_Radar.sh manually and see if the drives come 'online' then.

J.

maverick0815

  • Administrator
  • wants to work for LinuxMCE
  • *****
  • Posts: 858
    • View Profile
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #11 on: March 27, 2015, 12:19:34 pm »
problem solved with the ever so resourceful Phenigma :-)
only now asterisk doesn't register my phones anymore. this time reinstalling it won't do the trick anymore.
« Last Edit: March 27, 2015, 12:21:44 pm by maverick0815 »

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #12 on: March 27, 2015, 02:39:03 pm »
Glad things are working for you with the drives.  Thanks for helping to identify a hidden location that's still using hald for information, we'll have to convert autofs to use udev rather than hal.  Perhaps start another thread for the asterisk issues you're having.  I know very little about asterisk.

J.

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3675
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #13 on: March 27, 2015, 03:17:50 pm »
Grep'ing through the code shows some stuff in
Code: [Select]
pnp_detection_scripts/ZWave.sh
pnp_detection_scripts/99_PLCBUS_1141.sh
Setup_CaptureCards/CaptureCards_Setup_PVR_USB2.sh
Disk_Drive/Disk_Drive.cpp
AVWizard/scripts/AVWizard_Remote_Detect.sh
drivers/pvrusb2/driver
Powerfile_C200

I'd say the last two can be ignored. The others I am not too sure.

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: 1204/1404 HAL replacement !!! Please read!
« Reply #14 on: March 27, 2015, 04:01:53 pm »
mhm.  Okay, a couple points to look at and verify.  Silly me for thinking that device detection occurred only in the device detection system....   :P  I'll check them out.  Thanks posde.

J.