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

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,606
Country
Spain
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,

iriez

Well-Known Member
Member
Joined
Oct 27, 2016
Messages
549
Trophies
0
Age
49
Website
www.xbins.org
XP
1,867
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,

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,606
Country
Spain
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.

Aree there any file transfer limitations? I see it supports EXfat! This is great.

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.
 

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,606
Country
Spain
How high is the transfer speed of a common HDD? (seagate)

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.
 

nWo

The Game Master
Member
Joined
Oct 20, 2016
Messages
1,004
Trophies
0
Website
www.facebook.com
XP
2,913
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.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Psionic Roshambo @ Psionic Roshambo:
    I will admit that one does seem more interesting than the usual Ambernic ones, and I already liked those.
  • Veho @ Veho:
    I dread the price point.
    +1
  • Veho @ Veho:
    This looks like one of their premium models, so... $150 :glare:
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    To me that seems reasonable.
  • Psionic Roshambo @ Psionic Roshambo:
    I mean since basically all the games are errmmm free lol
  • Veho @ Veho:
    I mean yeah sure but the specs are the same as a $50 model, it's just those pesky "quality of life" things driving up the price, like an actually working speaker, or buttons that don't melt, and stuff like that.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I think all in my Pi 4 was well north of 200 bucks 150ish for the Pi 4 the case the fancy cooler, then like 70 for the 500GB MicroSD then like 70 for the Xbox controller. But honestly it's a nice set up I really enjoy and to me was worth every penny. (even bought more controllers for 2 or 4 player games.) hmmm have never played any 2 player games yet :(
  • Veho @ Veho:
    Yeah that's what I hate about the RPi, it's supposedly $30 or something but it takes an additional $200 of accessories to actually turn it into a working something.
  • Psionic Roshambo @ Psionic Roshambo:
    yes that's the expensive part lol
  • Veho @ Veho:
    I mean sure it's flexible and stuff but so is uremum but it's fiddly.
  • Psionic Roshambo @ Psionic Roshambo:
    Yeah a lot of it I consider a hobby, using Batocera I am constantly adjusting the collection adding and removing stuff, scraping the artwork. Haven't even started on some music for the theme... Also way down the road I am considering attempting to do a WiiFlow knock off lol
  • Veho @ Veho:
    I want everything served on a plate plz ktnx, "work" is too much work for me.
  • Veho @ Veho:
    Hmm, with that in mind, maybe a complete out-the-box solution with all the games collected, pacthed and optimized for me would be worth $150 :unsure:
  • Psionic Roshambo @ Psionic Roshambo:
    Yeah it's all choice and that's a good thing :)
  • Bunjolio @ Bunjolio:
    animal crossing new leaf 11pm music
  • Bunjolio @ Bunjolio:
    avatars-kKKZnC8XiW7HEUw0-KdJMsw-t1080x1080.jpg
    wokey d pronouns
  • SylverReZ @ SylverReZ:
    What its like to do online shopping in 1998: https://www.youtube.com/watch?v=vwag5XE8oJo
  • BakerMan @ BakerMan:
    wokey d pronouns when woku walks in

    "CALL ME THEY SLASH THEEEEEEEEEEEEEEEEEEEEEEEEEEM"
  • AncientBoi @ AncientBoi:
    :tpi::rofl2::rofl2: Right on point :rofl2::rofl2::tpi:
  • Bunjolio @ Bunjolio:
    politics forum is def a place that exists
  • Bunjolio @ Bunjolio:
    lol
    Bunjolio @ Bunjolio: lol