Homebrew WIP libusbhsfs - USB Mass Storage Class Host + Filesystem Mounter static library.

duckbill007

Well-Known Member
Member
Joined
May 5, 2011
Messages
676
Trophies
1
XP
2,432
Country
Russia
Just a question - why to patch usb module directly, if boot2 loads and hooks settings before usb. Why not patch there setting, not the module itself?
 

DarkMatterCore

Finding my light.
OP
Developer
Joined
May 30, 2009
Messages
1,292
Trophies
1
Age
28
Location
Madrid, Spain
Website
github.com
XP
2,602
Country
Spain
Just a question - why to patch usb module directly, if boot2 loads and hooks settings before usb. Why not patch there setting, not the module itself?
Not really, nope. The boot2 reimplementation from Atmosphère is launched after both USB and FS - all it does is call LaunchPostSdCardBootPrograms() and return right away.

LaunchPostSdCardBootPrograms() then proceeds to launch the rest of the sysmodules, using the AdditionalLaunchPrograms array. At that point, it's already too late to enable USB 3.0 support using the settings flag - I did try hardcoding the flag into ams_mitm, but it didn't work.
 

DarkMatterCore

Finding my light.
OP
Developer
Joined
May 30, 2009
Messages
1,292
Trophies
1
Age
28
Location
Madrid, Spain
Website
github.com
XP
2,602
Country
Spain

SciresM

Developer
Developer
Joined
Mar 21, 2014
Messages
972
Trophies
3
Age
33
XP
8,253
Country
United States
Meh, I should just integrate usb 3.0 enable shit into ams. I'll do that today.

Merged usb 3.0 enable stuff into ams-master, from next release onwards usb!usb30_force_enabled in system_settings.ini will work as expected when booting via fusee.

Hekate will need to get support for this to work when booting via hekate, I'll contact CTCaer about it.
 

DarkMatterCore

Finding my light.
OP
Developer
Joined
May 30, 2009
Messages
1,292
Trophies
1
Age
28
Location
Madrid, Spain
Website
github.com
XP
2,602
Country
Spain
Merged usb 3.0 enable stuff into ams-master, from next release onwards usb!usb30_force_enabled in system_settings.ini will work as expected when booting via fusee.

Hekate will need to get support for this to work when booting via hekate, I'll contact CTCaer about it.
Thank you for going out of your way and making it easier for anyone to enable this flag. I truly appreciate it.

I also saw you added a new config item to Exosphère - a very nice addition, indeed.
 

duckbill007

Well-Known Member
Member
Joined
May 5, 2011
Messages
676
Trophies
1
XP
2,432
Country
Russia
I see

--------------------- MERGED ---------------------------

How can I check that setting applied at correct time?

Atmosphere with latest commit, usb30_force_enabled in config, loaded through fusee, but USBView still shows:
Is Port User Connectable: yes
Is Port Debug Capable: no
Companion Port Number: 1
Companion Hub Symbolic Link Name: USB#ROOT_HUB30#5&4087d53&0&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
Protocols Supported:
USB 1.1: yes
USB 2.0: yes
USB 3.0: no
 

DarkMatterCore

Finding my light.
OP
Developer
Joined
May 30, 2009
Messages
1,292
Trophies
1
Age
28
Location
Madrid, Spain
Website
github.com
XP
2,602
Country
Spain
I see

--------------------- MERGED ---------------------------

How can I check that setting applied at correct time?

Atmosphere with latest commit, usb30_force_enabled in config, loaded through fusee, but USBView still shows:
Is Port User Connectable: yes
Is Port Debug Capable: no
Companion Port Number: 1
Companion Hub Symbolic Link Name: USB#ROOT_HUB30#5&4087d53&0&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
Protocols Supported:
USB 1.1: yes
USB 2.0: yes
USB 3.0: no
Are you properly setting USB3 device, configuration, interface and endpoint descriptors? Are you sure you're using a USB3-capable USB-C cable?
 

duckbill007

Well-Known Member
Member
Joined
May 5, 2011
Messages
676
Trophies
1
XP
2,432
Country
Russia
setting device through latest libnx usb_comms.
the same cable and port shows usb3: yes for external drive.

--------------------- MERGED ---------------------------

Also, AFAIK system first selects highest available speed reported by device and only after that asks for descriptors.

--------------------- MERGED ---------------------------

Test also simpliest:
Code:
int main(int argc, char **argv)
{
    consoleInit(NULL);

    usbCommsInitialize();

    // Main loop
    while(appletMainLoop())
    {
        //Scan all the inputs. This should be done once for each frame
        hidScanInput();

        //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
        u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);

        if (kDown & KEY_PLUS) break; // break in order to return to hbmenu

        consoleUpdate(NULL);
    }

    consoleExit(NULL);
    return 0;
}
 

