Sunday, 23 January 2011

Power consumption Intel i5 Linux. SLFM?

Recently I have been trying to compile a kernel that would enable the use of SLFM-Super Low Frequency Mode in linux (Fedora 14). During the configuration update of the current kernel to the latest stable which is 2.6.35 -> 2.6.37 (quite a big step) I saw something about a frequency boost mode for the Intel graphics card driver.
This sounds to me like something similiar. But I accidently did not enable it. I will have to investigate it later.
It is almost impossible to find any information about this.
The current state of my laptop is that the processor will not got down to the 667 mhz (or maybe it was 600) as it does in Windows 7.

It says 1,2GHz on the CPU Frequency Scaling monitor I have added to the gnome panel.
And the battery time in Linux is not as good as in Windows.
I do have a compiled 2.6.37 kernel running, but I would need some more information about how to read bus speeds etc to really be sure that this is not working. When googling for slfm and linux nothing relevant shows up.

When I go into the /proc/acpi/processor/CPU0/ path,
and do this: "cat throttling", I get the information that there are 8 states available. From T0 - T7. T0 would be the maximum clock, T7 would be the lowest, and there is a percent rating stating that T7 would be 12% which would correspond to somewhere around 600 MHz. However this it not the same as what I see in the CPU Frequence Scaling monitor, and I seem to remember that this interface it somewhat deprecated. So I should look around in /sys instead. It has also marked the T0 state to be active, which would be 2.53 GHz, when my Ghz-Applet is showing 1,2 GHz.

After some trial and error I find the defined states in this interface too:
/sys/bus/acpi/drivers/processor/LNXCPU:00/sysdev/cpufreq

The command "ls" here will show all information about how the frequency is controlled. However this is stated everywhere in mhz and goes from 1199000 to 2534000 in range. That means this is probably the correct information about what it is able to perform, but it remains to see if this information is hardcoded without taking the bus speed into account. That is how the SLFM function should be working, it adjusts the bus speed to half of its regular speed, this will affect the cpu, ram, and possibly the integrated intel graphics card. Which is why I was curious about the frequency boost mode for the Intel grapics card driver.

There is also under /sys/bus/i2c, i2c which seems to be the name of the new integrated intel graphics processor onto the regular processor, some information about that. When googling on this there are all sorts of hits, probably it is not anything video-related. Seems like it is maybe the complete bus that is called i2c.

After some googling I stumbled upon a command called "dmidecode". This reads out from the bios (I guess) information about the states of the cpu. Now when this is decoded when the frequency applet is telling me the processor is running in 1,2GHz, my Toshiba R630s bios thinks the processors are running at 2,53 GHz. I wonder who is correct? It would seem to me that the bios could not be wrong on this one. But Toshiba is not the best bios-builder, and I have already had to upgrade the bios since it did not work with linux initually. Hmm...

This means 2 for 2.53GHz, since dmidecode and /proc interface tells this. And 1 for 1,2 GHz, since the Frequency monitor in gnome says so. This is so wierd.


Going through the kernel configuration again, I found under Device Drivers -> X86 Platform Specific Device Drivers -> Intel Intelligent Power Sharing.
This seems to be something very interesting.

Information stated in the config:
"Intel Capella platforms support dynamic power sharing between the CPU and GPU, maximizing performance in a given TDP. This driver along with the CPU frequency and i915 drivers provides that functionality."

Googling for "Intel intelligent power sharing" gives this link:
http://www.phoronix.com/scan.php?page=news_item&px=NzkzOQ

A one year old talking about someting that would give graphics boost modes and not the complete driver, which at least my kernel configuration claims now is there for the 2.6.37 version of the kernel.

I will enable it and see where it takes me in terms of power consumption and performance. More on this another day...

I have now tested enabling it, and I could see no changes in power consumption.

Saturday, 22 January 2011

Share internet linux

A prerequisite to do this is that you have 2 network interfaces. I am using Ubuntu 10.04 - Lucid Lynx.
  1. Go to the tray icon for network connections up to the right. 
  2. Right-click it, and press "edit connections".
  3. Select the network-interface where you want a internet-connection to be available, and press edit.
  4. Now go to the ipv4 network settings.
  5. Select method: "Shared with other computers".

Wlan: BCM4313 Linux Fedora 14,15,16,17,18 for Dell Inspiron M101Z, Lenovo s10-3t, Asus Eee PC 1215N and Toshiba R630.

1) Install the rpm-fusion, go to http://rpmfusion.org/Configuration for this.
a)Install http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
b)Install http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

2) Click System -> Administration -> Add/Remove Software.
a)Search for kmod-wl.
b)Install the selected package.

3) Reboot.

Nvidia graphics card in linux, after reboot. Stuck in low power mode.

If you find yourself with stuttering graphics in windows or linux, and can not find out why, chances are that you are the victim of a bug during shutdown in linux that locks the powermode of the graphics-card to a low level performance state.

This bug has been around for ages (at least 3 years), probably because it is kind of complex. A simple restart does not solve the issue, you must shut down your computer, and start it again.

I have this bug on my 8800GT, but it is likely that components (SW & HW) are shared by many graphics cards. Though this card is kind of getting old now, the drivers used are probably the same as the newest ones, that is usually how Nvidia does it. It would be fun to hear if anyone else have had issues with this. It is the only problem I have under linux with the Nvidia driver. It is really rock solid otherwise.

I managed to get the card into this state a few days ago, but I don't know exactly what I did, I think a game crashed on me, and I felt a restart would be in it's place. I find it quite interesting, since my computer is so very stable otherwise I kind of look for trouble sometimes...

To make it even clearer, the original bug was that after every restart the graphics was not working correctly. Now it does not happend after every restart, but one time I have trigged it to happend, at least.

The driver I currently have installed is not the lastest, 195.36.24 is the version.
I should probably have a reference here, but if you are really interested there should be something on the nvidia forums or at least google about a bug that said this occured always. It should be around 07-08.

Freezes in Linux using Toshiba R630

If you experience random freezes while using this laptop in linux, you can solve that issue by upgrading the bios. There is more information about how to do this on the toshiba global webpage. Lets hope you did not get rid of your windows-installation yet, cause it is needed in order to perform the upgrade.

I tried to link to the toshiba web-page, but it wouldnt let me, but you will find it ;).

Internet Bridge using 2 network connections in Gnome, Ubuntu Linux

Since my broadband gateway is not working at the moment, I find myself in need of setting up a network bridge in order to connect my laptop while still using my stationary computer as a server.

A prerequisite to do this is that you have 2 network interfaces. I am using Ubuntu 10.04 - Lucid Lynx.

  1. Go to the tray icon for network connections up to the right. 
  2. Right-click it, and press "edit connections".
  3. Select the network-interface where you want a internet-connection to be available, and press edit.
  4. Now go to the ipv4 network settings.
  5. Select method: "Shared with other computers".
That was just too easy. 
Some of the labels may differ from the direct-translation I did from swedish to english.
I must admit that I tried some more advanced console-based solutions first, and ended up with a bridging connection that would leave me without an internet connection on my stationary computer, but enabling the internet access on the laptop. I hope this post can keep others from trying more advanced solutions than necessary.

Friday, 21 January 2011

HTC Desire HD - Useful Android Applications

Here is a list of my installed (custom) applications:
  • Acceleration sensor (used to see level of surfaces)
  • Android LightSaber
  • ConnectBot (To connect using ssh to my computer)
  • Easy Filter (block incoming calls and sms from certain numbers)
  • Banking applications
  • IP Webcam (use your phone as a webcam or surveillance camera)
  • IQ Tester (I just had to try it, seems bloated)
  • Mobile TV
  • MSN Droid X
  • Password Keeper
  • Super Mario Land
  • SuperMarioBros (NES copy, works bad with the controllers though)
  • Teeter (this is a fun game, but the size of the phone makes it really easy)
  • Web Server (not tested yet but sounds promising)
  • WhichOperator (see which operator a certain number belongs to)

