Making the Playstation Eye’s microphones work on Linux
I'm the proud owner of a PlayStation® Move system and also a proud user of the Arch Linux distribution. As much as pride is concerned, it's not very “proudful” when you decide to give your PlayStation® Eye (PS3 Eye) a try as a webcam, and you realize it doesn't quite work as you expected. This post investigates this issue and proposes a solution.
All I wanted was to see something similar to the following image. Keep reading if you want to know how to do it.
As one can see, by the output of the following command, my system had no trouble recognizing the PS3 Eye as a sound “card”:
$ cat /proc/asound/cards 0 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xfbff8000 irq 43 1 [CameraB409241 ]: USB-Audio - USB Camera-B4.09.24.1 OmniVision Technologies, Inc. USB Camera-B4.09.24.1 at usb-0000:00:1d.0-1.1, hi
(Un)Fortunately, I don't really use ALSA directly. Instead, as most kids these days, I use the PulseAudio sound server to manage the access to my sound card. So, even though ALSA can recognize the PS3 Eye microphone array just fine, PulseAudio can't2.
Once you understand what you want to do, and who is responsible for it, the solution is quite easy.
Fortunately, PulseAudio supports configuration files and comes with good
documentation. Upon startup, its daemon reads and interprets the files
/etc/pulse/default.pa. Thus, all we have to do is
to instruct PulseAudio to look for the PS3 Eye when loading.
In our case, we want to add a new alsa audio source, and adding the line
"load-module module-alsa-source device=hw:1,0" to
does the trick for the whole system. Or, in the shell:
$ sudo echo "load-module module-alsa-source device=hw:1,0" >> /etc/pulse/default.pa
How can I know what to pass as an argument to device?
You might be asking yourself that question. Fear not, dear friend. With ALSA,
you can always take a look at the /proc/asound/cards file. There, you will see
the index of your device. On my case, the PS3 Eye was on line 1 with the label
CameraB409241. Then, for the PS3 Eye, you will want the stream with index zero.
Thus, hw:1,0 is our device. The directory
contain all the information you might need about your card.
A small problem
It seems like the PS3 Eye must be connected when the PulseAudio daemon is
brought up. To prevent from having to logout/login, you can use the pacmd
command. It supports the same syntax of the
/etc/pulse/default.pa file. So,
$ pacmd load-module module-alsa-source device=hw:1,0
Will work just fine.