Bandwidth issues that might arise when building an eye tracker
Maybe I’m just unlucky, but I ran into this problem head-on a few months back, and it took me a while to figure out exactly what was wrong, as none of the online howtos seemed to have any relevant information… so I’m posting a bit about that. I wanted to fit some of this on the conference poster I’m presenting this Friday (before Shabbes) but I couldn’t shoehorn everything into 90 x 150 cm and still keep it reasonably readable from a distance!
What to do if you experience framedropping, glitches, etc. while recording from two USB webcams at the same time which are not present when you’re only recording from one of them? 1. Don’t panic 2. read this quick howto!
Basically you have two webcams taking images at a resolution of at least 640 x 480 at 30 frames per second. If you’re unlucky like me, then you end up in a situation where both cams work fine when used individually, but when both are plugged in, the video seems to stutter and drop frames, even though you have USB 2.0 slots. Unfortunately this situation was not covered on any of the low-cost eyetracking websites I came across. I was really stumped, at first I thought it was a driver issue with my Logitech webcams, but it arose both under Linux and under Windows, so eventually had to I rule that out.
The real reason is that on some laptops (maybe even desktop computers…), all of the USB slots are assigned to the same USB bus. An USB bus is inside your computer, so normally you can’t tell by inspecting your laptop visually. Even slots on different sides of your laptop can be assigned to the same bus!
This is how to tell:
1. Unplug all of your USB devices.
2. Run the command “lsusb” under Linux. This shows you all of your USB buses.
3. Plug one of your devices into one of the slots.
4. Run lsusb again. The device should appear on the list, assigned to a specific bus.
5. Unplug the device.
6. Repeat 3-5 until you’ve found out which USB slots on your laptop connect to which buses. I have 3 slots, all of which belong to the same bus! (There might even be internal buses you can’t access without taking the laptop apart – in my laptop there is a built-in fingerprint reader which has its own bus all to itself, as you’ll see in the sample image below.)
7. Connect both cams to USB slots which belong to different buses.
8. Record!
This is an example of what you should see when you’re finished – both cameras plugged in, each on a different bus (click to enlarge):
If you’re unlucky, all of the available slots belong to the same bus. Or maybe you have slots where your device does not fit (some laptops have slots in really unwieldy locations) or you just don’t want to unplug something. What to do now?
The solution is to buy a PCMCIA to USB converter. These are reasonably cheap and most laptops have a PCMCIA slot where you can put them (or even two). Put the PCMCIA card into your laptop, boot up, plug one of your cams into a free USB slot and the other into the card. This way the data flow from both cameras won’t be directed through the same USB bus and you will hopefully experience smooth video on both.
Disclaimer:
This worked for me and is a cheap solution to a persistent problem I had when building my eye tracker. Still, no guarantees! It might not work for you. Try it at your own risk.
Unfortunately there is a nasty followup to this, namely that the bandwidth required is quite a lot – take a look at device bandwidths on Wikipedia and you can see that USB ranks quite high on the list. So if you want to make your head-mounted rig wireless, then Bluetooth is probably not an option, having much less bandwidth than USB (though I haven’t tried yet, but it looks futile). The ideal solution would be WUSB or the new third-generation Bluetooth protocol, but these are really “emerging technology” in the worst sense of the word – expensive, easy to break, hard to find, etc. Still, in a few years you will probably be able to do that in a relatively cheap and painless way, so keep this in mind!
For the time being, if you really need to make your recording rig portable, you can mount your laptop on your back… I have an ultraportable, so this works for me! One might think Eee PCs or similar netbooks would also be suitable, but unfortunately video recording is quite processor-intensive, so you want a powerful computer (or some custom-built setup). And powerful ultraportables are really expensive (I didn’t buy mine for eye tracking either…). Anyway, most eye tracking these days is aimed at people sitting in front of a screen, not wandering around and interacting with random objects, so it’s probably not a problem if your rig is not wireless (it’s quite portable anyway). I just think it would be cool.
Also, lots of eye trackers only use one camera, but I don’t like those setups – compensating for head movements is much easier if you have a scene camera in addition to the eye camera. Of course, I’m doing offline measurements… a lot depends on exactly what you want to do, and there is a tradeoff between accuracy and online processing.
No Comments »
RSS feed for comments on this post. TrackBack URL






