PD and jack
I wanted pd, mpd, and libao-using programs all to be able to play sound on an EeePc 900A running Ubuntu 11.04.
pulseaudio wasn't working (the device name in pd was garbage bytes, and it would always fail after about a day). Plain alsa wasn't working, since I couldn't get multiple clients playing at once even with dmix. I finally got jack to work, which is pd's preferred solution anyway. Here are the steps that I think were needed:
- When you install jackd2, agree to the realtime priority stuff. Run "sudo dpkg-reconfigure -p high jackd2" if you need to be asked that question again. (original forum post)
- Make sure your user is in the 'audio' group.
- Write this to ~/.asoundrc (alsa docs)
pcm.jackplug {
type plug
slave { pcm "jack" }
}
pcm.jack {
type jack
playback_ports {
0 alsa_pcm:playback_1
1 alsa_pcm:playback_2
}
capture_ports {
0 alsa_pcm:capture_1
1 alsa_pcm:capture_2
}
}
# not necessary if all clients can set their device to 'jackplug'
pcm.!default {
type plug
slave { pcm "jack" }
}
- Put the lines "default_driver=alsa" and "dev=jackplug" in /etc/libao.conf (libao docs)
- Arrange for "jackd -d alsa" to be running
- Give mpd.conf this pretty output block:
audio_output {
type "jack"
name "My jack Device"
}
- Test with "aplay -Djackplug some.wav" and "aplay some.wav" (the default device setting)
- Run qjackctl to see what's going on. It's like pavucontrol, for jack. You don't need to press its play button. Open the 'Connect' window to see current clients and connections.
- Run pdextended with -nrt -jack
Pixxo webcam IR filter
The Pixxo USB WebCam, model A-MW2130, has a separate infrared filter that is very easy to remove. You just unscrew the outer case, unscrew the lens, and pop out the square filter piece. It looks kind of like the one in this demo.
The AW-M2130 works fine under linux with v4l2. Here are the controls:
% v4lctl -c /dev/video1 list
attribute | type | current | default | comment
-----------+--------+---------+---------+-------------------------------------
norm | choice | (null) | (null) |
input | choice | zc3xx | zc3xx | zc3xx
contrast | int | 128 | 128 | range is 0 => 256
Gamma | int | 4 | 4 | range is 1 => 6
Auto Gain | bool | on | on |
Light freq | choice | 50 Hz | 50 Hz | NoFliker 50 Hz 60 Hz
Sharpness | int | 2 | 2 | range is 0 => 3
The camera was $10 at Frys.
Old oprofile config files
If opcontrol or oprof_start says this:
/etc/oprofile/daemonrc: 1: CHOSEN_EVENTS[0]=CPU_CLK_UNHALTED:100000:0:1:1: not found
just remove that daemonrc file. It's from an old run when the config lines were a little different. oprof_start will make a new one with a line like this:
CHOSEN_EVENTS_0=CPU_CLK_UNHALTED:100000:0:1:1
Running firefox 3.1 under 64-bit ubuntu
If you get firefox 3.1 and try to run it on a 64-bit ubuntu hardy install, you'll probably get this failure:
./firefox-bin: error while loading shared libraries: libdbus-glib-1.so.2: cannot open shared object file: No such file or directory
- Install 'ia32-libs' with "sudo aptitude install ia32-libs" (or use the synaptic GUI)
- Go get the i386 version of libdbus-glib and save the .deb file somewhere.
- Run "file-roller /tmp/libdbus-glib-1-2_0.74-2_i386.deb".
- Go into data.tar.gz -> . -> usr -> lib, and copy libdbus-glib-1.so.2.1.0 to /usr/lib32 (or right to your firefox 3.1 directory, if you want to avoid writing to /usr).
- Run 'sudo ldconfig' to make the libdbus-glib-1.so symlink
Now you should be able to test firefox 3.1 and play some of the videos from here. The one called 'video embedded in svg' is impressive, although on my system I only got one video at a time and the audio sync drifted. See this screencast (or youtube) for what it should look like.
2009-09-02 Updated with comments from Krellan
OpenCV in python
Here's a tiny demo of using the opencv face finder on a PIL image and displaying the result with pygame:
That's using the SWIG opencv interface (available on ubuntu from the python-opencv package), not the recently-released pycv (which I know nothing about).
My headtrack project is an attempt at something like Johnny Chung Lee's head tracking project. I tried opencv since I don't have a wiimote yet. My goal is to move my desktop windows according to my head position, so I can peek around a window or lean in to look at windows that are outside the normally-visible screen.
Meanwhile, the compiz hackers started a similar project.
Gutsy upgrade awful
I upgraded my laptop from ubuntu feisty to gutsy, and nothing got better. Several things broke. While trying to fix them, I improved my setup a little tiny bit.
The auto installer failed several times on cupsys. Then it had some exception while working on initramfs (!) and gave up. Somewhere during the upgrade, my keyboard broke and was typing nonsense. At least that corrected after the reboot.
On reboot, I seem to be on 7.10 despite the upgrade saying it failed. I reinstalled cupsys and a few other things. I used to use ndiswrapper and linux-wlan-ng for my two wifi adapters, but neither of those work now. The bcm43xx module seems to work, so I can run my worse-quality wifi adapter. linux-wlan-ng claims not to support kernel 2.6.22, so I guess I can't use my usb wifi card for now.
The gutsy version of the power applet started waking up every 30 seconds to tell me I unplugged, when really I was running on AC power and my flaky battery wasn't charging. (It starts charging after a few remove/replugs.)
I tried 'desktop effects' to see if compiz would work. It broke my desktop switching and added window shadows. I restarted X, and lost window borders but gained wobble windows. I never got desktop shadows back. http://ubuntuforums.org/showthread.php?p=3600201 worked for disabling Xgl, which was taking lots of CPU.
emacs wouldn't start. It said "No fonts match 'Monospace-10'". I found various matches for that phrase in google, but didn't see a solution.
Sick of gnome and its WMs, I installed fvwm2 which is what I use on all my desktops. I had it start up with gnome-panel to get the applets I was used to. I thought fvwm had a control for "don't let windows move into this panel's space", but I can't find it now. Anyway, running fvwm instead of metacity is the small improvement I performed today. The suspend button on gnome-panel now quits gnome-panel, so I made a different launcher for "gksudo /etc/acpi/sleep.sh". I'm not sure how to do suspend without requiring a sudo.
Over in fvwm (or maybe after enough X restarts), emacs started working again.
Then I discovered http://www.fvwm.org/doc/unstable/modules/FvwmTabs.html which looks like it might be great if I can stop tripping on its focus bugs.
---
Forgot to mention: the text-mode virtual consoles don't have logins anymore. That's sure to bite me when I'm doing some important demo for someone.
Disable launching of evolution on feisty
This is a tip for Ubuntu users who are not evolution mail users.
I run fvwm2 with my own key bindings, and when I upgraded Ubuntu from dapper to feisty, some new key bindings started taking precedence. If you too are having the problem where pressing the mail key (keycode 236) is launching evolution, then you probably also want to run gnome-keybinding-properties and shut that binding off. There's certainly a way to do this in gconf too, but I don't know what the ids are there.
On the other hand, the new bindings to the volume keys and play/pause are nice so I guess I can thank Ubuntu for forcing me to notice them :) The play/pause button now talks to rhythmbox as you'd expect.
Sharing ubuntu package caches is practically impossible
host1 is running feisty. It has 1.4GB of package files left over from the install (and possibly past installs).
host2 is upgrading to feisty. The update-manager screen says I have 1h47m remaining to download at 164kb/s. What a no-brainer. I should be able to find the following instructions somewhere:
On your host that may have some packages, run this server: apt-cache-serve
On your host that needs some packages, append this line to your sources.list: "deb http://host1:3124/ feisty multiverse"
Run "aptitude update" and then proceed with your install. Packages will be retrieved from host1 when possible. The usual sources will provide all the rest.
No other configuration should be required, except MAYBE to adjust the port for my imagined apt-cache-serve. The point here is not to become an ubuntu repository with complete sets of signed packages. The point is to save some downloading time by using local copies of files I've already fetched.
Instead of that fantasy, I find they did write 'apt-cacher' and it's a total configuration mess. I tried the instructions here: http://www.debuntu.org/book/export/html/119
By default, apt-cacher doesn't use the packages that are already on host1. You can run some importer program which moves the packages out of /var/cache/apt! Why would I want to lose my working apt cache? The instructions guide you through replacing host2's sources.list with pointers to host1. I tried appending the host2 line (since I need host2 to look at real repos as well as my cache), but I got errors like this:
Err http://host1 feisty/multiverse Packages 500 Can't connect to dists:80 (Bad hostname 'dists') Err http://host1 feisty/multiverse Sources 500 Can't connect to dists:80 (Bad hostname 'dists')
where 'dists' is not a word that appears in sources.list or in any config file I touched during setup.
But, what would still be much more useful than a usable apt-cacher is the missing tool that tells me what files I modified after installing my packages. http://ideas.4brad.com/package-packager-compartmentalize-my-system-changes has more on that one.
Atom feed of this blog