By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 1625

Summary: tdehwlib dbus daemon does not work
Product: TDE Reporter: Slávek Banko <slavek.banko>
Component: tdelibsAssignee: Timothy Pearson <kb9vqf>
Status: RESOLVED INVALID    
Severity: critical CC: bugwatch, darrella, fatzer2, kb9vqf, slavek.banko
Priority: P5    
Version: R14.0.0 [Trinity]   
Hardware: All   
OS: Linux   
Compiler Version: TDE Version String:
Application Version: Application Name:

Description Slávek Banko 2013-08-12 20:28:47 CDT
I noticed that tdehwlib dbus daemon is not running, although it is properly installed. When I tried to check it via dbus-send, I got the answer:

Error org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1

When I tried to run it manually in the console, the crash not occurred, but apparently not implemented parts that might be useful:

[tde_dbus_hardwarecontrol] Unknown method 'NameAcquired' called on interface 'org.freedesktop.DBus', ignoring
[tde_dbus_hardwarecontrol] Unknown method 'Introspect' called on interface 'org.freedesktop.DBus.Introspectable', ignoring

Setting the brightness and governor therefore cannot work.
Comment 1 Darrell 2013-08-12 20:56:15 CDT
What is the dbus-send comand you used?
Comment 2 Slávek Banko 2013-08-12 21:12:24 CDT
(Odpověď na komentář #1)
> What is the dbus-send comand you used?

dbus-send is from dbus package. See:
http://dbus.freedesktop.org/doc/dbus-send.1.html

Some examples on:
http://upower.freedesktop.org/docs/UPower.html

A very useful tool is also d-feet:
https://wiki.gnome.org/DFeet
Comment 3 Darrell 2013-08-12 21:22:31 CDT
Yes, but what is the exact command syntax you used to test tdehwlib?

Also what usability symptoms are you seeing? I'm not noticing anything unsual.
Comment 4 Timothy Pearson 2013-08-12 23:32:32 CDT
The daemon does not provide introspection functionality as it is not needed when called from the TDE hardware library.  Therefore, this is not so much a bug report as it is a feature request to add introspection support to the daemon. ;-)
Comment 5 Slávek Banko 2013-08-13 01:54:13 CDT
The fact that the demon does not offer information interfaces is now less important. The fundamental problem is that the demon certainly not running.

# dbus-send --system --print-reply \
   --dest=org.trinitydesktop.hardwarecontrol \
   /org/trinitydesktop/hardwarecontrol \
   org.trinitydesktop.hardwarecontrol.CPUGovernor.CanSetCPUGovernor \
   int32:0

Error org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1


When I run the daemon manually, I get another error message:

