SD Card Reader/UMS Device Support Issues

Issue #51 resolved
snucker created an issue

[7/5/2023 8:35:14 AM] Entering OpenDatabase_Click
[7/5/2023 8:35:19 AM] Entering SetupPlatform
[7/5/2023 8:35:19 AM] Database Type detected as "NSO".
[7/5/2023 8:35:19 AM] Entering Database Initalize
[7/5/2023 8:35:19 AM] Entering GetDatabasePlatform
[7/5/2023 8:35:19 AM] Platform detected as NES
[7/5/2023 8:35:19 AM] Selected Platform: NES
[7/5/2023 8:35:19 AM] LClassicsTitlesDB_Load
[7/5/2023 8:35:19 AM] GetStreamReader
[7/5/2023 8:35:19 AM] ClearStageFolder
[7/5/2023 8:35:19 AM] LClassicsTitlesDB_ParseTitles
[7/5/2023 8:35:56 AM] Loading "C:/Users/snucker/Downloads/CaVE/1.5 beta/CaVE-v1.5-Alpha1/database/NES_6.5 (v2031616) - [1.5]/0100D870045B6000\romfs\bootapp\resources\strings\en\strings.lng".
[7/5/2023 8:35:56 AM] 1 language strings loaded.
[7/5/2023 8:35:56 AM] Entering StringsLng_GetMetaComments
[7/5/2023 8:35:56 AM] Entering ReplaceMainTitlesList
[7/5/2023 8:38:34 AM] Entering SaveDatabase_Click
[7/5/2023 8:38:34 AM] Saving to: "C:/Users/snucker/Downloads/CaVE/1.5 beta/CaVE-v1.5-Alpha1/database/NES_6.5 (v2031616) - [1.5]/0100D870045B6000\romfs\titles\lclassics.titlesdb"
[7/5/2023 8:38:34 AM] Save complete.
[7/5/2023 8:38:34 AM] Saving to: "C:/Users/snucker/Downloads/CaVE/1.5 beta/CaVE-v1.5-Alpha1/database/NES_6.5 (v2031616) - [1.5]/0100D870045B6000\romfs\bootapp\resources\strings\en\strings.lng"
[7/5/2023 8:38:35 AM] Saved.
[7/5/2023 8:38:55 AM] Connecting to MTP responder...
[7/5/2023 8:38:55 AM] Director \Installed games\Nintendo Entertainment System - Nintendo Switch Online not found.

