LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 10-29-2008, 11:10 AM   #1
tm007
LQ Newbie
 
Registered: Sep 2007
Posts: 9

Rep: Reputation: 0
Playing with the iPod HID Interface


I wanted to play with USB in Linux and look at the iPod HID interface. I would like to decode the HID report descriptor and see if there is anything useful.

I get very different results depending on my setup. If I run Ubuntu 7.04 using the VMPlayer I get a -EPIPE (Broken Pipe) error when I try to read the HID report descriptor. If I run Ubuntu 7.10 or 8.04.1 native on a desktop the claim fails with an -EBUSY. The VMPlayer uses UHCI and the desktop uses EHCI.

I am doing the following:
* Check for attached kernel driver (usb_get_driver_np)
* If a driver is attached, detach it (usb_detach_kernel_driver_np)
* Do a SET_CONFIGURATION on the HID configuration (usb_set_configuration(0x2))
* Claim the HID interface (usb_claim_interface(0x2))
* Select the HID's correct alt interface (usb_set_altinterface(0))

I have seen that either xpad and snd-usb-audio attach once I do the set configuration. I have created a file under /etc/modprobe.d with "install xpad sleep 0.1" etc. to stop the drivers from attaching but this still does not work. I have also modified my program so it checks for attached drivers after the set config and detaches them there prior to the claim but this does not work.

I have also looked at the kernel code but the EPIPE error is not used often. I modified the kernel to dump the call stack during the setting of the EPIPE and I get the following:
uhci_map_status: EPIPE returned
[28951.497345] [<f88ca4d2>] uhci_map_status+0x62/0x70 [uhci_hcd]
[28951.497370] [<f88cbf17>] uhci_scan_schedule+0x227/0x990 [uhci_hcd]
[28951.497387] [<c0188039>] __d_lookup+0x89/0x110
[28951.497441] [<f88ce355>] uhci_irq+0x75/0x1a0 [uhci_hcd]
[28951.497455] [<c01883d7>] d_alloc+0x107/0x190
[28951.497481] [<f88aa3f2>] usb_hcd_irq+0x22/0x60 [usbcore]
[28951.497797] [<c0153930>] handle_IRQ_event+0x30/0x60
[28951.497815] [<c0154fab>] handle_fasteoi_irq+0x7b/0xf0
[28951.497832] [<c0105b80>] do_IRQ+0x40/0x80
[28951.497851] [<c0104233>] common_interrupt+0x23/0x30
[28951.497884] [<c012b3fb>] __do_softirq+0x5b/0x100
[28951.497912] [<c012b4f5>] do_softirq+0x55/0x60
[28951.497920] [<c01154b5>] smp_apic_timer_interrupt+0x75/0x80
[28951.497930] [<c01042f8>] apic_timer_interrupt+0x28/0x30
[28951.497963] [<c01645ad>] __handle_mm_fault+0x26d/0xa40
[28951.497979] [<c017f3d7>] getname+0xa7/0xd0
[28951.497996] [<c01810d9>] __user_walk_fd+0x49/0x60
[28951.498015] [<c0179a4a>] sys_readlinkat+0x3a/0xd0
[28951.498031] [<c0180d59>] do_rmdir+0xb9/0xe0
[28951.498060] [<c02f09c8>] do_page_fault+0x128/0x600
[28951.498100] [<c02f08a0>] do_page_fault+0x0/0x600
[28951.498109] [<c02ef07c>] error_code+0x7c/0x90
The interesting thing is that I don't see a call to uhci_map_status() from uhci_scan_schedule--unless I am looking at the wrong code.

Has anyone tried to experiment with the iPod HID interface? Or does anyone have any idea why I would be seeing this EPIPE error? Any help would be much appreciated!
 
  


Reply

Tags
hid, ipod, usb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Coding HID interface using libusb FLLinux Programming 0 03-04-2007 02:21 PM
How To Interface Ipod and Slackware 10.2 DragonRider Linux - Hardware 2 08-22-2006 03:04 PM
Playing ogg vorbis files in ipod chandan Linux - Software 7 01-02-2006 02:52 PM
HID ( Human Interface Device ) USB saeed371 Debian 1 10-16-2005 06:47 PM
HID interface configuration paksas Linux - Laptop and Netbook 1 05-01-2005 03:58 PM


All times are GMT -5. The time now is 04:50 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration