{"action":"created","issue":{"url":"https://api.github.com/repos/mossmann/hackrf/issues/163","labels_url":"https://api.github.com/repos/mossmann/hackrf/issues/163/labels{/name}","comments_url":"https://api.github.com/repos/mossmann/hackrf/issues/163/comments","events_url":"https://api.github.com/repos/mossmann/hackrf/issues/163/events","html_url":"https://github.com/mossmann/hackrf/issues/163","id":64248459,"number":163,"title":"Detach the kernel driver automatically","user":{"login":"ao2","id":1249395,"avatar_url":"https://avatars.githubusercontent.com/u/1249395?v=3","gravatar_id":"","url":"https://api.github.com/users/ao2","html_url":"https://github.com/ao2","followers_url":"https://api.github.com/users/ao2/followers","following_url":"https://api.github.com/users/ao2/following{/other_user}","gists_url":"https://api.github.com/users/ao2/gists{/gist_id}","starred_url":"https://api.github.com/users/ao2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ao2/subscriptions","organizations_url":"https://api.github.com/users/ao2/orgs","repos_url":"https://api.github.com/users/ao2/repos","events_url":"https://api.github.com/users/ao2/events{/privacy}","received_events_url":"https://api.github.com/users/ao2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-25T11:36:50Z","updated_at":"2015-04-08T10:20:09Z","closed_at":null,"body":"Hi,\r\n\r\nI saw some complaints about the kernel driver interfering with libhackrf:\r\nhttps://twitter.com/michaelossmann/status/579303581829988352/photo/1\r\n\r\nThere is a fairly easy solution to that, also proposed by the kernel driver developer: let libusb detach the kernel driver.\r\n\r\nHere is a patch which can be applied with ```git am```:\r\nhttp://ao2.it/tmp/0001-Automatically-detach-reattach-the-kernel-driver-if-l.patch\r\n\r\nI only compiled-tested the patch, I don't have a hackrf myself.\r\n\r\nif you want you can amend it to use ```true``` instead of ```1``` but I used ```1``` because that's what libusb expects.\r\n\r\nCiao,\r\n   Antonio"},"comment":{"url":"https://api.github.com/repos/mossmann/hackrf/issues/comments/90872140","html_url":"https://github.com/mossmann/hackrf/issues/163#issuecomment-90872140","issue_url":"https://api.github.com/repos/mossmann/hackrf/issues/163","id":90872140,"user":{"login":"ao2","id":1249395,"avatar_url":"https://avatars.githubusercontent.com/u/1249395?v=3","gravatar_id":"","url":"https://api.github.com/users/ao2","html_url":"https://github.com/ao2","followers_url":"https://api.github.com/users/ao2/followers","following_url":"https://api.github.com/users/ao2/following{/other_user}","gists_url":"https://api.github.com/users/ao2/gists{/gist_id}","starred_url":"https://api.github.com/users/ao2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ao2/subscriptions","organizations_url":"https://api.github.com/users/ao2/orgs","repos_url":"https://api.github.com/users/ao2/repos","events_url":"https://api.github.com/users/ao2/events{/privacy}","received_events_url":"https://api.github.com/users/ao2/received_events","type":"User","site_admin":false},"created_at":"2015-04-08T10:20:09Z","updated_at":"2015-04-08T10:20:09Z","body":"So was it just that the code was not compiled in? Does the auto detach feature itself actually work?\r\n\r\nIf so, I can prepare a patch which checks both symbolic constants.\r\n\r\nAbout when to call ```libusb_set_configuration``` I though about that too, I am going to ask libusb developers about it. Problem is that the kernel driver detaching is currently performed when claiming the interface, if it turns out it should be performed before setting the configuration the auto detach mechanism as implemented in current/older libusb is not going to work as it should, and we'd be better off adding the explicit detach before setting the configuration.\r\n\r\nLet's see what libusb devs say first."}}