The only ones that I actually use are:
  • Acceleration sensor
  • Easy Filter
  • Banking applications
  • IP Webcam
  • MSN Droid X
  • Password Keeper
  • Teeter
  • WhichOperator
What applications do you use on a regular basis?

Sunday, 9 January 2011

Booting Linux with USB stick, without cd: Unetbootin & Ubuntu 10.10

I decided that I should try out Ubuntu 10.10 instead, partly since I wanted to use 64-bit instead, and partly because I thought it would spare me some of the issues.
The Live CD installation of Ubuntu 10.10 x86_64 using unetbootin and a USB-memory failed for me at a late stage over and over again, so did Gentoo. I have no idea why. So I went with Fedora 14 64-bit instead again, installation went flawlessly now when I decided to wipe the whole disc instead.
64-bit linux seems to be a bit immature still, meaning that it probably lacks some closed source stuff. It remains to see how usable it will be for desktop usage, though the 10.2 Flash Beta version seems to be working alright.

Friday, 7 January 2011

Suspend to ram/disk using Fedora 14 and Toshiba Satellite R630

A quick test of hibernation and suspend to ram revealed a small problem when resuming from ram. The brightness on the lcd display can not be adjusted, it is stuck at max. This could cause a problem with low battery time, but is probably solvable in a number of ways. Including just going with Ubuntu instead.

I will find a workaround for this if enough people want me to :)

Video codecs in Fedora 14

Spending about an hour to track down codecs to look at some videos is not what I had expected from fedora. In fact, I did not even get the default movie player that comes with the distro to play what I wanted, I ended up with MPlayer, Xine and VLC. It just seems like noone is using this distro any more. Maybe it was that I had enabled the PAE kernel, but I don't really know, very annoying to have to spend so much time trying to figure it out. I had not expected this to be any problem at all. This post will be updated, if I don't just go with Ubuntu instead...

I don't write down what I did since I did not find a clean simple way to do it the way I wanted.

EDIT: I have now found a good way to do it, using rpmfusion:
http://nosnahoi.blogspot.com/2011/02/codecs-for-movies-and-mp3-in-fedora.html

Installing and running World of Warcraft in Linux, Fedora 14,15,16,17,18 on a Toshiba Satellite R630

This post covers an online installation.
If you have a nvidia graphics card, use this instead:
http://nosnahoi.blogspot.com/2011/02/installing-world-of-warcraft-with.html

This post was written for Fedora 14. It works with newer fedora versions.

1)In the Add/Remove Software applicaton under System -> Administration, search for wine and select "A Windows 16/32/64 bit emulator" and press Apply to install it.
Now you are able to run windows-applications.

2)Download the wow-installer from battle.net (WoW-4.0.0-WOW-enGB-Installer.exe).

3)When the download has finished, find this file and left-click on it. Click on "Open with other application..:". Use the custom command "wine", and open the file.

4)Now you will get an SELinux Denial, click show to view it. Now click troubleshoot.
a)Check the third box box with "...want to control the ability..."
b)Copy the text "setsebool -P mmap_low_allowed 1"
c)Go to applications -> System tools, to open a Terminal.
d)Now type "su" and enter the root password to gain root access.
e)Then enter "setsebool -P mmap_low_allowed 1" to allow the access.
I am fairly certain that this can be ignored, but feel free to try it. It may solve some memory issues, but I am not completely sure about how this affect things.

5) Open the wow-installer again (step 3). It may require you to download gecko packages, do that. While downloading, you may do step 6 & 7, but not 8.

