Jump to content

usb module stange behavior after disconnecting usb


Guest jeremy

Recommended Posts

Guest jeremy

Hi all

I just built the usb module, which works (quite) fine.

my os is xp home, sp1

here is the strange behaviour

1) I connect the usb cable, about 3 sec later I ear the "ding" from xp, signaling the usb device is connected : ok

2) I open any midi application (tested midiox, reason), then select usb audio device corresponding to the usb module then send & receive usb midi data with no problem : ok

3) I close midiox or reason, then disconnect usb cable, I ear the "ding" from xp signaling a usb device has been disconnected : ok

4) I re connect the usb cable : then the usb module is not found : NO "ding" from xp

I noticed I have to wait about 5 minutes before re-earing the expected "ding" and then the usb devices are found again.

If I do 1), wait for the "ding",  then I open midiox WITHOUT selecting  the usb audio device, then close midiox, then diconnect the usb cable then reconnect, everything is ok.

To summarize :

Once I select a midi device corresponding to the usb module from a midi application (midiox, reason), it works fine until I disconnect/reconnect my usb cable. (even if the midi application was closed before disconnecting the usb cable)

afterwhat my usb module is not recongnized anymore until I ear the "ding" from xp, after few minutes !

It seems the midi application cannot properly close the usb selected device ! then this device is no more recognized by window for few minutes !

Anyone has noticed this behaviour ? any workaround ?

thanks to all

best

J

Link to comment
Share on other sites

I also noticed some strange behaviour with my four USB Midi devices on XP some time ago.

I think it's a microsoft problem in combination with several chipsets. If you disconnect a USB-Audiodevice which was proberly mounted before in any applikation you won't get this device to work again in the same session. Normally you have to do a reboot so that xp can re-adress the device in the registry.

In my case I did an update on the system-board device drivers (Intel Chipset) which solved the problem.

I read somewhere that there are several chipsets which have problems with USB devices. For example VIA.

Which chipset has your computer ?  

Do you plug the device directly in the USB plug or do you have any USB hub between it ?

Doc

Link to comment
Share on other sites

Guest jeremy

hi doc

my motherboard is a a7n8x-e deluxe from nvidia, I use the onboard usb ports. I dont use any usb hub.

I performed some tests on a laptop with xp pro, same strange behaviour : once the device is unplugged, it is not recognized (ok after about 5min !) when replugged.

I noticed another strange thing in the usb source code, it seems the usb midi descriptors are not exactly matching the usb midi spec, the spec mentions the standard audiocontol interface descriptors must be present even for a midi only device (midi10.pdf, p38, B.3), I cannot find these descriptors in the source code, maybe it is normal ?

thank

j

Link to comment
Share on other sites

Guest jeremy

ok I read in different forums people have the same problem with other usb midi devices.

The problem seems to come from the generic usbaudio.sys

anybody experienced this issue with xp ?

any workaround ?

what about the other os ?

J

Link to comment
Share on other sites

Hi Jeremy,

I wrote at the MBHP_USB page:

I noticed some anomalies where the Microsoft driver doesn't comply to the specification or just crashes either the firmware or the complete OS (e.g., if the example descriptors from the Spec are used 1:1, WinME crashes immediately ;-). In the meantime I was able to find workarounds so that the current implementation runs without crashes.

The driver works fine under WinXP in the meantime, so it must be an issue with your USB host.

Best Regards, Thorsten.

Link to comment
Share on other sites

Guest jeremy

Hi Thorsten

could you let me know what kind of workarounds have been used for the driver working properly ?

(this missing audiocontrol descriptor for instance ?)

maybe my xp is more sensitive than the others ;-)

is it working fine even on xp home edition ?

thank you

Jeremy

Link to comment
Share on other sites

Hi Jeremy,

WinME crashed with the AC interface descriptor, thats the reason why I had to remove it. Also the order of the descriptors which are still there is very important, overwise the OS could also crash. After these changes the USB interface was finally regognized by Linux/Mac OSX/WinME/WinXP (yes, home edition, SP1), thats the reason why I think that the problem should be somewhere else.

If you don't believe it, just try to change the source code and please report any observations. I don't have the time to debug this release for everbodies obscure installation, I can only estimate where a problem could be located. And from my experiences the errors are always somewhere deep in the undocumented windows APIs or hardware drivers :-(

Best Regards, Thorsten.

Link to comment
Share on other sites

Guest jeremy

I added the AC descriptor to the usb code, it changed nothing about the xp behaviour.

I dont have Win Me there to test with/without the AC desciptor, I believe you that it craches win Me.  

In the meantime I searched for a win side explanation about this strange behaviour, I found :

http://www.freelists.org/archives/wdmaudiodev/04-2004/msg00000.html

http://www.freelists.org/archives/wdmaudiodev/12-2003/msg00015.html

Assuming it is a host problem, dont you have this strange behaviour on xp ?

thank you

Jeremy

Link to comment
Share on other sites

Guest jeremy

well ...

Thorsten, just to understand ... what are the vid/pid used in the descriptors ?

where do they come from (0x89ac , 0x8ef1) ?

Also I noticed in the src that the v1.2 contains serial port and buffer initializations in the td_resume() function, as opposed to the version 1.

it seems it is necessary to reinit serial & buffers once the device resumes ? Is that the purpose ?

thanks

j

Link to comment
Share on other sites

Thorsten, just to understand ... what are the vid/pid used in the descriptors ?

where do they come from (0x89ac , 0x8ef1) ?

these are dummy IDs. I don't have the money to pay for my own vendor ID, and I haven't found any documentation about IDs which are free for non-profit projects or education... or do you know any?

Also I noticed in the src that the v1.2 contains serial port and buffer initializations in the td_resume() function, as opposed to the version 1.

it seems it is necessary to reinit serial & buffers once the device resumes ? Is that the purpose ?

Yes, it was necessary for the case that the MBHP_USB is connected to a mainboard which doesn't switch off the USB power supply after the system has been shut down or suspended. If the interface received some MIDI events during this time, there is a potential risk for a buffer overrun which could lead to invalid MIDI events once the system is available again.

Best Regards, Thorsten.

Link to comment
Share on other sites

Guest jeremy

Doc

could you be more explicit on the way you updated your host drivers in order the system works fine ?

which drivers did you update, how ?

thank you

Link to comment
Share on other sites

Hi,

just to get you right ...

I didn't update anything on the MBHP USB Module.

I did only updates on the pc side.

Latest Bios and the latest drivers for the chipset.

The board is a MSI 865PE Neo2-P with an Intel 865PE chipset. XP prof. with Service Pack 1a.

I'm not quite sure if these updates alone stoped the error. I also did a new complete installation. The important thing on the new installation was, that I installed XP as a "Standard PC" without those ACPI things (you can do this change only during the setup process of XP, thats why I had to install new).

Doing this, you can control the IRQs in a better way.

I looked carefulyl that the IRQs for the USB host controller are unique (not shared by other components).

The fact is: I don't don't know which of my steps killed the problem exactly. After I had this new system everything worked fine.

I know that this not an easy step to take. But in my case I solved this problem and several others (Audio latency, etc...). But there's no guarantee at all !

Doc

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...