1. DarkMatterCore

    OP DarkMatterCore I like turtles.
    Developer

    Joined:
    May 30, 2009
    Messages:
    1,204
    Country:
    Venezuela
    Link: https://github.com/DarkMatterCore/libusbhsfs. Co-developed with XorTroll and Rhys Koedijk.

    This is a static library for homebrew applications which is aimed at developers that wish to integrate USB Mass Storage (UMS) support into their projects.
    • Provides a very easy to use interface, which lets the application retrieve:
      • A user-mode status event to wait for UMS changes.
      • Total count of mounted devices.
      • List mounted devices.
    • Spans a background thread that's capable of:
      • Listening for UMS status changes (new device, device removed).
      • Starting logical units from each detected UMS device.
      • Automatically mounting any detected filesystems from the logical units in each detected UMS device.
        • Supports MBR/EBR/GPT/SFD partitioning schemes.
        • Supports FAT12, FAT16, FAT32, exFAT, NTFS*, EXT2*, EXT3* and EXT4* volumes.
      • Signaling the user-mode event to let the application know it detected some changes and processed them.
    • Support for variable-sized logical blocks and long (64-bit) logical block addresses.
    • Automatic devoptab device (un)registration, so you can use standard libc I/O calls on mounted filesystems.
    • Relative path support.
    • Dedicated 8 MiB buffer per each UMS device, which helps speed up data transfers.
    • Unlike fsp-usb, the library doesn't depend on using a custom "ams_mitm.kip" with Atmosphère - just link your homebrew application against it and it will work.
    • Licensed under the ISC License, so anyone can freely use it - even as part of private/closed-source projects. We really want developers to adopt this library.
    * Only in GPL builds of the library. ISC licensed builds only offer FAT support.

    I'll just say this once before someone throws the usual question: this doesn't open any possibility whatsoever to launch Switch games from a UMS device, and never will. Something like that demands system-wide UMS support, which this library clearly doesn't provide.

    Please let me know what you think. :)
     
    Last edited by DarkMatterCore, Dec 23, 2020
  2. peteruk

    peteruk GBAtemp Addict
    Member

    Joined:
    Jun 26, 2015
    Messages:
    2,629
    Country:
    United Kingdom
    So glad you took up the mantle and got this sorted for all the homebrew makers to include USB functionality, it's been a long time coming and for this a massive thank you :)

    I really hope that @Joel16 will include this inside his excellent NX-Shell.
     
    lordelan, I pwned U!, ploggy and 4 others like this.
  3. Intronaut

    Intronaut A star maker
    Member

    Joined:
    Nov 18, 2014
    Messages:
    772
    Country:
    Chile
    Amazing news for the scene. You guys have done an amazing work.
     
  4. linuxares

    linuxares I'm not a generous god!
    Moderator

    Joined:
    Aug 5, 2007
    Messages:
    8,226
    Country:
    Sweden
    Dude amazing stuff!
     
    DarkMatterCore likes this.
  5. iriez

    iriez GBAtemp Advanced Fan
    Member

    Joined:
    Oct 27, 2016
    Messages:
    543
    Country:
    United States
    Finally! The other implementation was very quirky. Glad to see some alternative options and hope this is stable :)

    Are there any file transfer limitations? I see it supports EXfat! This is great.
     
    Last edited by iriez, Nov 23, 2020
  6. grcd

    grcd GBAtemp Regular
    Member

    Joined:
    Sep 14, 2009
    Messages:
    137
    Country:
    Thank you, thank you, thank you! A massive step for Switch homebrew!
     
  7. merlin555

    merlin555 Master
    Member

    Joined:
    Oct 27, 2014
    Messages:
    1,419
    Country:
    Germany
    Can someone please compile this for me ?

    Thank you!
     
  8. mathew77

    mathew77 Lovin' life.
    Member

    Joined:
    Jan 19, 2019
    Messages:
    575
    Country:
    Kazakhstan
    Wow! :hrth: I REALLY want all the major nsp installers adopts it in a blink.
     
  9. TotalJustice

    TotalJustice GBAtemp Fan
    Member

    Joined:
    Jan 28, 2017
    Messages:
    373
    Country:
    United Kingdom
    its a *very* simple to use library for developers to use so that they can usb hdd support to their apps. I'm sure you can imagine how many apps could benefit from this ;)
     
  10. linuxares

    linuxares I'm not a generous god!
    Moderator

    Joined:
    Aug 5, 2007
    Messages:
    8,226
    Country:
    Sweden
    NSAInstaller (or Where's my waifu Awoo-Installer) and Tinfoil?
     
  11. TotalJustice

    TotalJustice GBAtemp Fan
    Member

    Joined:
    Jan 28, 2017
    Messages:
    373
    Country:
    United Kingdom
    Yep! Also hoping to see nxdumptool, nxshell, pplay, any save manager (dump saves to usb!) and maybe hbm use this lib
     
  12. linuxares

    linuxares I'm not a generous god!
    Moderator

    Joined:
    Aug 5, 2007
    Messages:
    8,226
    Country:
    Sweden
    Oooh dump to USB would be sweet with all of them. I bet Dark already got it in nxdumptool.
     
    DarkMatterCore and KiiWii like this.
  13. ber71

    ber71 Advanced Member
    Newcomer

    Joined:
    Apr 24, 2019
    Messages:
    93
    Country:
    Spain
    Cant wait for Retroarch
     
    lordelan, Bst22322, Djakku and 4 others like this.
  14. Fgamer

    Fgamer GBAtemp Regular
    Member

    Joined:
    May 26, 2012
    Messages:
    105
    Country:
    Sounds fantastic! Let's hope it's widely adopted.
     
  15. Ghost92

    Ghost92 GBAtemp Advanced Fan
    Member

    Joined:
    Jun 29, 2017
    Messages:
    933
    Country:
    Colombia
    RetroArch likes this.
     
    lordelan likes this.
  16. DarkMatterCore

    OP DarkMatterCore I like turtles.
    Developer

    Joined:
    May 30, 2009
    Messages:
    1,204
    Country:
    Venezuela
    Thank you all for your kind comments and support!

    Please feel free to test it and report any bugs or feature requests. If they can be implemented, I'll gladly add them to our to-do list.

    Only limitations inherent to the underlying filesystem used by the UMS device you're working with. That's why the listed UsbHsFsDevice elements include a fs_type field, to let developers workaround filesystem-specific limitations.

    Other than that, the whole interface is pretty much filesystem-agnostic to the end-user.
     
    I pwned U!, nicoDS, KiiWii and 2 others like this.
  17. Ghost92

    Ghost92 GBAtemp Advanced Fan
    Member

    Joined:
    Jun 29, 2017
    Messages:
    933
    Country:
    Colombia
    How high is the transfer speed of a common HDD? (seagate)
     
  18. DarkMatterCore

    OP DarkMatterCore I like turtles.
    Developer

    Joined:
    May 30, 2009
    Messages:
    1,204
    Country:
    Venezuela
    We performed benchmarks reading the first raw 128 MiB (concurrent reads) from each connected drive with logging enabled back when the Bulk-Only Transport driver was still being developed, and we got speeds between 4 and 6 seconds. We used portable Seagate HDDs and WD HDDs with custom enclosures. So we could be talking anywhere between ~21 and 32 MiB/s - which yes, is better than fsp-usb's performance.

    Disabling debug logging makes transfers go even faster, but we can't properly do benchmarks without it. Even if you're using the example test application, there's a noticeable difference if you link it against the debug build of the library vs the release one.
     
    I pwned U!, peteruk and Ghost92 like this.
  19. Skonikol

    Skonikol GBAtemp Regular
    Member

    Joined:
    May 25, 2017
    Messages:
    115
    Country:
    Russia
    DBI, Daybreak
     
  20. nWo

    nWo The Game Master
    Member

    Joined:
    Oct 20, 2016
    Messages:
    569
    Country:
    Mexico
    Thank you, this is awesome. I just want this implemented so I can play music and movies from a USB on the TV, that would be ill. Then, run some classic games on retroarch, all of that without using up space on the SD card. As a matter of fact I still use from time to time my Wii to do these things, so it will be a great, great addition to be able to do it at last on the Switch.
     
    I pwned U! and DarkMatterCore like this.
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - libusbhsfs, Filesystem, Storage