Tag Archives: L502X

Persist your screen brightness settings in Linux

If you like me have a machine running Linux OS and want to be able to persist your screen’s brightness setting, here is a small script that does the trick. (I don’t know if that feature lacks only in Ubuntu running in a Dell XPS 15 l502x or common to all Linux laptops)

Initially the problem is that once you reboot the machine, you lose the brightness setting and you have to manually adjust again. Annoying!

With the following instructions, you’ll be able to fix that. Tested in Ubuntu 13.10.

Copy these following three scripts in your Desktop folder (Or in the same folder) and give them execution permission:

RESET script (brightness-reset.sh):

#!/bin/bash
# Author: Hanine HAMZIOUI ALMADANY <hanynowsky@gmail.com>
# This script sets the brightness in Ubuntu as it is not persistent upon reboot

# In order to manually execute these commands below, the user must be root

# Brightness values are integers that range from 0 to 15
DEFAULT_BRIGHTNESS=7
CUSTOMBRIGHTNESS="$HOME/brightness/last_brightness"

if [ -f $CUSTOMBRIGHTNESS ];then echo $(cat $CUSTOMBRIGHTNESS) > /sys/class/backlight/acpi_video0/brightness
else echo $DEFAULT_BRIGHTNESS > /sys/class/backlight/acpi_video0/brightness
fi
exit 0

Brightness RUN (brightness-run.sh)

#!/bin/bash

# Persist Brightness value in Ubuntu 13.10
# Author Hanine HAMZIOUI ALMADANY <hanynowsky@gmail.com>

if [ -f "brightness-reset.sh" ]; then
sudo cp -v brightness-reset.sh /etc/init.d/ && sudo chmod +x /etc/init.d/brightness-reset.sh
else echo "brightness-reset file does not exist, it must be in the same folder. Terminating..."; exit 0;
fi

if [ -f "brightness-save.sh" ]; then
sudo cp -v brightness-save.sh /etc/init.d/ && sudo chmod +x /etc/init.d/brightness-save.sh
else echo "brightness-save file does not exist, it must be in the same folder. Terminating..."; exit 0;
fi

sudo ln -s /etc/init.d/brightness-save.sh /etc/rc0.d/K10brightness-save # Brightness SAVE Symbolic link to RC 0
sudo ln -s /etc/init.d/brightness-save.sh /etc/rc6.d/K10brightness-save # Brightness SAVE Symbolic link to RC 6

rawfile=`cat /etc/rc.local | grep "/etc/init.d/brightness-reset.sh"`
if [ -z "$rawfile" ]; then
sudo sed -e 's/exit 0//g' -i /etc/rc.local
sudo echo "#Reset screeen brightness" >> /etc/rc.local
sudo echo "/etc/init.d/reset-brightness.sh" >> /etc/rc.local
sudo echo "exit 0" >> /etc/rc.local
else echo "RC.LOCAL file is already customized to reset brightness at startup...If you think otherwise, do it manually again!"
fi

exit 0;

BRIGHTNESS Save (brightness-save.sh)

#!/bin/bash

# Author: Hanine HAMZIOUI ALMADANY <hanynowsky@gmail.com>
# Target: Ubuntu 13.10 and below
# Script that saves the last brightness value used

CUSTOMBRIGHTNESS="$HOME/brightness/last_brightness"
mkdir -p $(dirname $CUSTOMBRIGHTNESS)
cat /sys/class/backlight/acpi_video0/brightness > $CUSTOMBRIGHTNESS
exit 0;

then

chmod +x ~/Desktop/brightness-*

And finally; from your terminal again:

bash ~/Desktop/brightness-run.sh

You will be prompted for your user password.

Now adjust brightness ti a certain value and reboot. 😉

Ubuntu 12.10 Quantal on Dell XPS 15 L502X

This Post discusses further information about installing Ubuntu 12.10 Quantal on a Dell XPS 15 L502X.

Following the former post “Ubuntu 12.04 Precise Pangolin on Dell XPS 15″, There is no need for redundancy, so we’d like to put only what might be different and mention some issues that come only with Quantal.

1- One can follow all information on the previous post that applies to 12.04. It also applies t 12.10 (Optimus Support by Bumblebee project, etc).

ISSUES

If you fresh-installed Ubuntu 12.10 ou just updated, you likely now have a sound issue.

AUDIO SOUND ISSUE