Comments (11)

  1. Dark Akuma

    I don’t know what this means. Again, you are kind of short-handing things. This time though with zero extra explanation at all.

    I am going to guess that this is about the SD card READER support. That feature is not complete. In fact, I have been waiting about a week for you to just tell me if your SD cards drive label name is something like “SWITCH SD“, since as I don’t have a valid SD card reader… I just don't know what to check for blindly. When I made the previous build of that code, it was just supposed to be more of a test. I was expecting to rapidly remake it as I better learn from the result. I did not truly expect it to work without issue.

    Since I have been waiting a week… I had to give up and move on. I have since cleaned up that code quite a bit. The version you “tested” that with is even less relevant now. The “Installed Games” folder is a Saves folder on DBI, and SD card reader support does not have access to saves since those are on NAND. I think this is a reminder/realization I made since whatever version you tested with and since fixed.

    Anyway. How SD card reader support is currently designed, is it requires the drive label of “SWITCH SD” to be recognized at all. Upon Syncing being activated, it figures out what drive letter your SD card uses in the reader, and tries to find a path like “F:/atmosphere/contents”. If it can find such a valid path, it would work as the MTP stuff does from there (just without save stuff).

    If the latest beta cannot work with your SD card as its coded right now, I’ll have to find a new way to check connected devices and find the Switch SD card files. Right now, I find the card from reader/USB Mass Storage and DBI MTP modes by looking for whats called a FriendlyName. For DBI MTP its “Switch”, For TegraGUI Memloader v3 USB Mass Storage, its “SWITCH SD”. For your SD card reader? I don't know. That's what I am trying to find out.

  2. Dark Akuma

    As I have not heard back from you about this yet, I had to take things into my own hands and risk damaging my SD card with decades old reader hardware. But between that and my more modern cell phone, I was able to confirm enough that my SDcard does in fact come up as “SWITCH SD” in readers. That the “Memloader v3 / UMS Tool” in the TegraRcmGUI does in fact effectively make the Switch a SDcard reader.

    So going back to my previous message, I am just waiting on you to confirm that the issue is resolved in the more recent builds. That the issue was just a quirk of my failing to separate Saves (NAND) and database (SDcard) management. I have been spoiled by DBI’s MTP server offering up the Saves partiton, just like the SDcard contents, and confused them.

  3. snucker reporter

    This is now stuck on “connecting to SD card”:

    [7/12/2023 3:24:28 PM] Entering SyncDatabase_Click
    [7/12/2023 3:24:28 PM] Saving to: "C:/Users/snucker/Downloads/CaVE/1.5 beta/CaVE-v1.5-Beta/database/GEN_2.6/0100B3C014BDA000\romfs\titles\lclassics.titlesdb"
    [7/12/2023 3:24:28 PM] Save complete.
    [7/12/2023 3:24:28 PM] Saving to: "C:/Users/snucker/Downloads/CaVE/1.5 beta/CaVE-v1.5-Beta/database/GEN_2.6/0100B3C014BDA000\romfs\bootapp\resources\strings\en\strings.lng"
    [7/12/2023 3:24:28 PM] Saved.
    [7/12/2023 3:24:28 PM] Connecting to SDcard...

    No crash or error popup when it stops processing here.

  4. Dark Akuma

    Try this exe. This will output some debug info to the DebugLog.txt for me.

    I also made some code adjustments to better handle and output messages based on what I THINK is happening.

  5. Dark Akuma

    In an effort to get this issue figured out and resolved FINALLY… I added a new settings file option.

    "sd_card_device_info": "<FriendlyName>,<Description>,<Manufacturer>"
    

    Redownload the rar, run cave once with the device connected, get the info from the debuglog.txt, add the line to the settings file, insert the proper text at the corresponding position, and boot CaVE. This basically tells CaVE what device info is a USB Mass Storage Device.

    There's even a bit of leeway. You can only supply the FriendlyName if you want. Or FriendlyName and Description.

    This should allow you to test on your own and see what info it takes to get the result of your SD Card Reader working with CaVE. Which is ultimately what this is about. I don’t like that is not working for you, and not being certain as for why… when it works for every device I use.

  6. Dark Akuma

    The 3rd option would be the correct one, but as the message indicates a character needs to be escaped. What that means is, the \ needs to be a \\. I.E. “E:\\,yadda,yadda”

    Character escaping is a syntax for text with coding that helps recognize characters in a string as text, not programming syntax. In this case, the \ character is the character that denotes it itself. Other examples \r, \n, \r, \”, \\, etc.

    This is not a bug I can fix. It’s just how json formatting is. Without it, it could not tell the difference between a quotation mark that ends the line, or one that's meant to be part of the text. The fault is just mine for not stating that. I forgot that FriendlyNames could be drive letters.

    The other 2 messages suggest that you did not, or do not have the proper } characters at the end of the settings file. Here I removed all the other settings just so it helps make it clear. Any opening { requires a closing } at some point in the file.

    {
      "settings": {    
        "sd_card_device_info": "test, SD RAW, hekate"
      }
    }
    

    I'm guessing that when adding the sd card device info line, you accidentally selected the } that closes the “settings” section, and effectively deleted it when pasting that in.

    EDIT:

    Added a change in the latest build in discord. I don’t think it will be needed, but the idea is it just allows you to not supply the friendly name or description. To be clear, this was already valid:

    "sd_card_device_info": "<FriendlyName>"
    "sd_card_device_info": "<FriendlyName>,<Description>"
    "sd_card_device_info": "<FriendlyName>,<Description>,<Manufacturer>"
    

    But now this is valid too.

    "sd_card_device_info": "*,<Description>,<Manufacturer>"
    "sd_card_device_info": "*,*,<Manufacturer>"
    "sd_card_device_info": "<FriendlyName>,*,<Manufacturer>"
    

    I just wanted to provide a little more flexibility with the option. Mostly because, hard coding a specific drive letter seems problematic. People would be bound to do so, plug in a different new device at some point and be clueless as to why things are not working anymore when that drive letter is now otherwise used.

    Test how you please, but I would recommend using…

    "sd_card_device_info": "*,MassStorageClass,Generic"
    

    ...rather than supplying the E:\\ now.

    While this option was added just to make testing a little easier. there is no reason to remove it after testing is done. So I may as well polish it a little.

  7. Log in to comment