Tuesday, February 05, 2008

 

Webcam, Video Chat, and Linux

I have been delaying purchasing a webcam for past one and a half years. Reason, I don't have windows. And webcams don't work on Linux. And even if they do, MSN is the only IM service you can use (via kopete) for video chat. Well no longer.

Today I purchased a Logitech QuickCam Communicate STX after installing windows on my home desktop. Surprisingly, it works without any pain on my SuSE 10.3 desktop. All I did was to install the driver rpm by adding the repository http://download.opensuse.org/repositories/drivers:/webcam/openSUSE_10.3 followed by installation of RPMs containing string spca. The installed rpms were, gspcav-kmp-default, gspcav1-kmp-default, and spaca5xx-kmp-default. Reboot after installation of the driver made Linux recognize the camera.

Now to use the webcam for video chat, there were two options: MSN via Kopete or Skype via their recently released beta 2.0 client. I prefer skype.

Labels: , , , ,


Tuesday, April 24, 2007

 

Wireless Disabled After Resume from Suspend

After I resume my laptop (OpenSUSE 10.2, Dell 640m, Intel 3945ABG wireless card) from stand by (suspend to ram), the wireless usually stops working. The KNetworkManager applet stops showing the wireless device. After investigating further, it seems that the problem is with the HAL daemon, and restarting it fixes the problem.

 /etc/init.d/haldaemon restart 

However restarting HAL daemon manually every time after resume was not a good option. So I decided to use my time while waiting at the SF airport better by finding a solution to the problem. It seems that SuSE uses pm-utils for managing suspend and other power related options stating version 10.2. Some of the configurations are present in /etc/pm/config. It turns out that all the scripts present in /etc/pm/hooks/ are executed after every suspend or resume event. One of the following four option is passed as a command line argument to each of the script: hibernate, suspend, thaw, or resume. Since I wanted to restart haldaemon at every resume, all I had to do was to create a new executable file in /etc/pm/hooks/ with the following contents:

#!/bin/sh
# File: /etc/pm/hooks/99haldaemon

case "$1" in
        resume)
                /etc/init.d/haldaemon restart
                ;;
        *)
                ;;
esac

And now the haldaemon is restarted at every resume, and the wireless works fine after I open the laptop lid. This is a hack, and I hope a proper fix will be included in future versions of SuSE.

Labels: ,


Friday, February 23, 2007

 

Simple Software RAID in Linux

RAID is commonly used in production environments to spread the data among multiple disks for higher performance, reliability or capacity. This is a small tutorial for quick setup of RAID 0 or 1 under Linux using mdadm. Fore more advanced configuration and options look elsewhere. Just for records, I have tested this on RHEL 4 update 4.

This document outlines creation of a RAID 0 drive consisting of three partitions /dev/sdb1, /dev/sdc1, and /dev/sdd1. Procedure for RAID 1 should be similar. First we need to prepare the three partitions for RAID. Use fdisk and set partition's system id of all three partitions to fd (Linux raid auto). You may need to reboot after this.

[root@trinity]# fdisk /dev/sdb1
<press t to change partition id>
<type fd as partition id>
<press w to write changes to disk>

Use mdadm to create the array.

mdadm --create /dev/md0 --level=0 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 --chunk=512

This will create a new drive /dev/md0 with chunk size 512KB. Choice of chunk size depends on application. Default chunk size is 64K. This new drive now ready for use. There is no need to sotre these configurations in any file as mdadm remembers everything for you even after reboot. For example, to create a new ext3 filesystem here use mkfs.ext3 /dev/md0.

Information about the active RAID arrays is displayed in /proc/mdstat. mdadm --detail --scan can also be used.

[root@matrix]# cat /proc/mdstat
Personalities : [raid0]
md0 : active raid0 sdd1[2] sdc1[1] sdb1[0]
      215043072 blocks 1024k chunks

unused devices: 

Labels: , ,


Sunday, January 28, 2007

 

SuSE, Acer aspire 5580 and non-standard resolution 1280x800

My roommate recently purchased an Acer Aspire 5580 laptop and handed it to me for installing Linux. It is a pretty good laptop, well supported under Linux. It features Intel Core 2 Duo processor with Intel 945 GMA and 3945ABG wireless. I installed openSUSE 10.2 and everything went fine except for the screen resolution.

This laptop uses 1280x800 as native resolution, but my X refused to work with anything greater than 1024x768. Initially I thought that the problem is with SuSE not recognizing HSync and VSync frequencies of the LCD screen. I tried every possible refresh rate in display settings. After a lot of googling around, I found 945gm and 1280x800 laptop monitor problem suse 10.2 and patch the video BIOS. For some reason, the hardware vendor did not include the native resolution of the LCD display in the list of supported resolutions. The solution however is simple, as there exists a hack for fooling X. On SuSE, simply edit /etc/sysconfig/videobios and reboot. Also make sure that /etc/init.d/boot.videobios is executed on boot time by running the following command.

insserv boot.videobios

After editing, my /etc/sysconfig/videobios looks as follows:

VIDEOBIOS_PATCH="yes"
VIDEOBIOS_PARAMETERS="5c 1280 800"

I don't understand why hardware vendors can not follow standards! Anyway, the laptop is functioning fine now.

Labels: , ,


Tuesday, December 05, 2006

 

BSNL broadband using Linux

