Impression about my GSoC with HAIKU and USB isochronous support status

Blog post by emitrax on Wed, 2007-09-05 13:32

During this summer I had the chance to improve myself, and work on the USB isochronous support of HAIKU. I wrote some code for every layer of the HAIKU USB stack: USBKit library, usb_raw driver, usb bus manager and most of all the uhci driver. I also spent/waisted some weeks with the usb_webcam media addon, but sadly with not success. Anyway here is what I did.

UHCI driver: Basically I added all the necessary code to handle isochronous transfer in both direction (in and out).

USB stack manager: As above, I added the necessary code to handle isochronous request plus a feature that was missing in the stack and I needed in order to use my webcam. Basically the possibility to choose a different alternate settings for an interface was missing. The code that implements this feature, along with some more code, is still hanging in my computer as it has not been reviewed yet. Not worries though, it will soon be included in the main tree.

USBKit library: Same here. I've added the code to submit isochronous request from user space and to set a different alternate settings. I also modified Francois utility (usb_dev_info) to display all the info about different alternate settings. This code is also still in my computer, but as I said, don't worry ;)

usb_raw driver: like you can imagine, I've added the necessary ioctl commands to handle both isochronous request, and alternate settings feature.

The main reason why some code is still not included in the main tree, it's because it breaks binary compatibility with the USBKit, as I added some more needed command to handle the alternate settings feature.

The most difficult part of my work was the testing as there was not working driver that uses isochronous transfers. I first tried with adding the support for my webcam to the usb_webcam media addon, but it turns out to be more difficult than I thought, because it wasn't very easy to debug for me. So after waisting some more days trying to compile a messy kernel driver provided by my mentor :-) , I finally come up with the idea of implementing the driver for my webcam as user space utility by using the USBKit and so bypassing the media server. This time it was very easy to debug. I managed to get some data but I didn't write the part the actually parsed the data and decoded the frame, as I ran out of time. I though compared the data I was getting with the one sniffed with usbsnoop on linux while running XP on vmplayer and some long hex patterns matched, which are supposed to be some sort of sync pattern. Beside, when putting the camera under my white lamp I was getting 0xff data, which looked very clear to me.

Anyway, I must say that I'm not very happy about the testing, I hoped I could do more but as I said, I waisted some weeks trying with the wrong method to test my code. Sorry guys.

Anyway, I'll be off for some weeks now, as I have my last exams and then I'll probably move to Pisa (any BeOS/HAIKU user over there?). Then I should finally managed to finish reading the OHCI spec I printed out month ago, and I promised I would work on.

Salvo

Comments

Re: Impression about my GSoC with HAIKU and USB isochronous supp

Can i make the advice to make some backup for your precious code ? ;)
Thanks indeed and good luck with your exams

Re: Impression about my GSoC with HAIKU and USB isochronous supp

Hi Salvatore,

hopefully you have no regrets... that not everything works smoothly is expected. Important is that you had fun and learned stuff. Thank you very much for your hard work, I am looking forward to seeing it included in our tree! Hopefully you will stick with us, your contributions are greatly appreciated!

Re: Impression about my GSoC with HAIKU and USB isochronous supp

I agree with Stephan: the most important in this kind of training session is to learn something, not having a finished stuff at the end (even if it's always better to see our work up 'n running).
Hope you like working on Haiku and that you will stay with us !

"your contributions are greatly appreciated" ² !

Re: Impression about my GSoC with HAIKU and USB isochronous supp

Thank you for all your work - you can feel great about all you accomplished! I hope your studies allow you to work on OHCI support for selfish reasons - my hardware requires USB Keyboard and mouse and uses OHCI so I cannot use Haiku every day until OHCI is working. When you work on it, I'll be ready to test! Best of luck for your exams and studies.

Re: Impression about my GSoC with HAIKU and USB isochronous supp

Hi Salvatore,

If you told us "Everything went perfectly, everything worked out exactly like I intended it to!" I'd most likely think you were a pathological liar, because I can't remember any project of similar complexity that I've seen and personally been involved in that didn't have something go awry :) congratulations for not coming out a mess from the stuff that happens :)

I trust that this has been an incredibly valuable learning experience for you that also looks good on your resume/CV not to mention the Good Thing (TM) that it greatly helps Haiku get going with proper USB support, and oh, you earn a little money, too :)