Tuesday, October 30, 2007

Panasonic Fn Keys in Ubuntu

I lost the functionality of the Fn keys to control brightness and volume after upgrading my Panasonic Toughbook Cf-74 from Ubuntu 7.04 Feisty to 7.10 Gutsy. Turns out that for whatever reason the kernel module which controls the Fn keys is not loading automatically.

To get it working, type the following into a terminal:

sudo modprobe pcc_acpi

That will load the Panasonic acpi driver. And that's it -- your Fn keys should now be working.

To insure that this module loads automatically at next boot, add the above command to /etc/rc.local

Monday, September 17, 2007

Encode MP3s in Ubuntu

The default Ubuntu install includes an application called Sound Juicer for use in encoding cd audio. However by default Sound Juicer cannot encode in MP3 format; this post explains how (at least for Feisty).

First, install this package:

gstreamer0.10-plugins-ugly-multiverse

If this package is not found, be sure you have enabled the Multiverse and Restricted software repositories and try again.

Next, after installing the above package, launch Sound Juicer. Click Edit -> Preferences. Next, click on the Edit Profiles button.

Click New. A new window will appear. (Note that on my system none of the fields in this new window can be edited until the Edit Profiles window is closed. So if this is the case for you go back to the Edit Profiles window and click Close.)

Add this text to the following fields:

Profile name: MP3
Profile desc: Encode to mp3 format.
GStreamer pipeline: audio/x-raw-int,rate=44100,channels=2 ! lame name=enc mode=0 vbr=0 bitrate=256 ! id3v2mux
File extension: mp3



This will encode audio files to mp3 format at a constant bitrate of 256; change this number to what suits your needs.

Next, check the Active button, then click Close.

Now back in the Preferences window you should see the MP3 profile in the Output Format dropdown.

Happy encoding.

Sunday, September 16, 2007

Video Resolutions under Ubuntu Remote Desktop

This post explains how to increase/expand the desktop size to match the working resolution of the remote client even if this resolution is higher than that of the server's video hardware.

The setup is Ubuntu Feisty 7.04 with Gnome Remote Desktop enabled, running on a Panasonic Toughbook (max LCD resolution of 1024x768), accessed by a desktop system operating at a resolution of 1280x1024. (UPDATE: this worked for me with xserver-xorg-core-1.2; this no longer works for me after upgrading to xserver-xorg-core-1.3.)

(FYI: The default Remote Desktop software in Ubuntu 7.04 is Vino, which is running with the xrandr extension. Remote Desktop is enabled via System -> Preferences -> Remote Desktop.)

X Windows has provisions for allowing desktop resolutions beyond which the server's hardware can support. These resolutions are called Virtual Resolutions, as rather than they being true hardware resolutions are instead represented in a simulated sense within the software.

On the Remote Desktop server, edit the xorg.conf file and locate the Display subsection matching that which the Defaultdepth is set to. Add the following line after Modes:


Virtual 1280 1024

Where the numbers represent the resolution which you want to use when connecting via Remote Desktop. (Note the absence of an 'x' between the numbers, this is intentional; adding an 'x' will result in the failure of X-Windows to launch.)


This section should now read something similar to the following:

SubSection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
Virtual 1280 1024
EndSubSection


Restart X Windows. Check for the new virtual resolution in the list at System -> Preferences -> Screen Resolution. Select the new virtual resolution; the desktop will now be larger than the monitor can display, though the entire desktop can be panned by moving the mouse in the appropriate direction.

Next connect to the Remote Desktop server. The resulting display on the client should be the entire desktop shown at the full virtual resolution. (Note that the screen resolution of the server can also be updated from within the Remote Desktop session.)

My main development system is the laptop described above. I mainly use it in a docked configuration, though I also take advantage of the portability and work offsite. Lacking a dock at home, I instead use Remote Desktop to connect to the laptop. The above solution allows me to run the Remote Desktop session to take advantage of the full resolution of my desktop computer and not be limited to that of the laptop's video hardware.

Wednesday, February 28, 2007

Installing Parallels 2.2 on Ubuntu 6.10 (Edgy)

