Coder Social home page Coder Social logo

USB bind error about libnx HOT 25 CLOSED

switchbrew avatar switchbrew commented on May 12, 2024
USB bind error

from libnx.

Comments (25)

Gillou68310 avatar Gillou68310 commented on May 12, 2024 1

Same issue here, usbds initialization fails at _usbDsBindDevice while testing usbds example.
I first thought this could be caused by usb sysmodule modifications on newer sysver (I'm on 5.0.2), but since it also happens to @RKX1209 on 3.0.0 there' s probably something else going on here!

from libnx.

yellows8 avatar yellows8 commented on May 12, 2024

So you try to run the original nxdbg sysmodule and it throws a fatal-error?(Completely unrelated to client when it's during init)

What sysver?

from libnx.

RKX1209 avatar RKX1209 commented on May 12, 2024

Yes.
My client-side env.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.10
Release:        17.10
Codename:       artful

And stub app runs on Nintendo switch 3.0.0.

I also tried to run the original nxdbg client but, it cause some errors.
Here is the log.

$ sudo python MainWindow.py --pid 100
Traceback (most recent call last):                                              
  File "MainWindow.py", line 198, in <module>                                   
    sys.exit(main(sys.argv))                                                    
  File "MainWindow.py", line 161, in main                                       
    usb = UsbConnection()                                                       
  File "nxdbg/debugger/UsbConnection.py", line 180, in
 __init__                                                                       
    self.dev.set_configuration()                                                
  File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 869, in set_co
nfiguration                                                                     
    self._ctx.managed_set_configuration(self, configuration)                    
  File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 102, in wrappe
r                                                                               
    return f(self, *args, **kwargs)                                             
  File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 148, in managed_set_configuration 
    self.backend.set_configuration(self.handle, cfg.bConfigurationValue)          File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 79$, in set_configuration                  
    _check(self.lib.libusb_set_configuration(dev_handle.handle, config_value))    File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 59$, in _check         
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])                     
usb.core.USBError: [Errno None] Other error

And original stub app failed too, which is same situation as my case.
(Same error code 0xf601 at the point)

I'd like to confirm, does usb communication capability requires kernelhax?
If so, my switch has no kernel access yet, and it can cause this problem.

But I guess it can be possible to use usb:ds service from hb apps without kernel privilege.

from libnx.

yellows8 avatar yellows8 commented on May 12, 2024

Client should be irrelevant - 0xF601 happens without any client running right?

from libnx.

RKX1209 avatar RKX1209 commented on May 12, 2024

Yes. It happens regardless of client status, running or not.
So it can be stub side problem.

from libnx.

yellows8 avatar yellows8 commented on May 12, 2024

usbds doesn't need kernelhax. How are you running HBL?

from libnx.

RKX1209 avatar RKX1209 commented on May 12, 2024

Along with this instruction
So backend may be pegaswitch.(not fusee launcher)

from libnx.

RKX1209 avatar RKX1209 commented on May 12, 2024

Hi. Any progress?

from libnx.

yellows8 avatar yellows8 commented on May 12, 2024

Dunno what's wrong.

from libnx.

sphaerophoria avatar sphaerophoria commented on May 12, 2024

My switch also crashes using the usbds example inside the usbDsInitialize call somewhere. Launching on firmware 5.1.0 through SXOS 1.2 (error code 2001-0123 which should be the same as noted 0xf601 in parent)

from libnx.

sphaerophoria avatar sphaerophoria commented on May 12, 2024

I dug into my error a little further yesterday. It looks like it's actually coming from _usbDsSetVidPidBcd. I can dodge this call with a NULL deviceinfo passed into the function, but I then get it a little further up on _usbDsGetSession.

I tried ignoring all 0xf601's due to the comment in http://switchbrew.org/index.php?title=SVC#svcReplyAndReceive . Although it's not usb related I thought they may mean that another session has closed. I think it's unlikely this is the case.

I also started digging around the ptm service. Thought process was that maybe someone is holding the usb port in a certain mode for charging so we can't change it. On second thought it's probably more likely to be the HID module since I'm seeing it show up on my linux box as an hid device

└> dmesg | grep hid
[33734.203715] hid-generic 0003:057E:2000.003B: hiddev0,hidraw0: USB HID v1.11 Device [Nintendo Nintendo Switch] on usb-0000:00:1d.0-1.2/input0

from libnx.

CordY5 avatar CordY5 commented on May 12, 2024

Any plans to fix this issue ?
Need this error to be fixed if I want to finish my app.

from libnx.

misson20000 avatar misson20000 commented on May 12, 2024

On my 3.0.0 console, USB initialization blocks somewhere pretty early until you unplug the USB cable and plug it back in again. Try that?

from libnx.

CordY5 avatar CordY5 commented on May 12, 2024

@misson2000 doesn't work

from libnx.

JustForNothing avatar JustForNothing commented on May 12, 2024

It seems the USB sysmodule is completely different in 5.X
But for the debugger I found a workaround: just use TCP instead.

from libnx.

yellows8 avatar yellows8 commented on May 12, 2024

On <5.0 with the usbds example, does it happen with both the original example and with the second param here changed to NULL? https://github.com/switchbrew/switch-examples/blob/master/usb/usbds/source/main.c#L129

from libnx.

Monotek18 avatar Monotek18 commented on May 12, 2024

@yellows8 on 3.0.0, it doesn't happen with the original example + with the second param here changed to NULL. But when you change the second param to NULL, I get 2140-0305 whenever you unplug the USB while running the homebrew.

from libnx.

yellows8 avatar yellows8 commented on May 12, 2024

@Monotek18 Were you reading from the serial device host-side?

EDIT: Sounds like usbds is fine as long as deviceinfo is set.

from libnx.

yellows8 avatar yellows8 commented on May 12, 2024

Can someone on 5.x also try this? #109 (comment)

from libnx.

Monotek18 avatar Monotek18 commented on May 12, 2024

@yellows8 On my 5.1.0, I still have 2001-0123 even with the 2nd param changed to NULL & with the original example.

from libnx.

WinterMute avatar WinterMute commented on May 12, 2024

On 5.1.0 I get the same 2001-0123 error.

On 3.0.0 the nxdbg stub app inits fine and the usbds example works fine. With the 2nd parameter set to NULL the Switch reads VID/PID as 057e/3000

from libnx.

yellows8 avatar yellows8 commented on May 12, 2024

@RKX1209 Since it works fine for everyone else on pre-5.0.0, can you try again with RCM + latest libnx/nx-hbloader?

(5.0.0+ support can't be fixed until the new commands are documented)

from libnx.

RKX1209 avatar RKX1209 commented on May 12, 2024

On my 5.1.0, same error 2001-0123 happen even if with latest hbloader, fusee launcher;)

from libnx.

SciresM avatar SciresM commented on May 12, 2024

Should be closed by PR #181

from libnx.

RKX1209 avatar RKX1209 commented on May 12, 2024

Thank you all you guys!

from libnx.

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.