Asus-Zenbook-Ambient-Light-Sensor-Controller icon indicating copy to clipboard operation
Asus-Zenbook-Ambient-Light-Sensor-Controller copied to clipboard

The light sensor doesn't work starting als-controller at startup as a service

Open almontic opened this issue 10 years ago • 17 comments

I successfully started als-controller at startup (the command ./als-controller -s return 1) but the screen light doesn't change, event calling again ./als-controller -e or -d. Instead, the sensor works pretty well if I start manually als-controller after the boot.

almontic avatar Aug 08 '14 12:08 almontic

Hi almontic, make sure that, at startup, als-controller is started with root privileges. Also make sure that als.ko kernel module is loaded at startup (you can verify by running lsmod|grep als).

danieleds avatar Aug 08 '14 13:08 danieleds

I put the loading of als.ko in the /etc/rc.local file and the als-controller loading in the /etc/init. They both start properly but when I try to enable/disable the sensor, simply nothing happen. But I didn't get any error

almontic avatar Aug 08 '14 13:08 almontic

Ok I don't currently have my zenbook, so I can't investigate the problem. I'll let you know in a few days. In the meantime, can you provide your kernel and os version numbers?

danieleds avatar Aug 08 '14 13:08 danieleds

Also, I suppose you checked dmesg output

danieleds avatar Aug 08 '14 13:08 danieleds

Actually I didn't, I'll try, Kernel: 3.13.0-32-generic on Ubuntu 14.04, thank you :)

almontic avatar Aug 08 '14 13:08 almontic

Hi, I've a zenbook ux32vd r3001v, the sensor's seems to work good for keyboard backlight but not for display backlight, I've linux mint debian version. Is it possible to enable the automatic control of the display backlight please? In the source code maybe the paths is different? I don't understand very good the code and comments are in spanish.

Sorry for my bad english.

And thanks you very much for this program.

HotMykeul avatar Aug 24 '14 21:08 HotMykeul

@HotMykeul, make sure you have xbacklight installed in your system.

@almontic another little bit of patience!

danieleds avatar Aug 25 '14 17:08 danieleds

The problem is in main.cpp, at the line where xbacklight is called (here). We get a return value of 256 instead of 0. Still investigating...

danieleds avatar Aug 26 '14 13:08 danieleds

I have installed xbacklight and it work perfectly now. Thanks you very much for your program

HotMykeul avatar Aug 26 '14 22:08 HotMykeul

The same problem. If I run it like this:

# sudo /usr/share/als-controller/service/als-controller

Everything is working - keyboard and backlight. But if I use custom systemd service file (from https://wiki.archlinux.org/index.php/ASUS_Zenbook_Prime_UX31A#Ambient_Light_Sensor_.28ALS.29):

# cat /etc/systemd/system/als.service
[Unit]
Description=Ambient Light Sensor Daemon

[Service]
User=root
Group=root
PIDFile=/var/run/als-controller.pid
ExecStart=/usr/share/als-controller/service/als-controller
Restart=on-failure

[Install]
WantedBy=multi-user.target

# sudo systemctl start als

It only change the light of keyboard but not screen light. xbacklight is installed.

uvNikita avatar Oct 01 '14 14:10 uvNikita

When run at startup, xbacklight outputs this to stderr:

No protocol specified
Cannot open display ":0"

And returns the exit code 1 (equivalent to system()'s 256)

It should run as a regular user (http://ubuntuforums.org/showthread.php?t=858600&s=a5538933e25509f41c5a91fd140745a0)

danieleds avatar Oct 02 '14 18:10 danieleds

In addition, xbacklight should be called from within an X server. For example, from a tty, xbacklight -get returns an error. Calling DISPLAY=':0' xbacklight -get works fine.

danieleds avatar Nov 15 '14 15:11 danieleds

Patch (pull request) avoiding xbacklight dependency available here (from my fork) if anyone needed. Backlight is changed by ACPI.

Displacer avatar Dec 08 '14 06:12 Displacer

Can you confirm that 281c9d4a5338d17fbe20120e1fc82f6ee2a55aad fixes the problem? The only issue, now, is that without xbacklight we have to do the smooth transitions ourselves.

danieleds avatar Dec 08 '14 09:12 danieleds

Another issue to check: does setting acpi_video0 backlight work correct in multi-videocard system. I have UX31A with one video card only.

Displacer avatar Dec 08 '14 14:12 Displacer

hi guys, I have asus ux51vz, which has both intel and nvidia graphic card. I had problems with the screen backlight control, but I found out that changing acpi_video0 to acpi_video1 works. I guess it's related to this issue

sveatlo avatar Dec 26 '14 21:12 sveatlo

Are there any ideas how to find out current acpi_video device to adjust?

Displacer avatar Jan 29 '15 18:01 Displacer