Error org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.84" (uid=0 pid=5031 comm="dbus-send) interface="org.trinitydesktop.hardwarecontrol.CPUGovernor" member="CanSetCPUGovernor" error name="(unset)" requested_reply=0 destination="org.trinitydesktop.hardwarecontrol" (uid=0 pid=5021 comm="/opt/trinity/bin/tde_dbus_hardwarecontrol))
Comment 6 Darrell 2013-08-13 10:05:23 CDT
Here is what I see in konsole:

dbus-send --system --print-reply --dest=org.trinitydesktop.hardwarecontrol /org/trinitydesktop/hardwarecontrol org.trinitydesktop.hardwarecontrol.CPUGovernor.CanSetCPUGovernor int32:0

method return sender=:1.14 -> dest=:1.13 reply_serial=2
   boolean true

I'm running git as of commit 3c06aad1 2013-08-11. I have not rebuilt tdelibs with the recent WITH_TDEHWLIB_DAEMONS changes.
Comment 7 Darrell 2013-08-13 10:34:42 CDT
Note: after starting Trinity, I see the following in my process list in konsole:

/opt/trinity/bin/tde_dbus_hardwarecontrol
Comment 8 Darrell 2013-08-13 10:58:06 CDT
> Note: after starting Trinity, I see the following in my process list in konsole:
Oops, my mistake. That was after I ran the previous dbus-send command. Apparently after I logged out of Trinity back to the command line, the tde_dbus_hardwarecontrol process did not terminate. Thus when I restarted Trinity the process seemed to have started but was actually still running from the previous session.

Should tde_dbus_hardwarecontrol terminate when Trinity is not running anywhere?
Comment 9 Slávek Banko 2013-08-13 11:02:49 CDT
Ha, for you it behaves as it should! Exiting system service tde_dbus_hardwarecontrol is a matter for dbus.
Comment 10 Darrell 2013-08-16 15:23:53 CDT
I just noticed tdelibs CMakeLists.txt has a build option WITH_TDEHWLIB_DAEMONS that defaults to ${WITH_ALL_OPTIONS}, which defaults to OFF. Therefore I was never building tdelibs to use that option. Rebuilding now....

Slavek, do you have that build option enabled?
Comment 11 Darrell 2013-08-16 17:04:56 CDT
>I noticed that tdehwlib dbus daemon is not running, although it is properly installed.

Tim,

When should we see the tde_dbus_hardwarecontrol in the process tree? I just rebuilt tdelibs, with WITH_ALL_OPTIONS=ON, which means WITH_TDEHWLIB_DAEMONS=ON.

I do not see tde_dbus_hardwarecontrol in the process tree unless I run the dbus-send command, basically forcing a query of the daemon. Is that normal/expected? Is tde_dbus_hardwarecontrol someting that runs on demand? If yes, what kind of demands launches tde_dbus_hardwarecontrol?
Comment 12 Timothy Pearson 2013-08-16 18:31:53 CDT
Yes, what you are seeing is normal.  DBUS itself loads the daemon when a request is made; the daemon then stays loaded until system shutdown.  This is one of the primary reasons for high DBUS latency on the first call to some daemons. :-)
Comment 13 Slávek Banko 2013-08-16 18:42:14 CDT
(Odpověď na komentář #10)
> I just noticed tdelibs CMakeLists.txt has a build option WITH_TDEHWLIB_DAEMONS
> that defaults to ${WITH_ALL_OPTIONS}, which defaults to OFF. Therefore I was
> never building tdelibs to use that option. Rebuilding now....
> 
> Slavek, do you have that build option enabled?

Yes, WITH_TDEHWLIB_DAEMONS is enabled, the daemon is built, it is installed but not working => as I wrote in a comment 0.

I have a test machine with Debian Squeeze.
Comment 14 Darrell 2013-08-16 19:29:17 CDT
>Yes, what you are seeing is normal.
Ok, now we know.

What kind of events will trigger tde_dbus_hardwarecontrol?
Comment 15 Timothy Pearson 2013-08-16 22:36:13 CDT
(In reply to comment #14)
> >Yes, what you are seeing is normal.
> Ok, now we know.
> 
> What kind of events will trigger tde_dbus_hardwarecontrol?

Requests to change CPU frequency or screen brightness.
Comment 16 Darrell 2013-08-16 22:49:36 CDT
>Requests to change CPU frequency or screen brightness.
Then perhaps I'm seeing the same thing as Slavek. When I test tdepowersave and the screen auto dims I don't see tdehardwarecontrol in the process list.
Comment 17 Darrell 2013-08-17 20:14:05 CDT
tdehardwarecontrol now appears regularly in my process list when I run tdepowersave. This is across reboots.
Comment 18 Slávek Banko 2013-08-22 11:41:18 CDT
I tried dbus-daemon run from the console to see the output:

[tde_dbus_hardwarecontrol] Listening...
[tde_dbus_hardwarecontrol] Name request failed with error 'Rejected send message, 2 matched rules; type="method_call", sender=":1.1" (uid=0 pid=8424 comm="dbus-send) interface="org.trinitydesktop.hardwarecontrol.CPUGovernor" member="CanSetCPUGovernor" error name="(unset)" requested_reply=0 destination="org.trinitydesktop.hardwarecontrol" (uid=0 pid=8426 comm="/opt/trinity/bin/tde_dbus_hardwarecontrol))'
[tde_dbus_hardwarecontrol] Not primary owner (-1), exiting!
Comment 19 Slávek Banko 2013-08-22 12:18:55 CDT
I see. I tested call dbus-send as root from ssh console. When I tried to call as a regular user of X console daemon is started and provides answers.

When I tried in /etc/dbus-1/system.d/org.trinitydesktop.hardwarecontrol.conf add rules to allow send also for <policy user="root">, daemon is started and provide answers also for the root in ssh console.

I assume that the default setting that allows sending only for <policy at_console="true"> is so intentionally. So this bug probably can be closed?
Comment 20 Timothy Pearson 2013-08-22 15:28:31 CDT
(In reply to comment #19)
> I assume that the default setting that allows sending only for <policy
> at_console="true"> is so intentionally. So this bug probably can be closed?

Yes, this is intentional.  Only people sitting at the local machine should be able to change the brightness/CPU frequency governor settings.

Tim
Comment 21 Slávek Banko 2013-08-22 18:15:19 CDT
(Odpověď na komentář #20)
> (In reply to comment #19)
> > I assume that the default setting that allows sending only for <policy
> > at_console="true"> is so intentionally. So this bug probably can be closed?
> 
> Yes, this is intentional.  Only people sitting at the local machine should be
> able to change the brightness/CPU frequency governor settings.
> 
> Tim

Yes, I understand.

The fact that will be decency to define methods NameAcquired and Introspect are not subject to this bug report, which can therefore be closed.