– When you open your user session, sound is enabled, but you hear nothing except sometimes, tiny power explosions that indicates, the internal speakers are powered. Besides, the sound is back only when you plug in your headphones. It’s a matter of plug/unplug and sound routing awareness.
You might experience this issue also after a wake-up from a suspend.

Fortunately you can work around it :

On TERMINAL type: alsamixer

an interface will be displayed showing volume bars. Check the last one if it’s enabled or not (AUTO MUTE MO). It should be disabled.

alsamixer

alsamixer

If enabled, disable it and exit.

Type again : sudo alsa force-reload

You’re done. SOund should be back to normal.

But what if the above does not work? Don’t panic, let’s try some more advanced commands:

Follow these commands one by one :


sudo add-apt-repository -y ppa:ubuntu-audio-dev/ppa
 sudo apt-get update
 sudo apt-get dist-upgrade

 sudo apt-get -y install linux-sound-base alsa-base alsa-utils libasound2

 sudo apt-get -y install gdm ubuntu-desktop linux-image-`uname -r`

 sudo apt-get -y --reinstall install libasound2 linux-sound-base alsa-base alsa-utils

 sudo apt-get -y --reinstall lightdm ubuntu-desktop linux-image-`uname -r`

 killall pulseaudio

 rm -r ~/.pulse*

 sudo usermod -aG `cat /etc/group | grep -e '^pulse:' -e '^audio:' -e '^pulse-access:' -e '^pulse-rt:' -e '^video:' | awk -F: '{print $1}' | tr '\n' ',' | sed 's:,$::g'` `whoami`

DISTORTED AUDIO SOUND

Some folks may encounter this issue: When playing audio files, sound gets distorted, chunky and creeky. You might not notice it untill you increase the volume of your speakers.
Even though they are JBL, sound might get distorted and ugly. It’s a software issue rather.

Solution 1:

On Terminal enter: gksudo gedit /etc/modprobe.d/alsa-base.conf
the alsa-base.conf will be opened in your Gedit text editor.
Then, add the following line to the content of the file:
options snd-hda-intel model=generic
At last, reboot.

Solution 2:

If you have VLC installed on your system, try playing your audio files in totem instead of VLC and see if the audio sound is still distorted. If not, then uninstalling VLC likely should fix the problem.
—————————————————————-

HDMI Video/Audio Support

Thanks to ‘Reverse Prime’, HDMI Support for Nouveau Driver is now partially supported. It’s promised that it gets full support by the release of 13.10.
See:
https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers/+bug/904476
See also Bumblbee Github Issue tracker for more information.
—————————————————————

CONKY

conky on ubuntu

Conky on Ubuntu Quantal

1- First install conky
sudo apt-get install conky conky-all
2- Download the customized script: https://www.dropbox.com/s/6shmby2dm3ond2t/conky.tar.gz?dl=0
3- uncompress it and you should have a folder with the following content : two hidden folders (.conky & .lua) and a hidden file .conkyrc.
4- Copy these three files to your home directory.
5- then: killall conky && conky
6- open the DASH and type “startup“; this will open start up applications applet.
7- Add another entry for conky : conky -p 10
8- Now Conky should be launched on every login in (10 seconds of delay after user session is unlocked).
9- Optionally open the .conkyrc or lua scripts for more tweaking that suits your taste.

PS: Notice we modified slightly conkyrc script so that conky fits better in the xps 15 screen while you still have space for your desktop icons.
————————-BUGS ———————————————-
Intel GPU : https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1140716

—————-

We’ll continue soon, by adding other issues and tips.

Dell XPS 15 L502X & Ubuntu 12.04 Linux

This is a simplified tutorial for those interested to Install/Use Ubuntu 12.04 Precise Pangolin on their Dell XPS 15 notebook (laptop) and not sure if things would go fine. (This is an update to this post which covered Ubuntu 11.10).
The following instructions apply to Sandy Bridge models (64 bits).

Dell XPS 15

Dell XPS 15

Tested System:

  • – CPU: i7 2670QM with Turbo Boost up to 3.10 Ghz.
  • – Graphics : Integrated (Onboard) Intel HD 3000.
  • – Graphics 2: Discrete Nvidia GT 525M with 1 Go of memory.
  • – Standard 720p screen (1366 X 768)
  • – Backlit keyboard.


