{"action":"opened","issue":{"url":"https://api.github.com/repos/LibUsbDotNet/LibUsbDotNet/issues/24","repository_url":"https://api.github.com/repos/LibUsbDotNet/LibUsbDotNet","labels_url":"https://api.github.com/repos/LibUsbDotNet/LibUsbDotNet/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/LibUsbDotNet/LibUsbDotNet/issues/24/comments","events_url":"https://api.github.com/repos/LibUsbDotNet/LibUsbDotNet/issues/24/events","html_url":"https://github.com/LibUsbDotNet/LibUsbDotNet/issues/24","id":269632523,"number":24,"title":"LinuxDeviceNotifier \"MonitorDevDirectory\" mode does not seem to work","user":{"login":"TAGC","id":1588951,"avatar_url":"https://avatars2.githubusercontent.com/u/1588951?v=4","gravatar_id":"","url":"https://api.github.com/users/TAGC","html_url":"https://github.com/TAGC","followers_url":"https://api.github.com/users/TAGC/followers","following_url":"https://api.github.com/users/TAGC/following{/other_user}","gists_url":"https://api.github.com/users/TAGC/gists{/gist_id}","starred_url":"https://api.github.com/users/TAGC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TAGC/subscriptions","organizations_url":"https://api.github.com/users/TAGC/orgs","repos_url":"https://api.github.com/users/TAGC/repos","events_url":"https://api.github.com/users/TAGC/events{/privacy}","received_events_url":"https://api.github.com/users/TAGC/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-30T15:01:59Z","updated_at":"2017-10-30T15:01:59Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"LibUsbDotNet contains two strategies for publishing notifications about USB system events when running under Linux - a \"MonitorDevDirectory\" strategy and a \"PollDeviceList\" fallback option.\r\n\r\nI'm trying to build an application that responds to USB system events when running on Linux and I've noticed it always seems to fall back to the \"PollDeviceList\" strategy even though the host machines have a standard `/dev` directory (this is how I noticed #19).\r\n\r\nI didn't give much thought to this as the fallback strategy seemed to work well enough. Unfortunately, I've run into problems with that strategy as well which seem like they could be avoided if the `MonitorDevDirectory` strategy were used.\r\n\r\nIt's hard to track exactly what's happening as this library doesn't have any logging and I can't easily debug it when it's running within a Docker container on my Raspberry Pi, but From [here](https://github.com/LibUsbDotNet/LibUsbDotNet/blob/master/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.cs#L48) it seems that `LinuxDeviceNotifier` will fall back from the \"Monitor\" strategy to the \"Poll\" strategy if `mLinuxDevItemList` is empty after `BuildDevList` returns.\r\n\r\nHere's what looks odd to me: `BuildDevList` seems to be looking for USB device handles with this: `string[] deviceInterfaceFiles = Directory.GetFiles(mDevDir, \"usbdev*\", SearchOption.TopDirectoryOnly);`\r\n\r\nAssuming that `mDevDir` is its default value `dev/`, this will match things like `/dev/usbdev*`. However, on typical Linux machines USB devices are enumerated under `/dev/bus/usb/...`, so I don't get where that comes from."}}
{"actor":{"display_login":"TAGC"}}