freezy / dmd-extensions

A toolbox for virtual pinball dot matrix displays.
GNU General Public License v2.0
129 stars 55 forks source link

dmdexe quit working after installing drivers for Zebsboards controller. #90

Closed meek424424 closed 4 years ago

meek424424 commented 6 years ago

I am running V1.6.0. It worked perfectly. Was using it for Pinball FX2, Pinball FX3, and TPA. I decided to upgrade my controller board with a Zebsboard.

I installed the Zebsboards controller along with the drivers. This caused an issue with dmdext. It no longer works. When I run "dmdext test" I don't see any errors but I don't get anything on the DMD either. I have a PinDMD2. Is there some sort of diagnostic I can run to help out? Just curious if anyone else had this issue. I uninstalled the Zebsboards drivers and dmdext started working again. Once I installed the drivers again it went dark again. Any ideas or guidance would be great. Thanks.

xantari commented 6 years ago

Meek,

From what I understand is that PinDMD2 uses a COM port. I don't have a PinDMD2 (use an LCD screen instead), and when you install the Zebsboards drivers that also registers another COM port. I suspect that you are either running into a COM port conflict, or when DMDExt is enumerating the COM ports it is picking the wrong one (Zebsboard one instead of the PinDMD2 one).

You should see which COM port each device is using, then enable logging which is detailed on the github page. https://github.com/freezy/dmd-extensions the instructions are under the "Reporting Bugs" section.

Additionally you may just need to define the port for DMDExt to work on using the -p command (also documented at the above URL). You can also define the port in DmdDevice.ini.

The documentation seems to indicate that the port setting is only available for PinDMD3 devices, but I would try it with PinDMD2 to see if that fixes it.

freezy commented 6 years ago

Well, while I think that PinDMD2 uses a serial port internally, it's driven by a USB host on the board. dmdext loops through all USB ports it can find and tries to recognize PinDMD2.

Can you paste a log? Maybe switching USB ports will solve the problem?

xantari commented 6 years ago

I just looked at the source code. It seems PinDMD2 is a USB device. It looks for the device by looking for a VendorID descriptor of 0x0314 and a device product ID of 0xe457. Wonder if it uses the same vendor id because it uses the same USB to Serial Port chipset?

freezy commented 6 years ago

Yes that would be source of conflict too. Check here how to find out the IDs of your USB devices.

xantari commented 6 years ago

@freezy Shouldn't this code here:

foreach (UsbRegistry usbRegistry in allDevices) {
   UsbDevice device;
   if (usbRegistry.Open(out device)) {
   if (device?.Info?.Descriptor?.VendorID == 0x0314 
      && (device.Info.Descriptor.ProductID & 0xFFFF) == 0xe457) 
      {
    _pinDmd2Device = device;
    break;
      }
   }
}

Be written as shown below to completely avoid hitting issues with potential Vendor ID / Product ID conflicts? I know a lot of products use the same USB to Serial chipsets so it might be a safer way to do this as it breaks out of the loop on the first one found and then looks at the product string, when it should look at the product string while its looping through USB devices because it might be hitting the first one found (in this case the zebsboard USB device with the same USB to Serial Chipset) and breaking out right away:

foreach (UsbRegistry usbRegistry in allDevices) {
   UsbDevice device;
   if (usbRegistry.Open(out device)) {
   if (device?.Info?.Descriptor?.VendorID == 0x0314 
      && (device.Info.Descriptor.ProductID & 0xFFFF) == 0xe457
      && device.Info.ProductString.Contains("pinDMD V2")) 
      {
    _pinDmd2Device = device;
    break;
      }
   }
}
meek424424 commented 6 years ago

I forced it to use a different COM port using the "-p" and it works like a champ now. I believe it was a COM port conflict like was mentioned earlier. Thank you soooooo much guys! You all are awesome!!! I figured it was something like this and not the software. :)

freezy commented 6 years ago

It's weird because the -p option is ignored for PinDMD2. Are you sure you don't have a PinDMD3?

@xantari Good idea, I've updated the code. Here's a build with the changes.

dmdext-issue90.zip

@meek424424 could you test this one without the -p option?

xantari commented 6 years ago

@meek424424 Did the update fix the issue?

meek424424 commented 6 years ago

Sorry guys! I haven’t been checking my email. Not on the ball. I will try the new update and let you know if it fixes it. I am pretty darn sure I have a PinDMDv2. I mean that is what I bought and I use all the PinDMDv2 files for Visual Pinball. I am sure it wouldn’t work until II used the -p to force COM port 2 to be used. Thanks for your efforts and sorry for the delay getting back.

freezy commented 6 years ago

PinDMDv2 files for Visual Pinball? What are those?

It's quickly determined anyway, if it's colored then it's a PinDMD3, if it's orange only then it's a PinDMD2.

meek424424 commented 6 years ago

I should have said that I used the PinDMD2 option when running the “all in one” installer for visual pinball. Yes it is orange and it is a PinDMD2. Sorry if I was causing confusion. I appreciate how you guys tackle these issues and sorry I wasn’t very responsive. You guys are awesome!!! ;) I will let you know as soon as I can if the update fixed the issue.

freezy commented 6 years ago

Okay, that would be the DMD driver for VPM.

Let me know if the new build works without passing the -p option, that would be interesting to know. I've already merged the changes into the master branch, so it would be also good to know if it works in general, because I don't have a PinDMD2 to test.

meek424424 commented 6 years ago

This is what I used in my AutoHotkey script to make it work and choose COM2 Run *RunAs %comspec% /c "C:\dmdext\dmdext mirror --source=pinballfx3 --no-virtual --port=COM2 -q"

That clears up the confusion about PinDMD2 ignoring the -p. I guess I coudln't get it to work with the -p so I went with the --port command. I guess I am getting old and can't keep this stuff straight. ;)

Just for grins I removed --port=COM2 (example below). Fired up Pinball FX3 and sure enough, the DMD would not work. Run *RunAs %comspec% /c "C:\dmdext\dmdext mirror --source=pinballfx3 --no-virtual -q"

I left the script the way it was, without the --port=COM2. I unzipped the "dmdext-issue90" info my dmdext folder. I tried Pinball FX3 again and the DMD did not work. It was still trying to grab COM3 which is the same COM port that my Zebs Controller is using. When I added the --port=COM2 back into my script and ran Pinball FX3, the DMD worked just fine. I would say that the "Issue90" build did not fix the conflict.

I hope this helps. Thanks

freezy commented 4 years ago

When I added the --port=COM2 back into my script and ran Pinball FX3, the DMD worked just fine.

@meek424424 So this is solved? Can I close?