6) Go to Applications -> Wine -> Wine configuration, the Audio tab. It then sets up the audio settings for the first time (if you haven't done this before), so now your sound should be working.

7) Make sure the "Allow Pixel Shader" is enabled by clicking Applications ->Wine -> Wine Configuration, click the tab Graphics. Make sure it looks like in the picture. This is probably your default setting, but if you changed it, set it to this again.












8) After this post was originally written, there was updated compatibility in direct x in linux. So if you want, try not altering the config.wtf file at all, just start the game. It may work! If not, the text below will give you some guidelines.

I had to do some experimentation with the configuration file Config.wtf (if you want to watch the intro video, edit RunOnce.wtf and paste in these settings), located in ~.wine/drive-c/Program Files (x86)/World of Warcraft/WTF. Here are some important parameters, you should add these to your Config.wtf (These are specific to the Intel Graphics that I have in my laptop, if your graphics card is Nvidia or ATI, these should not be used):

SET showToolsUI "1"
SET gxMultisampleQuality "0.000000"
SET videoOptionsVersion "4"
SET gxFixLag "0"
SET shadowLevel "0"
SET specular "0"
SET reflectionMode "0"
SET particleDensity "10"
SET weatherDensity "0"
SET ffxGlow "0"
SET gxWindow "1"
SET textureFilteringMode "0"
SET baseMip "1"
SET uiScale "1"
SET useUiScale "1"
SET UIFaster "2"
SET ffxGlow "0"

9) Play! You may have to play around with the WTF files to make it start properly for the first time, and the installation will first download only the Standard Version of World of Warcraft first, so you may have to start the downloading again. It will probably start automatically, but you should expect a downloading size of at least 12 GiB. Also, I had to go in to the video settings in the game and lower everyting to the lowest possible. Basically so that the game uses an as low amount of memory as possible.

This post does not, since I am currently installing this for my laptop with Intel graphics, cover your Nvidia or ATI graphics card driver installation, which is required to make this game run smoothly in those cases.
Here is a quick google for the Nvidia driver in Fedora 14:
http://www.google.se/search?q=nvidia+driver+installation+fedora+14&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
And here is a quick one for the ATI driver in Fedora 14:
http://www.google.se/search?q=ati+driver+installation+fedora+14&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

In the case of the Nvidia driver, you also need to install some 32-bit libraries if you are using Fedora 14 with 64-bit. I made a blog post about that too:
http://nosnahoi.blogspot.com/2011/02/using-nvidia-in-linux-with-fedora-14-64.html 

Game crashing in new battlegrounds and areas with Intel Graphics solution:
http://nosnahoi.blogspot.com/2011/02/wow-in-linux-using-intel-graphics-and.html

If you are planning to install using CDs, maybe this can help you:
http://triggsolutions.com/linux-tutorials/installing-world-of-warcraft-on-linux-via-wine/275

Thursday, 6 January 2011

Power consumption Toshiba Satellite R630 under Linux, Fedora 14/15/16/17/18

In windows I have seen power consumption numbers of to the lowest, 7-8 watts. Now when I am looking at the consumption in linux, the lowest numbers I see is 11 watts. This is the output from reading the battery-state:
[X@X BAT1]$ cat state
present:                 yes
capacity state:          ok
charging state:          discharging
present rate:            11110 mW
remaining capacity:      59447 mWh
present voltage:         10850 mV

11 W would yield a running time of 60/11 = which is about 5.5 hours. The number 60 is coming from a readout number of 60087 mWh which is the capacity left in the battery.
This kind of information can be shown using the command cat on the various interfaces in /proc/acpi/battery/BAT1 (dir/ls to show...).

As 5.5 hours is way lower than what can be achieved in Windows, something needs to be done about this. Clearly the laptop should be able to use the battery better, and probably someone has a solution for this.

One of the reasons for this is probably that the cpu does not go down in to slfm (super low frequency mode) while using linux. This may not even be supported in the vanilla kernel, but I assume I will have to try to compile the latest "shit" to see what can be done about it.