Installing Parallels Workstation on Ubuntu can be a bit of a challenge. There are a few minor (yet fatal) issues encountered whether using the Debian package or the install script which prevent Parallels Workstation from running. This article shall explain how to overcome these issues.

Overview
The biggest challenge between Parallels Workstation & Ubuntu is /bin/sh . If you open a shell in Ubuntu and type 'll /bin/sh' you'll see the following:

lrwxrwxrwx 1 root root 4 2007-01-29 10:19 /bin/sh -> dash
What this means is that sh is a symbolic link to dash. What's dash? Its a replacement shell for bash (a popular shell environment) which includes various enhancements over bash. However the scripts packaged with Parallels have compatibility issues with dash, and as a result encounter errors which prevent Parallels from running.

So to sort out this mess we'll make some minor edits to a few of the Parallels script files which will allow Parallels to successfully run.


Dependencies
In addition to the script issues discussed above, there are undocumented package dependencies. These dependencies are due to the manner in which Parallels configures its kernel modules -- running the command parallels-config essentially builds these modules specific to your environment.

So to complete the software build environment in preparation for building the Parallels Workstation kernel modules, these packages should be installed on your system:

sudo apt-get install build-essential
sudo apt-get install kernel-package

Install these before installing Parallels Workstation.

(Note that you are free to install Parallels Workstation first if you wish; however Parallels does not run a dependency check and will not alert you if these packages are missing. The first clue that you will see is that parallels-config will fail to build the modules due to missing header files. So it is simply best to just install these dependencies beforehand.)

Installation

For clarity, we shall assume installation using the Parallels Debian package. However the principles described here remain the same for those using the Parallels install script.

First step is to obtain and install the Parallels Workstation Debian package. This can be found on the Downloads page of the Parallels website.

If the package installed successfully, you likely received a message indicating that parallels-config must be run prior to running parallels. Don't do it just yet, as some changes must be made beforehand.

Exercise your sudo powers and edit these Parallels scripts:
/usr/bin/parallels-config
/usr/lib/parallels/autostart/drivers_start
/usr/lib/parallels/autostart/drivers_stop
/usr/lib/parallels/autostart/iscripts
/usr/lib/parallels/autostart/parallels
/usr/lib/parallels/tools/mimelink
/usr/lib/parallels/tools/network.sh

In each of these files, do a search & replace for all instances of /bin/sh replacing it with /bin/bash. (Keep in mind there may be multiple instances of /bin/sh in each file.)

Once the above files have been updated and saved, launch the parallels-config command:
sudo parallels-config
This should successfully build the kernel modules. If it doesn't complete successfully, double-check that you captured every step above.

Otherwise if parallels-config successfully completes, launch Parallels Workstation and enjoy.

Modifying the GLSlideshow Screensaver settings in Ubuntu

UPDATE: This has been verified to work for 7.10 (Gutsy) as well as 7.04 (Feisty).

For whatever reason in Ubuntu the GLSlideshow screensaver settings are not accessible through the screensaver control panel. We're talking the basics here, like changing the filesystem path to the pictures to display, displaying more than one image (in true slideshow fashion), the duration to display a picture for, etc. So then how does one adjust these properties? This post answers that question.

GLSlideshow gets its settings from two files. The first is .xscreensaver, and the second is glslideshow.desktop. We'll tackle these one at a time.

Starting with .xscreensaver, this file should exist in your home directory; if it doesn't already exist go ahead and create it there. Add the following line to .xscreensaver, where the path represents the folder containing the images you wish to display (adjust the path appropriately for your environment):

imageDirectory: /home/username/Photos

Save this file and close it.

Next modify the settings in glslideshow.desktop to get GLSlideshow to perform as we would like. In Ubuntu this file is typically found here:
/usr/share/applications/screensavers/glslideshow.desktop

If this path isn't appropriate for your system, issue this command to locate this file:
slocate glslideshow.desktop

Edit gslideshow.desktop and look for the following entry:
Exec=glslideshow -root

Modify this line to instead read:
Exec=glslideshow -root -duration 15 -pan 15 -fade 5

Where:
  • duration represents the amount of time (in seconds) to display an image for
  • pan represents the amount of time (in seconds) to run the pan effect on this image
  • fade represents the transition time (in seconds) to fade between images
