KurtE
Senior Member+
I thought I would create a new thread specifically on this, as to not have it buried in another somewhat not related topic.
As was reported in the thread: https://forum.pjrc.com/threads/70553-Teensy-4-0-based-Audio-Guestbook?p=315003&viewfull=1#post315003
And more recently in an issue against the MTP_Teensy github project: https://github.com/KurtE/MTP_Teensy/issues/41
Short form: The problem reported in the above issue, has to do with if you enable MTP in the Audio Guestbook, writes to the SD card slow down a lot and in addition to this, there are some Audio output issues.
We have isolated this down to, the fact that the current MTP code, will be default try to determine if there is an SDCard within an SD drive, on a periodic basis.
Currently I believe it defaults to every half second. Or more specifically to the next call to MTP.loop(), when there has elapsed at least a half second from the previous call.
And the behavior issue appears to be far more pronounced on the T3.6 or 4.x when using a BUILT in card.
All of this code then boils down to us, calling: SD.mediaPresent(). actually, we call it with a pointer to each specific instance of the SDClass that was added to the MTP list.
Note: there are a few different ways to disable this code: The one that has been tested in the issue mentioned above:
You can also with this version explicitly add the SD volume and say it is an unknown filesystem type to have not register for this.
Something like: MTP.addFilesystem(&SD, "SD", MTP_FSTYPE_UNKNOWN);
Also, you have the option, of not calling MTP.loop() if you are in the middle of something time critical.
Next up what is mediaPresent() doing?
Will post that on the next message.
As was reported in the thread: https://forum.pjrc.com/threads/70553-Teensy-4-0-based-Audio-Guestbook?p=315003&viewfull=1#post315003
And more recently in an issue against the MTP_Teensy github project: https://github.com/KurtE/MTP_Teensy/issues/41
Short form: The problem reported in the above issue, has to do with if you enable MTP in the Audio Guestbook, writes to the SD card slow down a lot and in addition to this, there are some Audio output issues.
We have isolated this down to, the fact that the current MTP code, will be default try to determine if there is an SDCard within an SD drive, on a periodic basis.
Currently I believe it defaults to every half second. Or more specifically to the next call to MTP.loop(), when there has elapsed at least a half second from the previous call.
And the behavior issue appears to be far more pronounced on the T3.6 or 4.x when using a BUILT in card.
All of this code then boils down to us, calling: SD.mediaPresent(). actually, we call it with a pointer to each specific instance of the SDClass that was added to the MTP list.
Note: there are a few different ways to disable this code: The one that has been tested in the issue mentioned above:
Code:
MTP.storage()->set_DeltaDeviceCheckTimeMS((uint32_t) -1);
You can also with this version explicitly add the SD volume and say it is an unknown filesystem type to have not register for this.
Something like: MTP.addFilesystem(&SD, "SD", MTP_FSTYPE_UNKNOWN);
Also, you have the option, of not calling MTP.loop() if you are in the middle of something time critical.
Next up what is mediaPresent() doing?
Will post that on the next message.
Last edited: