Posted: February 20th, 2011 | Author: win | Filed under: Funny, Linux | No Comments »
Has your Linux loving friend left her computer unlocked and unwatched? Try this from a terminal prompt:
echo "PS1='8===D ~~ '" >> ~/.bashrc
Posted: January 17th, 2011 | Author: win | Filed under: Linux | Tags: bamboo, tablet, wacom | No Comments »
As a left-handed person, I wanted to use my Bamboo graphics tablet on the left hand side of my keyboard (luckily I mouse with my right hand) without having the tablet’s cord running in the wrong direction. I was able to flip the orientation of the tablet in software using the xsetwacom utility. Here was my approach:
1. use a recent kernel and X.org which support the Bamboo. I’m running 2.6.37 and X.org 1.7.7 which seem to do the trick.
2. install the xsetwacom utility. In Debian, this comes as part of the wacom-tools:
sudo apt-get install wacom-tools
3. Identify wacom device to tweak according to xsetwacom. Through a quick process of trial and error, I discovered the device name to use when setting the orientation (step 4) :
xsetwacom --list
4. Issue command to rotate orientation:
xsetwacom --set "Wacom Bamboo Pen Pen" Rotate "HALF"
At this point the stylus motion should be working according to the new orientation. I wrapped this one line command in to a script to call from a keyboard shortcut, and it’s working great.
Posted: October 15th, 2010 | Author: win | Filed under: Linux, Tools and Gadgets | Tags: alsa, audio, eqalization, LADSPA | 2 Comments »
I recently purchased a set of Unique Hardware HUMP NF01 USB speakers from Think Geek, where they sell them under the name “Crystal USB Desktop Speakers.” What was wrong with the name HUMP, I couldn’t guess. Dan’s Data posted a good review of these speakers, in case you are unfamiliar with the NF01.
Out of the box, the speakers that come with the NF01 sound muffled to me when listening to music. I don’t currently have access to a calibrated microphone in order to plot their frequency response, but I felt I could improve their sound somewhat with a bit of qualitative equalizing.
I’m running Debian Testing on my Samsung N510. For reference, the versions of my kernel, ALSA, and MPD are as follows:
win@taco:/home/win> uname -a
Linux taco 2.6.35.7 #1 SMP PREEMPT Fri Oct 8 12:43:49 PDT 2010 i686 GNU/Linux
win@taco:/home/win> cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.23.
win@taco:/home/win> mpd --version
mpd (MPD: Music Player Daemon) 0.16~git
On my system, the NF01 USB audio interface unit was detected immediately upon connection, and was configured as the second ALSA device according to a quick test using aplay:
win@taco:/home/win> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC269 Analog [ALC269 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
My usual music player software is MPD. Currently, MPD doesn’t implement any EQ filtering, leaving that task up to whatever audio component sits downstream on the audio chain, be it a special ALSA or PulseAudio plug-in module, etc. My approach was to create a virtual ALSA device utilizing mbeq (a LADSPA equalization plugin) and to configure MPD to use that virtual device.
I added the following stanza to my /etc/asound.conf file:
pcm.hump_eq {
type ladspa
slave.pcm "plughw:1,0";
path "/usr/local/lib/ladspa/";
plugins [{
label mbeq
id 1197
input {
# filter gain values (range: -70 to 30)
# band center frequencies (Hz):
# 50,100,156,220,311,440,622,880,1k25,1k75,2k5,5k0,10k0,20k0
controls [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] # change these to your liking
}
}]
}
pcm.hump {
type plug
slave.pcm "hump_eq";
}
Note that the mbeq plugin is installed in /usr/local/lib/ladspa/ on my system. Your LADSPA plugin location may be different. Also, remember that the string “plughw:1,0″ represents the second ALSA device in the system. Your card may not appear using the same device number depending on the other hardware installed in your system.
I was able to test the new virtual device with another quick test using aplay to listen to a recording of pink noise. By the way, in order to use the new virtual device, I did not need to restart ALSA or perform any other actions after updating my asound.conf:
win@taco:/home/win> aplay -D hump pinknoise.wav
Playing WAVE 'pinknoise.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
In order for MPD to use the new virtual device, I added a new section to my /etc/mpd.conf file:
audio_output {
type "alsa"
name "HUMP NF01 USB Speakers"
device "hump"
mixer_device "hw:1"
}
After restarting MPD, I was able to verify the existence of this new audio output using mpc. Note that if the new output is disabled, it can be enabled by using a command like “mpc enable 2″, where, in this example, “2″ is the output corresponding to the NF01:
win@taco:/home/win> mpc outputs
Output 1 (HDA NVidia) is enabled
Output 2 (HUMP NF01 USB Speakers) is enabled
Output 3 (FIFO) is enabled
At this point, with the new MPD output enabled, playing music with MPD should be working and equalized according to the gain values entered in /etc/asound.conf. If the values are adjusted, you will need to restart MPD for those changes to take effect. Enjoy!
Oh, you wanted to know how the system sounds after equalization? Let me get back to you on that. In the mean time, if you have any questions or comments on this article, please let me know!
Posted: October 3rd, 2010 | Author: win | Filed under: Linux, Tools and Gadgets | Tags: netbook | No Comments »
Introduction
This page documents my experience with running Debian GNU/Linux on my Samsung N510 netbook.
Background
I decided to move to the N510 mainly because I was planning on using a portable machine as my primary computer for a period of time. Size, cost, and graphics / 3D performance were all factors in my purchase decision. The N510 seemed like a reasonable middle-of-the-road machine in terms of all these areas. It’s not Alienware, but with Linux installed and tuned, the platform should handle most tasks I need it to accomplish. The NVidia ION chipset present in the N510 was key to my decision, since the lack of reasonable 3D acceleration is a weak link in most other current netbooks and many low-end laptops for anyone interested in doing light gaming, 3D modelling, running a compositing window manager, scientific visualisation, etc.
Hardware and Feature Support
Here is a matrix of the most important hardware and features provided on the N510, and my ability to get them working on my machine. Keep in mind that other people may have had better or worse luck, and that device support is always improving. I’ve ommited very typical hardware that I haven’t had trouble with, like USB, SATA, and some others.
| Component / Feature |
Status |
| Suspend to RAM |
Working with workaround for ethernet resume. See below |
| Suspend to disk |
Working |
| Ethernet |
Working (using ‘SysKonnect Yukon2 support’ kernel option) |
| Wireless LAN |
Working (using ndiswrapper and Windows XP driver. see notes) |
| Sound |
Working (using NVidia HDMI and Realtek audio codecs) |
| Video |
Working using proprietary NVidia driver (version 190.53) |
| VDPAU |
Working with mplayer after recompiling with VDPAU support |
| Card reader |
Working |
| Touchpad |
Working in X.org |
| Webcam |
Working with luvcview |
| HDMI audio/video out |
Working in both twin-view and mirroring modes |
| Bluetooth |
Running ‘hcitool scan’ reports nearby devices |
| LCD brightness controls |
Working by writing to /proc/acpi/video/IGPU/LCD0/brightness |
Kernel Configuration
I’ve based my system on the 2.6.32 release kernel from http://www.kernel.org. Here is a copy of my kernel configuration file, modified to only include support for hardware contained in the N510 and also a few common devices (USB hard drives, CDROM drives, etc.).
Please note that there is more than one version of the N510 being shipped, and your hardware may not match mine. Specifically, the wireless and wired ethernet are suspect. Make sure to check the output of lspci and dmesg on your machine.
Here are the most notable changes I’ve made to my kernel configuration:
- CPU architecture set to Intel Atom
- enabled support for Realtek 8192 wireless LAN (currently a staging driver)
- timer frequency set to 1000Hz
- preemption model set to ‘desktop’
Suspend to RAM
Initially I was having a problem where resuming from suspend (using pm-suspend) would result in a kernel panic, forcing a hard reset by removing the N510′s battery. I traced the problem to the sky2 kernel module responsible for Ethernet. By explicity unloading the sky2 module on suspend, I was able to resume without issues. I was able to achieve this by adding the following to a new file called /etc/pm/config.d/suspend
SUSPEND_MODULES=sky2
Wireless LAN
The 2.6.32 Linux kernel supports my 510′s Realtek 8192 wireless hardware (using a staging kernel module). I was able to recompile with support for this Realtek 8192, however I was unable to locate a copy of the firmware required by the device, and so I opted to use ndiswrapper and Realtek’s Windows XP driver found on their web site. If anyone has information on extracting and using the required firmware, please contact me.
Software Environment
I’m running Debian testing as my Linux distro. The stock kernel shipped at the time is 2.6.26. I try to run a relatively lightweight system, with X windows, core gnome libraries, and fluxbox as my window manager. I won’t go in to detail on my configuration, but just mention some tweaks that I find useful.
Temporary filesystems in RAM
This helps to keep the N510′s hard drive from spinning up unnecessarily, and avoids the resultant short pauses when programs wait for the disk. Note that everything mounted in tmpfs will be gone after a reboot, and there are some other possible side effects. Here are the changes I’ve made to /etc/fstab
tmpfs /tmp tmpfs defaults,nosuid 0 0
tmpfs /var/log tmpfs defaults,nosuid 0 0
tmpfs /var/run tmpfs defaults,nosuid 0 0
tmpfs /var/lock tmpfs defaults,nosuid 0 0
X windows settings
I’ve modified my /etc/X11/xorg.conf file to remove the NVidia logo when X starts up
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "NoLogo" "true" # yes I know
SubSection "Display"
Depth 24
EndSubSection
EndSection
Fluxbox window manager
I’ve found fluxbox to be very friendly, with low system overhead. Fluxbox is also pretty friendly when operating with no mouse. I’ve modified X to load fluxbox when I log in by adding the following to ~/.xsession
exec startfluxbox
Here are a few screen shots showing my desktop running conky, rxvt, google chrome, and World of Warcraft:




Video decoding acceleration using VDPAU
Current NVidia graphics hardware has support for VDPAU, allowing acceleration of video decoding. This is critical for Intel Atom based machines where decoding HD video would otherwise hit the CPU very hard. On my system, the load when playing back 720p HD video went from 100% (and incurring loss of audio sync, and complaints from mplayer) down to about 40%. The proprietary NVidia graphics driver includes headers to allow applications to be compiled with VDPAU support. For me this means recompiling mplayer, since it’s the only video application I use which can take advantage of VDPAU. I’ve read that ‘multimedia PC’ applications like XBMC also support VDPAU as well.
When compiling mplayer from source code, I passed the following options to configure in order to enable VDPAU
./configure --enable-vdpau --target=i686-linux
User Experience and Conclusion
Thus far, I’m happy with the N510. In summary:
- The system boots from complete power off to my desktop in about 50 seconds.
- Accelerated 720p video playback on the N510 is smooth with no audio sync issues.
- Subjectively, 3D performance in World of Warcraft is playable in most areas (using low quality settings).
- Overall performance feels similar to other netbooks, though the quality keyboard, large screen (for a netbook), and ION processor give it a more advanced feel.
- I was unable to test the native wireless lan module because I was unable to locate the necessary firmware. I have not had any problems using ndiswrapper as a work-around.