DarkMatterCore

Finding my light.
OP
Developer
Joined
May 30, 2009
Messages
1,292
Trophies
1
Age
28
Location
Madrid, Spain
Website
github.com
XP
2,602
Country
Spain
Try manually setting up USB3 descriptors. Personally, I'm not too fond of using usbComms - I prefer to manually deal with the descriptors myself.

--------------------- MERGED ---------------------------

By the way, you can check if the USB3 flag is enabled by checking the new SMC config item via splGetConfigItem().
 

blawar

Developer
Developer
Joined
Nov 21, 2016
Messages
1,708
Trophies
1
Age
40
XP
4,311
Country
United States
setting device through latest libnx usb_comms.
the same cable and port shows usb3: yes for external drive.

--------------------- MERGED ---------------------------

Also, AFAIK system first selects highest available speed reported by device and only after that asks for descriptors.

--------------------- MERGED ---------------------------

Test also simpliest:
Code:
int main(int argc, char **argv)
{
    consoleInit(NULL);

    usbCommsInitialize();

    // Main loop
    while(appletMainLoop())
    {
        //Scan all the inputs. This should be done once for each frame
        hidScanInput();

        //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
        u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);

        if (kDown & KEY_PLUS) break; // break in order to return to hbmenu

        consoleUpdate(NULL);
    }

    consoleExit(NULL);
    return 0;
}

You should not use libnx usbcomms, for multiple reasons. I see it as really just proof of concept code.
 

duckbill007

Well-Known Member
Member
Joined
May 5, 2011
Messages
676
Trophies
1
XP
2,432
Country
Russia
You can access it at any moment from HOS via spl.
I mean, then this flag reflect this value read while boot2 process, not later by set.mitm.

You should not use libnx usbcomms, for multiple reasons. I see it as really just proof of concept code.
I know that. I think it enough just to test USB3 capabilities.

--------------------- MERGED ---------------------------

@DarkMatterCore do you have example of correct USB3 Device descriptor?
 

SciresM

Developer
Developer
Joined
Mar 21, 2014
Messages
972
Trophies
3
Age
33
XP
8,253
Country
United States
You should not use libnx usbcomms, for multiple reasons. I see it as really just proof of concept code.

as the author of the libnx usbcomms code, pretty much this. I don't recommend using it.

USB 3.0 definitely works fine with usb:ds, when testing with the work-in-progress ams.tma code:

upload_2021-3-3_6-16-40.png


and the flag retrieved via spl will tell you if support is enabled, I don't know why you're confused about when it's set/etc. It's set by fusee, and never changeable without editing system_settings.ini and rebooting.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • A @ anotherthing:
    Online was free on the 3DS as well, and it worked well.
    +1
  • S @ salazarcosplay:
    I can't help but think nintendo switch online is the reason we did not get a gameboy/n64/gamecube
    mini classic edition
    +1
  • Xdqwerty @ Xdqwerty:
    @salazarcosplay, i think it would have been impossible to see anything in a gameboy mini
  • S @ salazarcosplay:
    well I meant that as a figure of speech
  • S @ salazarcosplay:
    they could just rerelease a modern gameboy
  • S @ salazarcosplay:
    like the pocket analogue
  • S @ salazarcosplay:
    but nintendo licensed
  • LeoTCK @ LeoTCK:
    dammit that thread got moved from offtopic to edge, well since that happened
  • Xdqwerty @ Xdqwerty:
    @LeoTCK, atleast it's still avaliable
  • LeoTCK @ LeoTCK:
    yes but it wasn't meant to be a comedy thread
  • LeoTCK @ LeoTCK:
    and edge of the forum is mostly comedy and games
  • LeoTCK @ LeoTCK:
    so I don't get why it got moved at all
  • Xdqwerty @ Xdqwerty:
    @LeoTCK, mods are probably hating you
  • LeoTCK @ LeoTCK:
    on most sites mods hated me, sooner or later, but usually over time I get either banned or the mods get used to me
  • LeoTCK @ LeoTCK:
    sometimes to the point of thanking me for my quick actions etc against spam and other stuff, but yea...its either they come to respect me or outright hate me
    +1
  • BigOnYa @ BigOnYa:
    If it's not game related, it will be moved to the Egde of the forum. Mods have moved a few of my threads also.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, it was in the off topic chat forum
  • BigOnYa @ BigOnYa:
    Well atleast they didn't delete it completely.
  • LeoTCK @ LeoTCK:
    hmm
  • Xdqwerty @ Xdqwerty:
    uoiea
  • LeoTCK @ LeoTCK:
    huh?
  • Xdqwerty @ Xdqwerty:
    Aeiou backwards
    Xdqwerty @ Xdqwerty: Aeiou backwards