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

duckbill007

Well-Known Member
Member
Joined
May 5, 2011
Messages
559
Trophies
1
XP
1,997
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

I like turtles.
OP
Developer
Joined
May 30, 2009
Messages
1,289
Trophies
1
Age
27
Location
Madrid, Spain
Website
github.com
XP
2,527
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

I like turtles.
OP
Developer
Joined
May 30, 2009
Messages
1,289
Trophies
1
Age
27
Location
Madrid, Spain
Website
github.com
XP
2,527
Country
Spain

SciresM

Developer
Developer
Joined
Mar 21, 2014
Messages
965
Trophies
2
Age
32
XP
8,045
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

I like turtles.
OP
Developer
Joined
May 30, 2009
Messages
1,289
Trophies
1
Age
27
Location
Madrid, Spain
Website
github.com
XP
2,527
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
559
Trophies
1
XP
1,997
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

I like turtles.
OP
Developer
Joined
May 30, 2009
Messages
1,289
Trophies
1
Age
27
Location
Madrid, Spain
Website
github.com
XP
2,527
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
559
Trophies
1
XP
1,997
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

I like turtles.
OP
Developer
Joined
May 30, 2009
Messages
1,289
Trophies
1
Age
27
Location
Madrid, Spain
Website
github.com
XP
2,527
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,709
Trophies
1
Age
39
XP
4,295
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
559
Trophies
1
XP
1,997
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
965
Trophies
2
Age
32
XP
8,045
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.
 
General chit-chat
Help Users
  • Skelletonike @ Skelletonike:
    link doesn't work
    +2
  • Skelletonike @ Skelletonike:
    1H left, such a slow week.
  • Sonic Angel Knight @ Sonic Angel Knight:
    Okay, I had spaghetti :P
  • SylverReZ @ SylverReZ:
    Hope they made lots of spaget
  • K3N1 @ K3N1:
    Chill dog
  • SylverReZ @ SylverReZ:
    Chilli dog
  • Skelletonike @ Skelletonike:
    Damn, I'm loving the new zelda.
  • xtremegamer @ xtremegamer:
    loving the new zelda, i started a game, it was so fucking good, so i
    am waiting on my friend to get home so we can start a new one together
  • Skelletonike @ Skelletonike:
    I just dislike that they don't let me choose the voices before the game starts. Happened with botw as well, had to change to japanese and restart.
  • K3N1 @ K3N1:
    But the important question is can you choose gender
  • Skelletonike @ Skelletonike:
    Same way you can choose Gerald's gender.
  • Skelletonike @ Skelletonike:
    *Geralt, damn autocorrect.
  • Psionic Roshambo @ Psionic Roshambo:
    But can he be trans? Lol
  • K3N1 @ K3N1:
    Zelda transforms into link
  • Psionic Roshambo @ Psionic Roshambo:
    Link I'm not the princess your looking for.... *Pulls a crying game*
  • K3N1 @ K3N1:
    *skirt up* it's exactly what I always wanted
  • Skelletonike @ Skelletonike:
    Just scanned all my zelda amiibos, took a while but didn't get anything that cool, did get the lon lon ranch hylian fabrics though.
  • Skelletonike @ Skelletonike:
    It was pretty funny when I scanned wolf link and got a shit load of meat.
  • K3N1 @ K3N1:
    @Skelletonike, btw I ran that custom for mgs4 on the deck I'm amazed it got that far in game
  • K3N1 @ K3N1:
    Plug in*
  • K3N1 @ K3N1:
    Your favorite activity
    K3N1 @ K3N1: Your favorite activity