BSNL DataOne provides broadband services using ADSL. They provided me with a Sterlite modem that can be used for pppoe (since it is configured to operate in pure bridged mode). While only windows is supported officially, it is easy to use this modem with Linux. I am using OpenSUSE 10.1 on my laptop. The details for configuration are as follows:

You first need to install rp-pppoe. RPM for SuSE 10.1 is available. To configure, pppoe-setup can be used, which will ask for many simple questions. I had the modem connected to my lan card (which was configured as eth0). My answers were as follows.

Welcome to the Roaring Penguin PPPoE client setup.  First, I will run
some checks on your system to make sure the PPPoE client is installed
properly...

Looks good!  Now, please enter some information:
USER NAME
>>> Enter your PPPoE user name:dsaXYZXYZ

INTERFACE
>>> Enter the Ethernet interface connected to the DSL modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethn, where 'n' is a number.
(default eth0):eth0

MODEM TYPE
We will try to detect if your modem is compliant with RFC 2516
or not. 3COM's 3CP4130 is *NOT* compliant, for instance.

Searching for a modem at interface eth0...
Found a RFC 2516 compliant modem, congratulations! :)
Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
after which the link should be dropped.  If you want the link to
stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP
addresses.  You may have some problems with demand-activated links.
>>> Enter the demand value (default no):

DNS
Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
>>> Enter the DNS information here: server

PASSWORD
>>> Please enter your PPPoE password:
>>> Please re-enter your PPPoE password:

FIREWALLING
Please choose the firewall rules to use.  Note that these rules are
very basic.  You are strongly encouraged to use a more sophisticated
firewall setup; however, these will provide basic security.  If you
are running any servers on your machine, you must choose 'NONE' and
set up firewalling yourself.  Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc.  If you
are using SSH, the rules will block outgoing SSH connections which
allocate a privileged source port.

The firewall choices are:
0 - NONE: This script will not set any firewall rules.  You are responsible
          for ensuring the security of your machine.  You are STRONGLY
          recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
                for a LAN
>>> Choose a type of firewall (0-2): 0

** Summary of what you entered **
Ethernet Interface: eth0
User name:          dsa220513
Activate-on-demand: No
DNS addresses:      Supplied by ISP's server
Firewalling:        NONE

To start, stop and to view the status, pppoe-start, pppoe-stop and pppoe-status can be used. I expected the internet to work, since after running pppoe-start, status showed that I am connected. Messages in /var/log/messages also didn't contain any error. LAN card had acquired IP address 192.168.1.2 from the DHCP of the modem. Modem's web configuration interface was accessible at http://192.168.1.1/.

pppoe-status: Link is up and running on interface ppp0
ppp0      Link encap:Point-to-Point Protocol
          inet addr:59.95.164.21  P-t-P:59.95.160.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:6727 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5687 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:6424287 (6.1 Mb)  TX bytes:826896 (807.5 Kb)

After some investigation I found that if I set my ethernet card (using YaST) to have static IP 192.168.0.3, and configure its default gateway as 192.168.1.1 everything works fine. I am not sure what is the reason for this, as I have no experience with pppoe; but it works. I will try to dig in this and find out the reason.

Labels: , ,


Saturday, November 04, 2006

 

My new Dell 640m and Linux

Few days back I treated myself with purchase of a Dell Inspiron 640m. Its a Core 2 Duo (T5500/2MB Cache/1.66GHz/667MHz FSB) machine with Intel chipset and Intel 3945 internal wireless. I installed openSUSE 10.1, and removed designed for windows sticker to stick it on my trash can. Everything worked fine with out-of-the-box install. Here is a detailed account:

Wireless: works fine in out-of-the-box install. Keyboard key to enable/disable wireless also works. The only way however to find out if the wireless is disabled by checking dmesg, which contains the following message when wireless is disabled.

ipw3945: Radio Frequency Kill Switch is On:
Kill switch must be turned off for wireless networking to work.

Onboard Video Card: Works fine. Intel's open source driver for 945GM support 3D accelration. I was able to play supertux without any problems. Even Xgl worked flawlessly. But, I was not able to play Warcraft III using Cedega as the framerate was too bad. Native version of UT2004 also didn't work. Probably this card is not meant for gaming.

Dual head mode was not very smooth as resolution sometimes messed up after switching the output device. But it seems like a problem with SuSE and YaST, and not with the drivers.

Sound: Works fine most of the time. But sometimes I need to delete and re-add the sound card using yast for audio to work. This is some bug in the driver as my dmesg is full of error messages.

ALSA sound/core/control.c:635: BUG? (info->access == 0)
[] snd_ctl_ioctl+0x463/0x9ea [snd]
[] snd_ctl_ioctl+0x0/0x9ea [snd]
[] do_ioctl+0x1c/0x5e
[] vfs_ioctl+0x24c/0x25e
[] do_fcntl+0x1c9/0x249
[] sys_ioctl+0x51/0x68
[] sysenter_past_esp+0x54/0x79

SD card reader: Doesn't work! But I can use my digital camera to transfer using usb. It seems that Gentoo wiki has instructions to enable this support.

Additional keyboard keys: All useful keys like changing LCD brightness, switching video output etc.., work fine. Other additional keys work after setup in GNOME (but not in KDE).

TV out and Express card: not tested

Overall, I am happy with my choice and its Linux compatibility.

Labels: ,


This page is powered by Blogger. Isn't yours?