-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Use smaller files on the SD card #1650 #2809
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
Use smaller files on the SD card #1650 #2809
Conversation
- Introduced a chunk counter to generate unique filenames across reboots. - Implemented functions to save and load the chunk counter from persistent storage. - Updated filename format to include the chunk counter for better file management.
|
love to see this. keep going man. |
…ions by reducing system calls. - Introduced a chunk counter to generate unique filenames across reboots. - Implemented functions to save and load the chunk counter from persistent storage. - Updated filename format to include the chunk counter for better file management.
…aintainability - Introduced sdcard_config.h to centralize SD card related constants and paths. - Updated sdcard.c to utilize defined constants for mount points and file paths, enhancing code readability and configurability. - Refactored chunking logic to improve error handling and maintainability, including updates to filename generation and chunk counter management.
- Updated AndroidManifest.xml to include permissions for external storage access. - Enhanced asset management by adding new image assets and updating the asset list. - Implemented a new DeviceAudioFilesWidget to display audio files on the device, including connection status and file management options. - Added functionality in CaptureProvider to manage downloaded files, including listing, deleting, and downloading files from the device. - Improved error handling and user notifications for file operations. - Refactored device connection logic to support fetching storage file names from connected devices.
- Added a new method to automatically process downloaded files after successful download. - Introduced checks for backend connectivity and user authentication before processing. - Implemented legacy-compatible filename generation for processed files. - Enhanced error handling with specific notifications for various failure scenarios. - Updated the CaptureProvider to include new imports and methods for improved functionality.
Hi @beastoin , Thanks! The draft version of the firmware is ready and tested. I’m now exploring the Android app part. |
- Introduced CONFIG_OMI_ENABLE_AUDIO_CHUNKING to enable a time-based audio chunking system for better file management. - Updated sdcard.c to control chunking behavior based on the new configuration option. - Enhanced sdcard_config.h documentation to reflect the new audio chunking feature. - Modified project configuration file to enable audio chunking by default.
|
wait, sry, did you test the firmware ? harshithsunku --- prev: sry man. closing this for now // the update speed is too low haha. keep working on your branch, then feel free to create a new PR when you're ready. thank you // @harshithsunku |
Hi @beastoin , Yes, I’ve tested the firmware and it’s working fine from the initial commit. I still need to check things on the Flutter side, which is already in progress. I was tied up with other work, so I couldn’t spend much time on this, but I’ll try to get back to it within the next two weeks. FYI: Since I mainly work on the firmware side and I’m still quite new to the Android/Flutter part, I wasn’t fully aware of how the app sync was implemented at first. Once I started digging into that part, I realized the current design would use a lot of resources, which caused the delay. I’m now working on these optimizations so the sync will be more efficient with minimal resource usage. |
|
just checked your code quickly (firmware only). qq — what happens to the audio files after a device reset? i’m worried the new file will override the old one haha. anw, to move faster you could split this PR into 2 parts: firmware + app. i’d like to help 1 by 1. let’s finish the firmware first. tip: set up pre-commit to resolve the formatting issue → https://docs.omi.me/doc/developer/AppSetup#9-code-formatting%E2%80%8B |
Hi @beastoin, Thanks for reviewing the firmware code The reload scenario is already handled to avoid overwrites. How it works
Implementation
So, no worries files won’t ever be overwritten, even across multiple reloads. I will split the PR and let you know in a day. |
|
There is other PR for this : #3019 |
Audio Chunking System Implementation (Under Development)
Overview
This PR implements a robust audio chunking system for the OMI firmware that automatically rotates audio recordings into time-based chunks for improved file management and storage efficiency.
Key Features
Automatic 5-Minute Audio Chunks
CHUNK_DURATION_CYCLES)File Naming
audio/chunk_HHMMSS_NNNNN.binchunk_counter.txtfor filename uniqueness across sessionsThread-Safe Implementation
Existing System
chunking_enabledflag allows toggling between new chunking system and legacy storageTechnical Implementation
Main Loop Integration
check_chunk_rotation_timing()call to main loop every 500msset_system_boot_complete()called after initialization to prevent chunking during bootStorage System Updates
write_to_storage()intransport.cto check for chunk rotationFiles Modified
src/sdcard.c- Core chunking implementationsrc/sdcard.h- API definitionssrc/main.c- Main loop integration and boot completionsrc/transport.c- Storage system integration