Looked in to it a bit more: http://nosnahoi.blogspot.com/2011/01/power-consumption-intel-i5-linux-slfm.html

Android development using Netbeans and Fedora 14/Linux

In order to setup a working android development environment you need the following:
 Android SDK Installation
1) Download the android SDK for linux: http://developer.android.com/sdk/index.html. Extract it to your working directory /home/username).

Netbeans IDE Installation
1) Click System -> Administration -> Add/Remove Software and search for Netbeans.
2) Select "Integrated Development Environment (IDE)", which should be a package named Netbeans etc. Press apply and install it.

Android plugin to the Netbeans IDE Installation
1) Click Applications -> Programming -> Netbeans IDE 6.9, and start the IDE.
2) Inside the Netbeans IDE, Click Tools -> Plugins.
3) Select the Settings-tab. Press add and enter the URL: http://kenai.com/downloads/nbandroid/updates.xml, with name nbandroid, and press ok.
4) Go to the available plugins tab, press Reload catalog. Sort on name if you can't find it. Left-click and select "check category mobility".
5) Click the install button. This may take a while. When it is finished you can find Android under the installed tab in the plugins-window.

Android-platform added to the Netbeans IDE
1) In the Netbeans IDE, click the Tools menu and Select Java Platforms.
2) Click add platform. Select "Google Android Open Handheld Platform" and click next.
3) Browse to the folder that contains the android SDK. Then go down one level to the folder called platforms. For Android 2.3, go down one level further to Android-9 and click next. Click finish.

Android Virtual Device added to the platform
1) In the Android SDK Folder, go to Tools. Start the application called "android".
2) Press New, and name the device whatever you prefer. The target should you choose yourself. It may be preferable to add several devices to be able to test running on a few platform versions. However I choose Android 2.3 since it is the latest version.
3) Press create and you should be able to create a test project in Netbeans which you may run by pressing F6.

Windows-applications in Fedora 14,15,16,17,18 using Virtualbox and Windows 7/XP/Vista.

Windows applications are unavoidable. You will need to use one eventually. Sometimes you may run the application directly under Linux/Fedora using Wine, which is available in the Add/Remove Software-application.

If you are looking to run a game under linux that heavily uses graphics/processor, you may try to run it using wine instead.

To be able to use windows-applications without using wine, you need to use a virtualizer. VirtualBox is an open-source virtualizer that works well for most things you may want to do. Besides the virtualizer you also need a valid Windows License. And quite a lot of disk space.

To install VirtualBox:
1) Go to System -> Administration -> Add/Remove Software.
2) Search for VirtualBox, scroll down to "A general-purpose full virtualizer for PC hardware", select it, and press Apply.

Installing an operatingsystem should not be a big thing. You will need installation media which can be obtained from Microsoft. And when you have installed your operating system you might want to use USB-Devices. For example you can tell VirtualBox to connect a webcam connected to your computer to the Virtually running Operating-system. That way you can use Msn Messenger or Skype inside the virtual machine for a video call.

Enabling access to 4gb, 6gb,8gb,16gb ram in 32-bit Fedora 14,15,16,17,18

PAE is the name of this in linux. Without it your system-monitor will look like this. Of course I am refering to the 2.8 GiB stated under Memory.

To install PAE Support:
1) Click System -> Administration -> Add/Remove Software.
2) Search for PAE.  Select "The Linux kernel compiled for PAE capable machines" and press "Apply".
3) You should now be able to restart and boot in to the new PAE-enabled kernel.

After reboot:
Now I lost my wlan again! But I got my memory. I had hoped that the kernel modules were installed automatically since I had the repositories installed for this.
Solving this was not a real brainer:
1) Click System -> Administration -> Add/Remove Software
2) Search for kmod-wl-pae, in my case only one package was found, which I installed, and then rebooted.

Bluetooth on the Toshiba Satellite R630 in Fedora 14

