Author archives: Mike
A Day of Fun (QIII BSP File Loader)
Written by
on
in
Snaking.
While waiting for a server to get back online today I've been playing with a QIII map (BSP file) loader. Not much to it at the moment, it "parses" the whole file, but the rendering isn't particularly useful.
The loader uses numpy mmap'd files and typed views onto those to do the interpretation of the ...
Alsa Loopback Devices for Fun, but not yet profit...
Written by
on
in
Tuxedo.
So you want to be able to capture the output of N Alsa "devices" (think N separate programs). It seems like the correct solution to this should be an Alsa loopback device... so, here's how to create them.
- Add snd-aloop to your /etc/modules
- Add a file named /etc/modprobe.d/alsa-aloop.conf (content below)
- Create a .asoundrc that makes ...
ALSA Loopback for Fun and Profit
Written by
on
.
So I finally got the ALSA loopback working with gstreamer. Key is to use ALSA's plugs to get the right format on both sides of the capture:
{% for spk in cards %}
pcm.spk{{spk}} {
type plug
slave{
pcm "hw:Loopback{{spk}},0,0"
rate 48000
format S16_LE
}
}
pcm.monitor{{spk}}_snoop {
type dsnoop
ipc_key 68659{{spk}}
slave{
pcm "hw:Loopback{{spk}},1,0" ...
Really Dumb HTML5 Video Tag Back-end
Written by
on
in
Snaking.
So you want to create a stupid-and-dirty HTML5 video tag to allow you to monitor a (local-only) multicast stream from your (Django + Nginx) web site? Not something to be seen by "real people", but a way for you to see if anything is broadcasting?
This is a pretty simplistic thing, again; do *not* do ...
How can an audio server take up 900MB of RAM?
Written by
on
in
Snaking.
So we want to capture the (alsa) output of processes and pipe it into an mpeg-ts stream. Except gstreamer's alsasrc can't do "monitor", so we wind up having to do a pulsesrc... which brings the server to its knees in a few minutes with memory exhaustion for no reason I can fathom.
Annoying part is ...
Experience has some value... and risk
Written by
on
in
Snaking.
Each time I sit down to help someone relatively new to coding I find myself somewhat awe-struck at how much I've "forgotten". Just install nginx with gunicorn and django in a virtualenv. Package up your code with a setup.py using distribute. Run your unittests with Nose. Use sphinx and embedded doctests.
You tell someone that ...
Piping Data Around with Fussy
Written by
on
in
Snaking.
In one of those cases where you ask a question, don't get an answer, then spend far longer than you intended playing with the problem, I've just added a Pipe mechanism to Fussy (why to fussy, you ask? Well because that's where I wanted to use it). Basically it provides a small wrapper around subprocess ...
Kubuntu really does kinda rock quietly...
Written by
on
in
Tuxedo.
I just upgraded our last machine to Kubuntu 12.04 (the laptop has been running it since a beta). In place update with about 2 minutes offline... Debian/Ubuntu/Kubuntu really is amazing that way.
The new Kubuntu is pretty much just like the old Kubuntu. It works, is very pretty, but just gets out of the way ...
So apparently I don't need to write my own test code...
Written by
on
in
Snaking.
Just stumbled across the OpenGL Samples Pack, which is a bunch of OpenGL sample code for advanced features... exactly the kind of thing I need to test if I've got PyOpenGL working... of course, they're written in C, but it's way easier to translate from C to Python than to come up with dozens ...
2Day Python (Our Tutorial for Software Carpentry)
Written by
on
in
Snaking.
http://readthedocs.org/docs/2daypython/
and you can branch and alter/adapt the source (in restructured text) as you wish using:
bzr branch lp:2daypython
One thing that seemed ...