By the Fading Light
of an evanescing moon

By the Fading Light

Quick Tip: Fabricate a Windows Key

May 16th, 2006

For quite a while keyboards have shipped with what most people call the “windows key”. Most windows users know it as the key to open the start menu, and more advanced users know the shortcuts that go along with it, such as Win+L to lock the workstation, and Win+D to minimize all windows. This can come in handy for your X11 window manager as well, but not all of use are fortunate enough to have a microsoft tagged keyboard. And sometimes those older keyboards are just better! ( And sometimes we spill our drink, don’t mix alcohol with linux while in knowledge of the root password and or the hardware ).

Anyways, if you want to take advantage of these shortcuts in your favorite window manager, you are going to need a key to use in place of it. Fortunately I have the perfect suggestion. The most useless key for almost anyone who has surpassed touch typing, is the caps lock key. Not to mention that it gets in the way sometimes. Simple add the following lines into a file in your home directory, such as ~/.xmodmap

remove Lock = Caps_Lock
keysym Caps_Lock = Super_L

Now (if you’re using bash) edit your ~/.bashrc and add a line that says:

xmodmap ~/.xmodmaprc > /dev/null 2>&1

On the next start of X, your caps lock key will no longer toggle the light, or effect the capitilization. It will also be sending the keycode for the winkey! If you would like the changes to take affect immediately, simply run the command you added to your bashrc:
xmodmap ~/.xmodmap
You could also consider adding this to the startup of your window manager, so that it’s only run once. Under KDE this may be accomplished by putting a link to the command in ~/.kde/Autostart/

This can be a big help if you want a function desktop without paying up for a shiny new keyboard.

Logitech USB Desktop Microphone in Linux

May 6th, 2006

So you decided to go with the logitech usb mic, and now it’s being a pain in linux. Sure, you plugged it in and it was recognized, things aren’t as bad as they used to be for us, but half of your apps aren’t using it!

First off, this guide only fixes the problem for an application that uses ALSA. OSS has its problems, and I would rather leave them behind when possible. If you are using OSS, the mic shows up as the next available /dev/dsp device, and your application may let you specificy a device for input and output seperately. With Gizmo this is done using the -x -m and -s arguments.


-x, --mixer[=/dev/?] Set the mixer audio device
-m, --mic[=/dev/?] Set the mic audio device
-s, --speaker[=/dev/?] Set the speaker audio device

If you are using Skype, their Linux Sound FAQ - ALSA may be of some help. It seems more picky about things from what i’ve seen, although I haven’t actually used it. Their forums state that ALSA support is being developed, though I didn’t noticed any progress since October.

Now, I opted to use ALSA, and things don’t seem to be quite as easy as passing a device parameter. I first tried specifying hw:1,0 as the device, but it didn’t help. A lot of snooping around to figure out how to “link” devices in my asoundrc file (which i’ve played with before, trying to get spdif out working when I first upgraded from OSS on slackware) and I’ve found this:


pcm.!default {
type plug
slave.pcm "combined"
}

pcm.combined {
type asym
playback.pcm "playback"
capture.pcm "hw:1,0"
}

pcm.playback {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 0
1 1
}
}

ctl.dmixer {
type hw
card 0
}

Put that into your ~/.asoundrc file and any applications using ALSA should pick up your mic as the default capture device, while still using your first card for playback. This of course requires that your system has two “cards”, with the microphone being second. If you have a different setup, change the device numbers.
cat /proc/asound/devices
This will list your options. The mic will only have entries for audio capture and ctl.

Now that it is working, you will most likely also want to record audio files. Podcasting has become popular, and I’ve seen Audacity reccommended multiple times. I’ve used it on numerous occasions for odd jobs, however the current situation is less than ideal. Audacity doesn’t natively support ALSA, and doesn’t let me change the default dsp device. Even if it did, I would have to choose - recording, or playback. Not both.
Things are looking forward though, it is being developed and if you need it right now just compile with
./configure --with-portaudio=v19 --without-portmixer

More information at their wiki

Since I was forced to use something new to record, I ended up finding mhWaveEdit. I am impressed with it, and love the pause recording button. I did use Audacity to edit the wave and export as ogg and mp3, however you may want to check out Rosegarden if you also do MIDI, as it is possible to record audio. I had no luck with krec and krecord, they seem to be stuck on OSS, however that may be my distribution. Kwave looked interesting, but I Haven’t had a chance to use it so far, as it was giving me buffer errors. It does see the device though!

Lastly, if you want to play with your asoundrc some more, check out the alsa documentation. There is plenty to read, And this is a good place to start. If you need oss the page mentions this method combined with aoss. I hope you’ve found this useful, and if you have anything to add feel free to email me or leave a comment.

First Post

May 5th, 2006

Right now, for crache.net I’m going to just set up a simple blog. Actually, now that you’re reading this, it has been done. I want to post things that other people will actually find interesting, rather than my various diary worthy blab. I decided to get a microphone the other day, and grabbed logitechs usb desktop mic. A lot of people are having trouble with it in linux, though I’ve solved it all. I will post a mini guide next, explaing how set the mic as a subset of the default sound hardware.

I looked around at VoIP solutions, and didn’t like skype that much. I want something with up front linux support, and from there I looked at gizmo, and another promising looking provider that didn’t have a closed source client. I decided to go with gizmo though. I liked the client, even for Gtk. I also liked what I saw at the site, the forums, and of the staff. I bought 1000 callout minutes and am very pleased with the quality. I would by a callin number, but the closest one is Augusta. Maine may not be populated, but I don’t think my IP phone should connect at the capitol!

I choose the usb mic hoping for less noise, and it was right on target. The quality is *very* good. It has a nice button on the base to mute, and glows while on, so you have fair warning. The guide will be up soon. Until then;

Gizmo Project
Logitech USB Desktop Microphone

ps. I’ve attached of Darcie recalling waking me up this morning.