Immediately after installation of Fedora, the Bluetooth-icon indicates that something is not working.
Clicking the Bluetooth-icon Reveals a grayed out line saying "Bluetooth: On", an enabled line saying "Turn Off Bluetooth" and a third one called Preferences. Opening preferences reveals a button which you may click on to enable bluetooth. This seems odd to me since bluetooth already was on, stated under the menu "Bluetooth: On", but it was also Disabled, which is the label of the icon. Clicking this button alone does absolutely nothing (the button called "Turn On Bluetooth").

Writing this, I discovered that if I:
1) Click the line reached by left-clicking the bluetooth icon saying "Turn Off bluetooth".
2) Left-click the bluetooth icon, select preferences and press the "Turn On Bluetooth" button.
3)Something magical happens and Bluetooth seems to be on. I tested this using left-click and "Set up new device...", and I could find and connect to my phone.



What happens after reboot is yet to be discovered...

...apparently exactly the same thing happends. I need to tell the software to first turn off the bluetooth, then turn it on again. This does not seem optimal, since I probably will forget that it works this way within a few days. It needs a fix.

Honestly I should report this quirk somewhere, but I don't really know where. I was looking for a way to turn off and on "bluetooth", whatever this may be that it means. There is a service called bluetooth that can be stopped and started. However this seems not to affect anything. I suspect that this has something to do with the acpi.

I tried most of the commands I could find here: http://www.cyberciti.biz/faq/linux-disable-bluetooth-host-controller-interface-daemon/
None of them could get me to the state where it was possible to search and find bluetooth-devices. It feels strange that I did not even have the service hidd on my machine now. Maybe I need to install something more to be able to take full advantage of bluetooth nowadays.

Installing flash player in Fedora 14/15/16/17/18 32-bit

First I tried the automatic installation in Firefox. However it tells you to manually go to the page http://get.adobe.com/flashplayer/.
In the dropdown-box I selected YUM for linux. I pressed download now, and installed the package. But this did not help. I even restarted firefox.

Google mission again led me to this page:
http://www.if-not-true-then-false.com/2010/install-adobe-flash-player-10-on-fedora-centos-red-hat-rhel/

Apparently you also need to do install a package that is supplied by the rpm installed. The package is called "flash-plugin". Then restart firefox.

Wlan Toshiba Satellite R630 in Fedora 14/15/16/17/18

lspci in a terminal gives me this data about the wireless:
Broadcom Corporation BCM4313 802.11b/g LP-PHY (rev 01)

Some googling on "Broadcom corporation bcm4313" gave me a lot of information on the subject:
http://fedoraforum.org/forum/showthread.php?t=239922
http://forums.fedoraforum.org/showthread.php?t=248067

...which leads me to the following steps:
1) Install the rpm-fusion, go to http://rpmfusion.org/Configuration for this.
a)Install http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
b)Install http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

2) Click System -> Administration -> Add/Remove Software.
a)Search for kmod-wl.
b)Install the selected package.

3) It is not working yet, so I will try rebooting.

4) After reboot it is now working, and I am now rid of the disturbing cable.

Still this is quite an annoying quirk that follows all Fedora distributions I have been using together with toshiba laptops, last time I installed Fedora on a toshiba laptop I had to do roughly the same thing. Technically on my last laptop I did not do exactly the same thing, I had to download and install the firmware for the ipw2200 driver.
Now what I installed is called a kernel-module. Which I assume is another name for the same thing. Feel free to enlighten me with more accurate information if this is wrong.

After I installed the PAE kernel I had to install another kernel module originating from rpmfusion:
1) Click System -> Administration -> Add/Remove Software
2) Search for kmod-wl-pae, in my case only one package was found, which I installed, and then rebooted.

Hello world..

This is my first post.
I realized a blog could be good to keep track of the stuff I do, and if someone wants to read about it I guess I don't mind.
On nosnahoj.com you can find more stuff written by me.

//Nosnahoj