16
µTasker general / Re: Application using FAT Emulation
« on: April 22, 2017, 11:39:02 PM »
Mark,
This define, and EMULATED_FAT_DISK_SIZE, were part of what was throwing me off I think, and was making me think that your code was setting up constant values.
I've since figured out that EMULATED_FAT_DISK_SIZE just specifies the max size on the disk, so for my project, if I just hard code it to 32GB, I should be fine I think. I tested this today, and it worked fine.
so MAXIMUM_DATA_FILES represents the maximum number of files that may be present in a given directory? or on the disk, across all directories and subdirectories?
Obviously, I can't set this to 8, as I'm going to have more files than that, and the number of files I have will be unknown until I actually query the Raspberry Pi, and find out what the file count currently is for the given run session. Could I convert this into a call back function, and have that then query the Pi, and return the count? I know this value is used in a couple places to allocate array entries and I don't want to allocate a bunch of entries if they aren't going to be used either. This is currently what I'm working on understanding in your code. I set it down for a bit today, to sidebar into what I will do to expand the max disk size later.
That is in fact what I have been doing today, debugging from those 2 places in the simulator, and playing with different file systems on thumb drives to determine exactly what my stereo recognizes. Glad to hear I'm not totally nuts, and I was following your code correctly. :-)
I'm also looking into what it might take to support the NTFS file system in an emulated fashion within your architecture. I'm currently getting close to the 32GB volume size restriction of FAT 32 with my media library, and I'd eventually like to remove that restriction. That's not for the current iteration of the project though, as I just want to get it working with my current library first. It also may be a moot point, because I've been reading that my stereo starts to flake out once you cross the 32GB boundary anyways.
As usual, thanks a ton for the great info,
Chris
Quote
In fact I don't think that it is fixed in any way, as long as the define MAXIMUM_DATA_FILES is set to be adequate for your maximum requirement.
This define, and EMULATED_FAT_DISK_SIZE, were part of what was throwing me off I think, and was making me think that your code was setting up constant values.
I've since figured out that EMULATED_FAT_DISK_SIZE just specifies the max size on the disk, so for my project, if I just hard code it to 32GB, I should be fine I think. I tested this today, and it worked fine.
so MAXIMUM_DATA_FILES represents the maximum number of files that may be present in a given directory? or on the disk, across all directories and subdirectories?
Obviously, I can't set this to 8, as I'm going to have more files than that, and the number of files I have will be unknown until I actually query the Raspberry Pi, and find out what the file count currently is for the given run session. Could I convert this into a call back function, and have that then query the Pi, and return the count? I know this value is used in a couple places to allocate array entries and I don't want to allocate a bunch of entries if they aren't going to be used either. This is currently what I'm working on understanding in your code. I set it down for a bit today, to sidebar into what I will do to expand the max disk size later.
Quote
P.S. If you haven't done it before, set a break point in fnPrepareEmulatedFAT() to see the application setting a fixed list of files - imagine now how you could insert a dynamic list instead.
Then set a break point in fnGetDataFile() to see how the application informs the mass storage task of the list to be used. See whether that is already adequate once you have your file list ready, or else imagine how you could do this call back in a different way to suite your requirement. This is called for each file, until you terminate the list by returning 0.
Of course, do this in the simulator since it is called on each start.
That is in fact what I have been doing today, debugging from those 2 places in the simulator, and playing with different file systems on thumb drives to determine exactly what my stereo recognizes. Glad to hear I'm not totally nuts, and I was following your code correctly. :-)
I'm also looking into what it might take to support the NTFS file system in an emulated fashion within your architecture. I'm currently getting close to the 32GB volume size restriction of FAT 32 with my media library, and I'd eventually like to remove that restriction. That's not for the current iteration of the project though, as I just want to get it working with my current library first. It also may be a moot point, because I've been reading that my stereo starts to flake out once you cross the 32GB boundary anyways.
As usual, thanks a ton for the great info,
Chris