When recording audio using either i2srec or i2srec2 the recording stops after 30 seconds. The behavior is the same when recording to a SDCard or to FlashFS.
i2sstream is not experiencing this issue, it does not stop streaming mp3 or opus data.
Configuration output here:
03:40:52.788 CMD: Backlog Template; Module; GPIO 255
03:40:52.801 RSL: RESULT = {"NAME":"ESP32S3","ARCH":"ESP32S3","GPIO":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1],"FLAG":0,"BASE":1}
03:40:53.038 RSL: RESULT = {"Module":{"1":"ESP32S3"}}
03:40:53.241 RSL: RESULT = {"GPIO0":{"None":0},"GPIO1":{"None":0},"GPIO2":{"None":0},"GPIO3":{"None":0},"GPIO4":{"SDCard CS2":6721},"GPIO5":{"SPI MOSI2":705},"GPIO6":{"SPI CLK2":737},"GPIO7":{"SPI MISO2":673},"GPIO8":{"None":0},"GPIO9":{"None":0},"GPIO10":{"None":0},"GPIO11":{"None":0},"GPIO12":{"None":0},"GPIO13":{"None":0},"GPIO14":{"None":0},"GPIO15":{"I2S DIN1":7872},"GPIO16":{"I2S WS1":7840},"GPIO17":{"I2S BCLK1":7808},"GPIO18":{"I2S DOUT1":7776},"GPIO19":{"None":0},"GPIO20":{"None":0},"GPIO21":{"None":0},"GPIO33":{"None":0},"GPIO34":{"None":0},"GPIO35":{"None":0},"GPIO36":{"None":0},"GPIO37":{"None":0},"GPIO38":{"None":0},"GPIO39":{"None":0},"GPIO40":{"None":0},"GPIO41":{"None":0},"GPIO42":{"None":0},"GPIO43":{"None":0},"GPIO44":{"None":0},"GPIO45":{"None":0},"GPIO46":{"None":0},"GPIO47":{"None":0},"GPIO48":{"WS28121":1376}}
STATUS 0 output here:
03:41:41.289 CMD: Status 0
03:41:41.290 RSL: STATUS = {"Status":{"Module":1,"DeviceName":"Mikrofon1","FriendlyName":["Mikrofon1"],"Topic":"tasmota_FCCB78","ButtonTopic":"0","Power":"1","PowerLock":"0","PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0,"StatusRetain":0}}
03:41:41.293 RSL: STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":" ","RestartReason":"Software reset CPU","Uptime":"0T00:31:29","StartupUTC":"2026-04-19T02:10:12","Sleep":50,"CfgHolder":4617,"BootCount":36,"BCResetTime":"2026-04-03T23:04:59","SaveCount":60}}
03:41:41.295 RSL: STATUS2 = {"StatusFWR":{"Version":"15.3.0.3(TasmotaFriggel-esp32s3)","BuildDateTime":"2026-04-08T04:24:03","Core":"3.3.7","SDK":"5.3.4.260127","CpuFrequency":240,"Hardware":"ESP32-S3 v0.2","CR":"350/699"}}
03:41:41.296 RSL: STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"MqttLog":0,"FileLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["IoT-WiFi",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["00008009","2805C80001000600003C5A0A192800000000","00000080","00006000","00004000","00000000"]}}
03:41:41.303 RSL: STATUS4 = {"StatusMEM":{"ProgramSize":2443,"Free":436,"Heap":238,"StackLowMark":3,"PsrMax":5760,"PsrFree":5712,"ProgramFlashSize":16384,"FlashSize":16384,"FlashChipId":"184068","FlashFrequency":80,"FlashMode":"QIO","Features":["0809","9F8AD5DF","0005A001","B7F7BFCF","05DA9B04","E2360CC7","488800D2","20200000","D4BC480D","810A80F1","00200814"],"Drivers":"1,2,!3,4,!5,!8,9,10,11,12,!14,!16,!17,!24,26,29,!34,!35,38,!42,50,52,!59,!60,62,!63,!66,!67,!68,!73,!75,82,!86,!87,!88,!91,!121","Sensors":"1,2,3,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20,21,22,26,31,34,37,39,40,42,43,45,51,52,55,56,58,59,64,66,67,74,85,92,95,98,103,105,109,119,127","I2CDriver":"7,8,9,10,11,12,13,14,15,17,18,20,24,29,31,36,41,42,44,46,48,58,62,65,69,76,77,82,89,97"}}
03:41:41.306 RSL: STATUS5 = {"StatusNET":{"Hostname":"tasmota-mikrofon1","IPAddress":"10.13.9.208","Gateway":"10.13.9.1","Subnetmask":"255.255.255.0","DNSServer1":"10.13.9.1","DNSServer2":"0.0.0.0","Mac":"E0:72:A1:FC:CB:78","IP6Global":"","IP6Local":"fe80::e272:a1ff:fefc:cb78%st2","Ethernet":{"Hostname":"","IPAddress":"0.0.0.0","Gateway":"0.0.0.0","Subnetmask":"0.0.0.0","DNSServer1":"10.13.9.1","DNSServer2":"0.0.0.0","Mac":"00:00:00:00:00:00","IP6Global":"","IP6Local":""},"Webserver":2,"HTTP_API":1,"WifiConfig":4,"WifiPower":19.0}}
03:41:41.308 RSL: STATUS6 = {"StatusMQT":{"MqttHost":"","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_FCCB78","MqttUser":"DVES_USER","MqttCount":0,"MqttTLS":0,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
03:41:41.309 RSL: STATUS7 = {"StatusTIM":{"UTC":"2026-04-19T02:41:41Z","Local":"2026-04-19T03:41:41","StartDST":"2026-03-29T02:00:00","EndDST":"2026-10-25T03:00:00","Timezone":"+01:00","Sunrise":"05:51","Sunset":"19:47"}}
03:41:41.311 RSL: STATUS10 = {"StatusSNS":{"Time":"2026-04-19T03:41:41"}}
03:41:41.314 RSL: STATUS11 = {"StatusSTS":{"Time":"2026-04-19T03:41:41","Uptime":"0T00:31:29","UptimeSec":1889,"Heap":238,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":0,"Berry":{"HeapUsed":3,"Objects":47},"POWER":"ON","Dimmer":26,"Color":"004209","HSBColor":"128,100,26","Channel":[0,26,3],"Scheme":0,"Width":1,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"Maria Home","BSSId":"26:E8:29:E1:1F:30","Channel":11,"Mode":"HT20","RSSI":100,"Signal":-48,"LinkCount":1,"Downtime":"0T00:00:03"},"Hostname":"tasmota-mikrofon1","IPAddress":"10.13.9.208"}}
I expect the recording to continue until i stop it. There does not seem to be a mantion of a limitation of the recording length in the documentation, in the code etc.
I am not overly experienced with code, but i tried to trace back where StopRX is called.
It happens in xdrv_42_1_i2s_mp3mic_idf51.ino:343, exactly when "written" jumps to -1:
__enctime = millis();
if(bytes_read != 0){
written = mic_enc->encode(bytes_read >> 1); //transmit samples, written is an error code
}
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("_mic: %u , %i, %i"), millis() - __enctime, written, bytes_read);
if(written < 0){
break;
}
PROBLEM DESCRIPTION
When recording audio using either i2srec or i2srec2 the recording stops after 30 seconds. The behavior is the same when recording to a SDCard or to FlashFS.
Also the behavior of i2srec and i2srec differs slightly:
"i2srec2 /test.opus" stops the recording and outputs a record task result code: 0 Message to the console
"i2srec /test.mp3" does not send a message to the console, i2srec -? shows the recording is seemingly running past 30 seconds. When stopping the recording and checking the file, in fact only 30 seconds are recorded.
i2sstream is not experiencing this issue, it does not stop streaming mp3 or opus data.
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255:Backlog Rule1; Rule2; Rule3:Status 0:weblogto 4 and then, when you experience your issue, provide the output of the Console log:TO REPRODUCE
EXPECTED BEHAVIOUR
I expect the recording to continue until i stop it. There does not seem to be a mantion of a limitation of the recording length in the documentation, in the code etc.
SCREENSHOTS
If applicable, add screenshots to help explain your problem.
ADDITIONAL CONTEXT
I am not overly experienced with code, but i tried to trace back where StopRX is called.
It happens in xdrv_42_1_i2s_mp3mic_idf51.ino:343, exactly when "written" jumps to -1:
__enctime = millis();
if(bytes_read != 0){
written = mic_enc->encode(bytes_read >> 1); //transmit samples, written is an error code
}
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("_mic: %u , %i, %i"), millis() - __enctime, written, bytes_read);
if(written < 0){
break;
}
The file is written to FlashFS or SDCard after the recording stops, and contains 30 seconds of valid Audio.
(Please, remember to close the issue when the problem has been addressed)