From: Alex <Ale...@ya...> - 2011-08-11 06:36:00
|
Greetings. I've faced a problem getting my libusb-w32 based program to detect devices. The program has to detect digital cameras, and I need to automatically install driver filter for any new camera to be detected without any manual work. I've used install-filter i --class={6BDD1FC6-810F-11D0-BEC7-08002BE2092F} , i. e. installing filter for MTP devices, and it seemed to work. But today I tried it on a clean machine and found out it actually only seemed that way. Tried install-filter with different parameters - no luck. The only way I was able to detect devices at all was to use the inf-wizard.exe. It installed the driver, enabling my program to detect devices, but also disrupting the original Windows functionality for digital cameras. Then, I've uninstalled the libusb driver, installed the original windows driver back, executed install-filter i --class={6BDD1FC6-810F-11D0-BEC7-08002BE2092F} - and the program is still able to detect devices. The question is: how to automate the process so that any new camera is detected without any work required from a user? I'll shorten the question. It seems that when I install a driver with inf-wizard.exe, it does something besides installing the driver itself. I need to know what, exactly. Thanks in advance. |
From: Xiaofan C. <xia...@gm...> - 2011-08-11 06:47:11
|
2011/8/11 Alex <Ale...@ya...>: > Greetings. > > I've faced a problem getting my libusb-w32 based program to detect > devices. The program has to detect digital cameras, and I need to > automatically install driver filter for any new camera to be detected > without any manual work. I've used > install-filter i --class={6BDD1FC6-810F-11D0-BEC7-08002BE2092F} , > i. e. installing filter for MTP devices, and it seemed to work. But today I > tried it on a clean machine and found out it actually only seemed that > way. Tried install-filter with different parameters - no luck. The only way > I was able to detect devices at all was to use the inf-wizard.exe. It installed > the driver, enabling my program to detect devices, but also disrupting the > original Windows functionality for digital cameras. Then, I've uninstalled the > libusb driver, installed the original windows driver back, executed > install-filter i --class={6BDD1FC6-810F-11D0-BEC7-08002BE2092F} > - and the program is still able to detect devices. The question is: how to > automate the process so that any new camera is detected without any work > required from a user? Hmm, this is an advance topic which we may not want to support. Firstly, class filter driver usage is discouraged. For filter driver, we want only to support installation of filter driver for specific device, not USB class filter. Secondly, even though we do not support your use cases, I think there is probably a solution for you. Maybe a Windows service can be created to do what you want. But I know very little of Windows service... > I'll shorten the question. It seems that when I install a driver with inf-wizard.exe, > it does something besides installing the driver itself. I need to know what, exactly. inf-wizard will replace the existing driver with libusb-win32 device driver. Therefore the existing function will not work any more. So it is not what you want to use. -- Xiaofan |
From: Alex <Ale...@ya...> - 2011-08-11 06:59:45
|
11.08.2011, 10:47, "Xiaofan Chen" <xia...@gm...>: > Hmm, this is an advance topic which we may not want to support. > > Firstly, class filter driver usage is discouraged. For filter driver, we want > only to support installation of filter driver for specific device, not > USB class filter. > > Secondly, even though we do not support your use cases, I think > there is probably a solution for you. Maybe a Windows service > can be created to do what you want. But I know very little of > Windows service... > > inf-wizard will replace the existing driver with libusb-win32 device driver. > Therefore the existing function will not work any more. So it is not > what you want to use. > > -- > Xiaofan Thank you for your swift response. Service... I also know nothing of Windows services and definitely would'n want to use it. Using device driver is absolutely unacceptable in my case, I really need filter driver. On a clean machine I can't get libusb to detect devices without device driver. But when I install device driver, and then remove it, replace by the original one and install filter driver everything's OK. Why is that so? Even more so - I got the impression that after the installation of a device driver for one device I can use filter upon ANY device and detect it succefully. Have to doublecheck it, though. Is it possible to get the source code of inf-wizard utility? I have the impression it's capable of doing what I need, I just need to make it automatic. Alex |
From: Xiaofan C. <xia...@gm...> - 2011-08-11 07:08:49
|
2011/8/11 Alex <Ale...@ya...>: > Service... I also know nothing of Windows services and > definitely would'n want to use it. > Using device driver is absolutely unacceptable in my case, I > really need filter driver. Yes, you need the filter driver. > On a clean machine I can't get libusb to detect devices without > device driver. But when I install device driver, and then remove it, > replace by the original one and install filter driver everything's OK. > Why is that so? Even more so - I got the impression that after the > installation of a device driver for one device I can use filter upon > ANY device and detect it successfully. Have to doublecheck it, though. Ah, now I understand you better. In order to install the filter driver, you have to have the kernel driver and dll installed first. We provide the installer for you with the name libusb-win32-devel-filter-1.2.5.0.exe http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.5.0/ > Is it possible to get the source code of inf-wizard utility? I have the > impression it's capable of doing what I need, I just need to make it > automatic. The source codes are there. It used libwdi. http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.5.0/ libusb-win32-src-1.2.5.0.zip libwdi wiki is here: http://sourceforge.net/apps/mediawiki/libwdi/index.php?title=Main_Page Your application need to autorun in order to be able to catch the insertion of the device when the user plugs in the MTP device, that is why I suggest a Windows service. But please remember, we would not recommend this use cases. So you are kind of on your own if some MTP device does not like the filter and causes BSOD... -- Xiaofan |
From: Xiaofan C. <xia...@gm...> - 2011-08-11 07:10:54
|
On Thu, Aug 11, 2011 at 3:08 PM, Xiaofan Chen <xia...@gm...> wrote: > 2011/8/11 Alex <Ale...@ya...>: >> Service... I also know nothing of Windows services and >> definitely would'n want to use it. >> Using device driver is absolutely unacceptable in my case, I >> really need filter driver. > > Yes, you need the filter driver. > More info can be found in the libusb-win32 wiki site. http://sourceforge.net/apps/trac/libusb-win32/wiki -- Xiaofan |
From: Xiaofan C. <xia...@gm...> - 2011-08-11 08:02:21
|
On Thu, Aug 11, 2011 at 3:08 PM, Xiaofan Chen <xia...@gm...> wrote: > Your application need to autorun in order to be able to catch > the insertion of the device when the user plugs in the MTP > device, that is why I suggest a Windows service. > I think I may not be correct here. Once you install the MTP class filter driver, it is actually kind of a service and should be able to catch the insertion of a USB MTP device. So I think this should work for you. -- Xiaofan |
From: Xiaofan C. <xia...@gm...> - 2011-08-11 07:21:07
|
On Thu, Aug 11, 2011 at 3:08 PM, Xiaofan Chen <xia...@gm...> wrote: > Your application need to autorun in order to be able to catch > the insertion of the device when the user plugs in the MTP > device, that is why I suggest a Windows service. > > But please remember, we would not recommend this use case. > So you are kind of on your own if some MTP device does not > like the filter and causes BSOD... That being said, we have not received any BSOD report recently. And if you indeed find a problem, we will try to fix it if possible. Still take note the filter driver will not work for some device like those using UMDF (user mode driver framework) since libusb0.sys is a kernel mode filter and a upper filter and it is not possible to have a kernel mode filter on top of a user mode filter like those based on UMDF. Eg: http://sourceforge.net/tracker/?func=detail&aid=2993645&group_id=78138&atid=552262 -- Xiaofan |
From: Xiaofan C. <xia...@gm...> - 2011-08-11 07:22:38
|
On Thu, Aug 11, 2011 at 3:21 PM, Xiaofan Chen <xia...@gm...> wrote: > On Thu, Aug 11, 2011 at 3:08 PM, Xiaofan Chen <xia...@gm...> wrote: >> Your application need to autorun in order to be able to catch >> the insertion of the device when the user plugs in the MTP >> device, that is why I suggest a Windows service. >> >> But please remember, we would not recommend this use case. >> So you are kind of on your own if some MTP device does not >> like the filter and causes BSOD... > > That being said, we have not received any BSOD report recently. > And if you indeed find a problem, we will try to fix it if possible. > > Still take note the filter driver will not work for some device > like those using UMDF (user mode driver framework) since > libusb0.sys is a kernel mode filter and a upper filter and it is not > possible to have a kernel mode filter on top of a user mode filter > like those based on UMDF. > Eg: http://sourceforge.net/tracker/?func=detail&aid=2993645&group_id=78138&atid=552262 Typo. It is not possible to have a kernel mode filter on top of a user mode driver like those based on UMDF. -- Xiaofan |
From: Alex <Ale...@ya...> - 2011-08-11 07:52:05
|
Thank you very much for the support! I don't know how could I miss that libusb-win32-devel-filter-1.2.5.0 tool. I hope it will solve my problems. Can't wait to get to the office and check it on a clean machine. Arguments on using filter driver not being preferable are noted, but still it's the only way, so I'll take the risk. Only one last question (I hope) - may I have a setup script with which libusb-win32-devel-filter-1.2.5.0 installer was created? I would like to recreate it but tune here and there for unattended installation, or even embed it into my program's setup, but I don't know which registry records it creates. Thank's again for your help. Best regards, Alex 11.08.2011, 11:21, "Xiaofan Chen" <xia...@gm...>: > On Thu, Aug 11, 2011 at 3:08 PM, Xiaofan Chen <xia...@gm...> wrote: > >> Your application need to autorun in order to be able to catch >> the insertion of the device when the user plugs in the MTP >> device, that is why I suggest a Windows service. >> >> But please remember, we would not recommend this use case. >> So you are kind of on your own if some MTP device does not >> like the filter and causes BSOD... > > That being said, we have not received any BSOD report recently. > And if you indeed find a problem, we will try to fix it if possible. > > Still take note the filter driver will not work for some device > like those using UMDF (user mode driver framework) since > libusb0.sys is a kernel mode filter and a upper filter and it is not > possible to have a kernel mode filter on top of a user mode filter > like those based on UMDF. > Eg: http://sourceforge.net/tracker/?func=detail&aid=2993645&group_id=78138&atid=552262 > > -- > Xiaofan > |
From: Michael P. <mic...@gm...> - 2011-08-14 16:08:18
|
Alex wrote: >> Arguments on using filter driver not being preferable are noted, >> but still it's the only way, so I'll take the risk. If I've been following these threads correctly, it sounds like it's not that the filter driver is bad, but that the class filter driver is. Do you have a complete list of cameras you are trying to support? Michael |
From: Xiaofan C. <xia...@gm...> - 2011-08-11 07:56:43
|
2011/8/11 Alex <Ale...@ya...>: > > Only one last question (I hope) - may I have a setup script with which > libusb-win32-devel-filter-1.2.5.0 installer was created? I would like to recreate > it but tune here and there for unattended installation, or even embed it into > my program's setup, but I don't know which registry records it creates. It is inside the source package. http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.5.0/ File name: libusb-win32-src-1.2.5.0.zip Online viewing: http://libusb-win32.svn.sourceforge.net/viewvc/libusb-win32/branches/libusb-testing/ddk_make/filter-bin-setup.iss.in?revision=408&view=markup -- Xiaofan |
From: Alex <Ale...@ya...> - 2011-08-11 08:06:41
|
I'm sorry, I didn't see it. I guess it's because I didn't know it has .in extension. Thank you for your time, once again. I hope that would be all :) Best regards, Alex 11.08.2011, 11:56, "Xiaofan Chen" <xia...@gm...>: > 2011/8/11 Alex <Ale...@ya...>: > >> Only one last question (I hope) - may I have a setup script with which >> libusb-win32-devel-filter-1.2.5.0 installer was created? I would like to recreate >> it but tune here and there for unattended installation, or even embed it into >> my program's setup, but I don't know which registry records it creates. > > It is inside the source package. > http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.5.0/ > File name: libusb-win32-src-1.2.5.0.zip > > Online viewing: > http://libusb-win32.svn.sourceforge.net/viewvc/libusb-win32/branches/libusb-testing/ddk_make/filter-bin-setup.iss.in?revision=408&view=markup > > -- > Xiaofan > |