You are free to add additional options if you wish; see the manpage for glslideshow for more options.

Save this file, then activate the screensaver. GLSlideshow should now present a slideshow of images from the specified directory.

Cites
http://ubuntuforums.org/archive/index.php/t-212512.html

Monday, February 12, 2007

Ubuntu & wireless on a Vaio V505BX

I recently installed Ubuntu 6.10 (Edgy) on my Sony Vaio V505BX. The install went smooth and was done in less than an hour -- almost everything worked 'out-of-the-box' including the function keys for volume and brightness. However wifi/wireless wasn't working by default and required some digging. This post details how I was able to get it running.


What Didn't Work
Ubuntu recognizes the built-in card as an Intersil Prism 2.5 chipset; these details were found by using the lspci command.

Ubuntu ships with the hostap driver, the ornioco driver, and the prism2 driver, all of which should theoretically be capable of operating this card -- though despite my best efforts I could get none to work. The modules would all successfully load and the card could see access points; however association with an access point would either fail or be short-lived before the connection was dropped.

Something seemed amiss with these kernel drivers (hostap, prism2, orinoco), and some time spent web searching revealed others with similar Vaios were also having problems when running Ubuntu 6.10. The most common 'fix' appeared to be blacklisting the prism2 modules, which I also tried but without success.

Workaround
I managed to get wireless working by instead using the ndiswrapper kernel module in conjunction with the WinXP drivers:

1.) Add these modules to the modules blacklist file (/etc/modprobe.d/blacklist):

  • hostap
  • hostap_pci
  • prism2_pci
  • orinoco
  • orinoco_pci
This will insure that none of the default modules will load and interfere with the workaround. Reboot to clear any of the above modules which may be currently loaded. (You could also try modprobe -r modulename though rebooting is just easier.)

2.) Locate the WinXP drivers.

When I installed Ubuntu, I already had WinXP installed and so I configured it as a dual-boot system. I booted into WinXP and checked the device manager to see the wireless card's details as well as the driver it uses.

XP lists the card as an Ambit LANExpress ieee802.11b miniPCI adapter. I noted the location of the drivers it uses (c:\Program Files\Ambit\...) and then rebooted into Ubuntu. Write down this location or copy the files to a thumb drive as you'll need access to them from within Ubuntu.

(Caveat - Sony provides the V505BX wireless drivers here:
http://esupport.sony.com/US/perl/swu-download.pl?mdl=PCGV505BX&upd_id=1091&os_id=7

However (!) these drivers are packaged into a Windows installer which won't extract under Wine as it fails to detect an XP system. So if you don't have an Ubuntu/WinXP dual-boot you'll need to find a WinXP system on which run the installer and copy the installed drivers or another method by which to extract the necessary files.)


3.) Install the ndiswrapper-utils package:
sudo apt-get install ndiswrapper-utils

4.) Load the WinXP drivers as well as the ndiswrapper module.

This guide covers these steps quite well:
http://ndiswrapper.sourceforge.net/mediawiki/index.php/Installation#Install_Windows_driver

When loading the WinXP drivers, reference the location of the Ambit drivers found previously. (On my system I mounted the WinXP partition and loaded the XP drivers (inf, sys) directly from the NTFS drive.)


5.) You should now be able to associate with an access point using iwconfig.

Test everything out. If its not working, retrace the above steps to insure everything was followed correctly. If/when it's working, continue to the next step.

6.) Once wireless is operating satisfactorily, you will need to make the ndiswrapper modules load during startup so that your wireless card is automatically enabled (rather than follow the steps here every time you reboot).

The following command stores the current configuration of the ndiswrapper modules into a config file so that the WinXP drivers will be loaded automatically when the ndiswrapper kernel module is loaded:
 sudo ndiswrapper -m
Next you will need to insure that the ndiswrapper kernel module gets loaded during boot. I added the following line at the end of /etc/rc.local to accomplish this:
 modprobe ndiswrapper
Ndiswrapper should now load the WinXP drivers the next time you reboot, enabling your wireless card automatically.

7.) I highly recommend following this guide to get Gnome network manager up-and-running as it makes using wireless much more convenient:
http://www.debianadmin.com/enable-wpa-wireless-access-point-in-ubuntu-linux.html