Installation of Ubuntu 12.04

  • – Download the iso image from Ubuntu.com (64 bits), then use the USB DISK CREATOR using another Ubuntu Live CD to create a bootable Ubuntu on your USB key.
  • – Boot the notebook using this USB Key (Make sure it is plugged to the USB 2.0/E-Sata port instead of the USB 3.0 port, otherwise, the installation will fail).
  • – Follow installation instructions (The installation goes smoothly). But Don’t INSTALL THIRD PARTY SOFTWARE. INSTALL ONLY UPDATE PACKAGES.
  • – Upon installation, all hardware is recognized but some manual commands may eventually be necessary to activate the 9/1 card reader and the Nvidia card.

Please refer to this page for the commands : https://wiki.ubuntu.com/HardwareSupport/Machines/Laptops/Dell/XPS/15#preview

Graphics

  • Upon installation only the integrated graphics card is active (Intel HD 3000).
  • To enable the Nvidia card, you have to install bumblebee project (Optimus Enabler for Linux). DO NOT INSTALL THE NVIDIA PROPRIETARY DRIVER manually (If you do, you won’t be able to boot); let Bumblebee installation take care of it.

NOUVEAU DRIVERS SUPPORT

Alternatively, you can configure Bumblebee to install Nvidia Open Source drivers NOUVEAU instead of the proprietary ones (We’d cover this in the future.). Meanwhile, check the following links:

https://github.com/Bumblebee-Project/Bumblebee-old/issues/18

http://nouveau.freedesktop.org/wiki/FeatureMatrix  (Nvidia GT525m / GT540m are categorized under NVC0 version)

——————————————————————————-


NVIDIA OPTIMUS SUPPORT FOR LINUX:


Bumblebee 3.0 Installation

Bumblebee Logo

bumblebee Logo

The official web site is : http://bumblebee-project.org/install.html
– Follow the README instructions through : https://github.com/Bumblebee-Project/Bumblebee
– Installation is straighforward and fast.
– More infos are to be found here:
Once bumblebee installed, basically you’d be able to run applications using the Nvidia Card, this way:
– Open Terminal and type optirun someapplication (for example: optirun firefox )

Optirun

Optirun


Test 3D on your Nvidia Card:

Open terminal and append:   optirun glxspheres   or optirun glxgears  instead, (a bug affecting GLXSPHERES in 12.04 affecting the performance of graphics https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/944627)

a window will open with 3D spheres animated, and you should read the Frame per Second values on your terminal.

Repeat the same thing but without optirun, on Terminal, append:  glxspheres

The same Windows should appear, but with lower FPS values.

In the following screencasts (with the bug of course), our FPS ranges from 33 to 81 fps when the Nvidia GT525m is used, and from 1 to 3 fps when the Intel HD 3000 is used.

Laptop powered:

Laptop on battery:

Browser 3D:

You can also benchmark your two cards using the web browser (Firefox  – google-chrome – chromium-browser – opera):

optirun google-chrome http://webglsamples.googlecode.com/hg/aquarium/aquarium.html

or (if you want verbose information displayed on your terminal):

optirun -v --debug google-chrome http://webglsamples.googlecode.com/hg/aquarium/aquarium.html

Aquarium 3D Test on browser

Aquarium 3D Test on browser

—————————————————————————————————————————————-


BUMBLEBEE GUI

Otherwise, you can install the Bumblebee GUI (it is still not official and has two or three -easy to live with- bugs):

https://github.com/Bumblebee-Project/bumblebee-ui

Notice that the first time you open an application with Bumblebee, it’s reltively slow, because it has to load the whole Nvidia driver.

Bumblebee Indicator

Bumblebee Indicator

Launch with Bumblebee

Launch with Bumblebee

Bumblebee Notification

Bumblebee Notification

Bumblebee Configuration Applet

Bumblebee Configuration Applet through Panel Indicator

The great Bumblebee Team has also thought about a RUN VIA OPTIRUN script for nautilus. You can browse -using nautilus file manager- to an executable application and execute it with OPTIRUN, using only the mouse (RUN VIA OPTIRUN):

Screencast of Bumblebee Nautilus RUN VIA OPTIRUN Script:

——————————————————————————————————————————–


Unity 2D & 3D

  • With or without Bumblebee, Unity 3D and 2D work fine.
  • If you want to tweak Unity 3D install CCSM (CompizConfig Settings Manager) (You might encounter a freeze when you try using CCSM, in this case, relogin using Unity 2D, then open CCSM, search for Unity plugin and check the unity plugin. Reboot and login using Unity 3D then retry CCSM, everything should be fine).

——————————————————————————————————————————–


