Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIDI LittleFS #407

Closed
Nyegnav opened this issue Jul 14, 2021 · 4 comments · Fixed by esp8266/Arduino#8235
Closed

MIDI LittleFS #407

Nyegnav opened this issue Jul 14, 2021 · 4 comments · Fixed by esp8266/Arduino#8235

Comments

@Nyegnav
Copy link

Nyegnav commented Jul 14, 2021

Apologies if I'm being a dumb dumb, but I can't seem to get the ESP8266Audio PlayMidifromLittleFS example to work;
Running on D1 Mini 4mb.
Monitor returns the following error;

Panic lfs.c:5121 lfs_file_read: Assertion 'lfs_mlist_isopen(lfs->mlist, (struct lfs_mlist*)file)' failed.

@joelwetzel
Copy link

My project had been working fine for a long time, but just recently I started getting this exact error. Instead of MIDI, I'm using AudioFileSourceLittleFS and AudioGeneratorWAV. Weirdly, it works fine if I play one wav file at a time, but the crash happens the moment I try to load a second wav file. (I'm putting them through an AudioOutputMixer.) This was all working until just recently.

@joelwetzel
Copy link

Well, I think I found the root of the problem, though I only have a workaround, not a true fix. From the release notes, it looks like the Espressif8266 framework version 3.0, which was released about a month ago, included some changes to how LittleFS works. I haven't found detailed documentation on the changes, but they appear to break LFS usage in this ESP8266Audio library. I was able to get my board running again by downgrading to an older version of the Espressif8266 framework. I'm using PlatformIO, so in my platform.ini file, I changed the platform line to be like:

platform = espressif8266@^2.6.3

After doing that, my project works again.

@earlephilhower

earlephilhower added a commit to earlephilhower/Arduino that referenced this issue Jul 23, 2021
When LittleFS.begin() or SDFS.begin() is called after the filesystem is
already mounted, don't unmount/remount.  When an unmount happens, all old
Files become invalid (but the core doesn't know this), so you would end
up with random crashes in FS code.

Now, check for _mounted, and if so just return immediately from begin().
This mimics the original SPIFFS code.

Fixes earlephilhower/ESP8266Audio#407
@earlephilhower
Copy link
Owner

Thanks for the report. This looks to be a core issue and PR is in review for the 3.0.2 bugfix release.

@Nyegnav
Copy link
Author

Nyegnav commented Jul 24, 2021

Much thanks. New to all this, and have been slamming my head against a wall trying to see what I was doing wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants