Skip to content

I2S: fix mkv muxing for files#24666

Merged
arendst merged 1 commit into
arendst:developmentfrom
Staars:i2s_fix_mkv
Apr 21, 2026
Merged

I2S: fix mkv muxing for files#24666
arendst merged 1 commit into
arendst:developmentfrom
Staars:i2s_fix_mkv

Conversation

@Staars
Copy link
Copy Markdown
Contributor

@Staars Staars commented Apr 21, 2026

Description:

File recording — seekable, cluster finalization works, but Position(int64) uses file_->seek() which returns a bool from the Arduino File API, not 0 on success. The libwebm code expects 0 on success, non-zero on failure — but File::seek() returns true on success. This means every seekback was treated as a failure due to incompatible return values.

Besides something must have changed in between regarding task callback timings in the IDF, where I encountered packet losses on audio read due to delay drift or something like that. Thus it is the simplest solution to allow i2s_read to block up to the time for one frame read to (pretty much) guarantee a full frame, which will now silently happen from time to time. This removed noise in OPUS recordings in my tests.

Some small refactoring for better error report in debug and calling xTaskDelayUntil directly and not through a macro.

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.8
  • The code change is tested and works with Tasmota core ESP32 V.3.1.11 / V.3.3.8
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@arendst arendst merged commit 274d8f0 into arendst:development Apr 21, 2026
64 checks passed
@Staars Staars deleted the i2s_fix_mkv branch May 3, 2026 17:18
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 this pull request may close these issues.

2 participants