Multi Display (External Monitors)

  1. – Unfortunately it is impossible to have more than one external screen along with the onboard laptop screen for now (it should be possible in the near future depending on Bumblebee / Kernel drivers evolution and maybe if the X Server is repalced by another more performant and modern display compositor – Wayland  – ).
  2. – For information:
  • –> The Intel HD 3000 (Graphics card) is linked to the mini DisplayPort
  • –> The Nvidia graphics card is linked to the HDMI port.
  • –> The HDMI port is disconnected and cannot be enabled for now (Bumblebee project team is working on it. See Bug: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/844307).
  • –> The mini DisplayPort is enabled by default and works out of the box.
Displays Settings

Ubuntu 11.10 Displays Settings

Display Settings in Ubuntu 12.04

Display Settings in Ubuntu 12.04

If you want to use an external monitor you have to get a mini DisplayPort to HDMI adapter or a mini DisplayPort to DVI adapter (You can find it on ebay for a good price. We used a china made adaptor that supports 1080p and which cost 15$)
The Intel HD 3000 through the mini DisplayPort is capable of driving up to 2560X1600 as a resolution (We tested with a Dell ST2310 1920X1080p and a Samsung XL 2370 SyncMaster 1920X1080p).

If you have a VGA only capable monitor, then get yourself a MiniDisplay to VGA adapter. be sure to get a high quality one to be able to drive the 1920 resolution. Most market VGA adapters allow up to 1024 resolution only.

Mini_DisplayPort_DP_to_HDMI_Adapter


HDMI

As mentioned, the HDMI issue is still on and we hope developers will address it soon. A bug is reported here, join it: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/844307

yet, if you want to make sure your HDMI port is physically operational, connect your external monitor to the HDMI port on your XPS 15 and do the following:

open terminal and type:

optirun nvidia-settings -c :8

The Nvidia Settings Applet should appear:

Nvidia X Settings

Nvidia X Settings

then

DISPLAY=:8.0 firefox

This will activate your HDMI external monitor and display Firefox in it.

If you do not get the full resolution for your external monitor plugged to the HDMI port, modify the Bumblebee Nvidia Xorg config file, by changing the value of “readEDID” from false to true (X Restart or reboot  is necessary for changes to take effect).

Otherwise, if you xant to have a pseudo extended desktop using your external monitor hooked to the HDMI port  along with another monitor hooked to the miniDIsplay Port (The laptop screen should be deactivated), then check this:

https://github.com/MrMEEE/bumblebee-Old-and-abbandoned/issues/75#issuecomment-2798937

Remark:  In Ubuntu Displays settings it is not possible for now to select the main output monitor (you can use XRANDR utility to set it manually).

——————————————————————————————————————————–


POWER MANAGEMENT

In 11.10 with previous kernel version, Power management was still an issue; now with the 3.2 kernel and Bumblebee 3.0, Power management works like a charm even better than Microsoft Windows OS.

There is no manual tweaking to do.

  • Normal CPU Temperature when the laptop is in passive cooling (Almost no CPU activity), peaks 44°C.
  • In normal tasking, the CPU temp peaks 54°C. Quiet Cooling.
  • During multi-tasking, the CPU temp reaches 64°C. Normal Cooling.
  • During heavy Memory and CPU usage, CPU temp reaches 75°C. / 80°C. Noisy Cooling.
CPU Temperature

CPU Temperature

The tool we use to monitor temperature in real time is HARDWARE SENSORS INDICATOR.

Be sure to install the package sensors-detect and run it (answer YES to all questions).

——————————————————————————————————————————–

LAPTOP SCREEN COLOR PROFILE

If you have the model with the 720p 1366X768 screen, you might have already noticed that its color profile is not suitable for most applications, especially video and photo viewing. You might also be annoyed by the blueish mediocre brightness.

Hopefully, Ubuntu comes with an utility that allows the user to load and apply what we call a Color Profile. As far as we can tell, DELL support does not provide any color profile database for users. Luckily, many color displays for monitors and laptop screen are available for downloading. As well as tools for customizing your own color profile (Open Ubuntu Software center and type COLOR, you should find a multitude of tools for ICC profiles).

Ubuntu 12.04 Color profiling

Ubuntu 12.04 Color profiling

For those having Ubuntu One account, here is a link to some profiles: https://one.ubuntu.com/files/shareoffer/34a3ac3d-2013-4534-8e01-ac815857ac94/

