Code Monkey home page Code Monkey logo

Comments (9)

Kanuan avatar Kanuan commented on September 28, 2024

I'm pretty sure I wasn't running on this problem before updating the BthPS3 version (currently I'm using version 2.8.320.0). Will test if it's actually a BthPS3 issue somehow

Yeah, no, the same issue happens under BthPS3 v2.6.127.0. I think I just didn't notice this issue before because I was using global settings the majority of time

from dshidmini.

nefarius avatar nefarius commented on September 28, 2024

Not sure I ever tested it wireless since it was introduced, so can totally be the case it's overlooked, will check it out.

from dshidmini.

Kanuan avatar Kanuan commented on September 28, 2024

In configuration.c, the ConfigLoadForDevice method gets the string that represents the device MAC address from the Context->DeviceAddressString field. The issue is that this field is not set when the device is connected via BT.

I've added a tracing message for it to show this field value if it fails to load the settings and it returns blank when via BT:

image

image

From what I've looked around, The device's DeviceAddressString field is only set in the DsUdb_PrepareHardware method of the DsUsb.c file, but this method is only called if the device is connected via USB, therefore the DeviceAddressString field is never set via BT:

image

image

I tried to set DeviceAddressString in the DsDevice_ReadProperties method of the device.c file immediately after it sets the DeviceAddress field. This works in the sense that the field is correctly set, but for some reason putting this piece of code here causes the driver to get stuck immediately after it:

image

image

from dshidmini.

Kanuan avatar Kanuan commented on September 28, 2024

From the traceview log, the driver hangs if DeviceAddressString is set before invoking the DsDevice_RegisterBthDisconnectListener method.

Setting the DeviceAddressString field AFTER both listerner-related methods are invoked fix the hanging and the code works as expected, allowing the driver to properly load device-specific configurations.

image

I'm really curious to why the driver hangs if the DeviceAddressString field is set before the listener-related methods are invoked, nothing in them seems to make use of it, but regardless, this got the "works on my machine" seal of approval. Will prepare a PR for the fix.

from dshidmini.

nefarius avatar nefarius commented on September 28, 2024

If the tracing just stops and the driver responding, it means it crashed. Look in the event viewer for Critical or Error events from the user-mode driver reflector service, I bet you find one or more crash logs.

from dshidmini.

nefarius avatar nefarius commented on September 28, 2024

Should look similar to #333

from dshidmini.

Kanuan avatar Kanuan commented on September 28, 2024

image

from dshidmini.

nefarius avatar nefarius commented on September 28, 2024

Yeah that's what I thought, we're probably reading or writing invalid/uninitialized memory somewhere during this exact sequence or in parallel and it goes poof. WinDbg session or code review could uncover why exactly.

from dshidmini.

nefarius avatar nefarius commented on September 28, 2024

Once you make a PR and I see the diff, maybe something obvious jumps out.

from dshidmini.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.