Sunday, October 4, 2009

ps3eye and ubuntu 9.10 karmic koala

Updated to ubuntu 9.10 today. Yay! It looks very nice, and the only issues I had were with the darn wifi firmware.

Here are the steps I went through to get the ps3eye (playstation 3 eye) webcam to work under ubuntu.

First follow the directions on this site:
http://kaswy.free.fr/?q=en/node/53

I do not know if all of these steps are critical. I will test that out after the next kernel upgrade. A few of the steps also need to be changes. For instance:
ln -s linux-2.6. linux
should be
ln -s linux-source-2.6. linux
and
cp /usr/src/linux-headers-2.6./Module.symvers /usr/src/linux
should be
cp /usr/src/linux-headers-2.6.-generic/Module.symvers /usr/src/linux
at least they were for my machine (a fresh install of ubuntu 9.10)

I have to say, kaswy did some amazing work here. 1,000,000 points to kaswy for being awesome! After this the ps3eye camera should work. However...

The audio was broken for me. I went through a few steps, but I believe the critical steps were:
kill pulse audio: pulseaudio -k
remove pulseaudio configuration: rm ~/.pulse
regenerate pulseaudio configuration: sudo dpkg-reconfigure pulseaudio

To get pulseaudio to see the ps3eye microphones, plug in the camera, and then go to your sound preferences in ubuntu. Switch to the 'input' tab, and then select the playstation eye.

Also, as a final note, to get the camera working in skype, you need to install the libv4l-dev package and run skype using the following command:
LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so skype

Sunday, August 16, 2009

mac os x 10.5.8 virtualenv

So in trying to setup the macbook pro that I got for my new job I needed to setup a virtual environment for python. The way I understand it, mac os x 10.5 (leopard) comes packaged with python, which lives at /Library/Frameworks/Python.framework/Versions/4.3.0/. This might not be the default as I'm still trying to get my mac legs so-to-speak, and may be a result of installing the enthought python package but either way I wanted to setup a virtual python environment to that any programs I install do not interfere with the existing python setup. This is where the virtualenv python package comes in.

Here are the basic steps I had to go through to setup a usable virtual environment for python.
  1. Install enthought python
  2. Configure enthought python repositories: enthought defaults to using it's own repository which requires a username and password. So...
    1. open /Library/Frameworks/Python.framework/Version/4.3.0/lib/python2.5/site-packages/.enstallerrc
    2. edit the [repos] section to list only the following line: 1 = http://pypi.python.org/simple,index
    3. save the file
  3. Install virtualenv: run: /Library/Frameworks/Python.framework/Versions/4.3.0/bin/easy_install virtualenv
  4. Make the virtual environment: run: virtualenv
  5. Now for some reason mac os x doesn't like python accessing the screen so there is a separate pythonw that you have to run for graphical apps (like scipy). However, virtualenv does not create a pythonw in the /myPython/bin directory. So...
    1. download install_pythonw.py and pythonw.c from http://github.com/gldnspud/virtualenv-pythonw-osx/tree/master and put them in the same directory
    2. run: python install_pythonw.py /myPython
    3. now you should have a pythonw file in /myPython/bin
  6. at this point you should have a working virtual environment in /myPython but there are a few more useful steps
  7. install useful packages: /myPython/bin/easy_install ipython pudb winpdb
  8. fix ipython: open /myPython/bin/ipython and change the first line to read: #!/myPython/bin/pythonw
  9. create useful aliases, for the fish shell you can do this by typing the following:
    1. alias python /myPython/python
    2. alias ipython /myPython/ipython
    3. alias easy_install /myPython/easy_install
    4. funcsave python
    5. funcsave ipython
    6. funcsave easy_install
  10. add /myPython/bin to the path (again for fish shell)
    1. open ~/.config/fish/config.fish
    2. add the following line: set PATH $PATH /myPython/bin
  11. and (finally) you're done