And for those who do not, a google document link : https://docs.google.com/open?id=0B-Sn4N_QK9abXzFHUkFIYjBUT1Mtd25fMlVxdHc0QQ

——————————————————————————————————————————–

BUGS affecting the Dell L502X (Hardware issues).

If you’re affected by these bugs, please create a launchpad account (if not yet done) and mark yourself as being affected.

  1. https://bugs.launchpad.net/unity/+bug/950160 (Fn + F1 does not work in 12.04 anymore)
  2. https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/897427 (Sound volume is at low level upon login)
  3. https://bugs.launchpad.net/ubuntu/+source/unity-greeter/+bug/874241 (Unity Greeter support for multi monitor is still disabled for Laptops)
  4. The Indicator panel keys:
Dell XPS 15 Panel Keys

Dell XPS 15 Panel Keys

  • KEY 3 : is binded to “Audio next”. Open Rhythmbox for example, play a playlist of songs, and click that key, it will trigger “Next Song” just like ( Fn + ->->| ) .
  • KEY 2 : is binded to “Bightness down”.
  • KEY 1: is not bind to any keyboard shortcut, so you can set a new shortcut for it.

In order to force the key to use a custom shortcut for the application of your choice, install the tool: Ubuntu Tweak.

sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak

Open Ubuntu Tweak and go to ADMINS panel. Click SHORTCUTS and add your customized keyboard shortcut and command.

In our case, the command is gnome-control-center and the keyboard key corresponds to KEY 1. When you click on the shortcut cell, you will be prompted to press the desired key, here KEY 1.

Ubuntu Tweak

Ubuntu Tweak

You’re done. Now when you click on KEY 3, the Gnome Control Center should open. (Of course, you can set the key to open the application of your choice, we set it to GCC, just because it matches the printed logo).

Please, in case you find another hardware bug, please report in Launchpad and in by commenting on this blog post. Thanks in advance.

——————————————————————————————————————————–

BUGS Workarounds

Workaround for Bug #874241

The workaround can be found here for instructions: http://askubuntu.com/questions/119843/how-to-force-multiple-monitors-correct-resolutions-for-lightdm

The workaround script is the following (Assuming your external monitor is digital):


#!/bin/bash
# V-1.0 by Hanynowsky - April 2012. I am a very basic script that works around bug 874241 reported in launchpad.
# Put this script in /usr/share/ and add this line display-setup-script=/usr/share/lightdmxrandr.sh to
# /etc/lightdm/lightdm.conf
# then retart lightdm (sudo service lightdm restart)
# N.B: This script assumes your laptop's screen is identified as LVDS1 and has a resolution of 1366x768
# and assumes your external monitor is named HDMI1 and has a resolution of 1920x1080
# Use the command xrandr -q to identify these values accurately and modify them in variables XCOM0, XCOM1 & XCOM2
# e.g. You might have DP1 or VGA1 instead of HDMI1 or 1920x1200 instead of 1920x1080
# Also this script does not override your default desktop displays configuration after login.
XCOM0=`xrandr -q | grep 'HDMI1 connected'`
XCOM1=`xrandr --output HDMI1 --primary --mode 1920x1080 --output LVDS1 --mode 1366x768 --below HDMI1`
XCOM2=`xrandr --output LVDS1 --mode 1366x768`
# if the external monitor is connected, then we tell XRANDR to set up an extended desktop
if [ -n "$XCOM0" ] || [ ! "$XCOM0" = "" ]; then echo $XCOM1
# if the external monitor is disconnected, then we tell XRANDR to output only to the laptop screen
else echo $XCOM2
fi
exit 0;

—————————————————————————-
Workaround for bug – Slow Wifi connection speed on Intel Centrino Wireless –
Check your wireless connection information and note the name of the driver (in our case it’s iwlwifi)
If it’s iwlagn, then replace iwlwifi by iwlagn.
Open terminal and type:

sudo rmmod iwlwifi && sudo iwlwifi 11n_disable=1

This will desactivate your wifi connection and reactivate it.
Check if your connection is fast. If it is, then make these changes permanent by creating a file and appending a line on it. On Terminal type:

sudo gedit /etc/modprobe.d/options.conf 

This will open an empty text file. Then append the following line and save:

options iwlwifi 11n_disable=1

or (if you have a slightly different intel card and using another dirver)

<code>options iwlagn 11n_disable50=1</code>


TROUBLESHOOTING

Bumblebee: Please check this page for proper installation of Bumblebee: https://wiki.ubuntu.com/Bumblebee