[ADD] Enable/Disable Button. UI Enhancements, Info Icon, Fixed Text L…#232
[ADD] Enable/Disable Button. UI Enhancements, Info Icon, Fixed Text L…#232AnmollGarg wants to merge 10 commits into
Conversation
…ive Updation in Read More Page, Dynamic Timeout, Stagging
Co-authored-by: AnmollGarg <anmolgarg12203@gmail.com>
[ADD] Search Feature, Renamed the Page Name
|
Hi @AnmollGarg The Bug In Read More Page persists.
|
I have fixed the bug you mentioned. |
suraj-yadav0
left a comment
There was a problem hiding this comment.
If a user is actively recording speech-to-text and closes the page or navigates back, the background arecord/ffmpeg subprocess remains active until the silence timeout (7 seconds) or hard timeout (300 seconds) is reached.
Refere these files, voice2.text.py
ReadMorePage.qml, RichTextEditor.qml, and RichTextPreview.qml
Add cleanup handlers to ensure active voice processes are explicitly stopped when components are destroyed or navigated away..
Something like ........Component.onDestruction{
if(listening || processing) {
backend_bridge.call(backend.stop_voice_recognition)
}}
…oad error pop up message
|
@AnmollGarg @parvathyabnair I also recommend Putting a Stop Action Button on the Voice Over Pop-over which will make it more user intuitive. |
[FIX] voice model setting info, the navigation issue fixed, the downl…
[EDIT] the voice model settings info content
|
@suraj-yadav0 Can you please review the changes, and let me know if there is any issues? |
There was a problem hiding this comment.
In backend.py the voice recognition subprocess is started using Python's default multiprocessing.Process. On Linux, this defaults to the fork start method. When executed inside a Qt/QML context (via PyOtherSide), forking duplicates the parent application's memory and handles (including active C++ Qt structures and SQLite database descriptors) while keeping only the calling thread alive. This regularly leads to deadlocks or memory corruption when the child process attempts to execute or terminate.
Sol: Explicitly start the subprocess using a spawn context to create a completely clean Python interpreter instance:
import multiprocessing
ctx = multiprocessing.get_context("spawn")
p = ctx.Process(target=_subprocess_recognize, args=(str(model_path), child_conn, 30))
p.start()
There was a problem hiding this comment.
The backend runs a message loop while p.is_alive():. If the recording subprocess hangs on a blocking read (e.g. arecord or ffmpeg locks stdout without exiting), the child process will never poll the pipe for the "stop" instruction. In this scenario, the parent loop will spin/hang indefinitely, leaking background threads in the Python bridge.
Suggested Sol: Implement a watchdog timer in the parent process to terminate the child if it doesn't respond to the stop signal:
There was a problem hiding this comment.
If a Python exception is raised inside the decoding loop (e.g., in rec.AcceptWaveform(data) or json.loads), control immediately transfers to the except block. Because process.terminate() or process.wait() are not called in the exception path, the recording process (arecord / ffmpeg) remains running, consuming background resources.
Sol : Protect the subprocess lifecycle using a try...finally block
There was a problem hiding this comment.
In
Settings_VoiceModel.qml
ReadMorePage.qml
RichTextEditor.qml
RichTextPreview.qml
The voice integration settings introduce a new SQLite file UBTMS_SettingsDB, whereas all other configuration pages (Theme, Accounts, Notifications, Sync) use myDatabase. This creates database fragmentation and breaks structural pattern consistency.
Sol : Consolidate voice settings under myDatabase by replacing the database open call
var db = Sql.LocalStorage.openDatabaseSync("myDatabase", "1.0", "My Database", 1000000);
There was a problem hiding this comment.
In ReadMorePage.qml (and RichText views)
If a user navigates to the Read More page before visiting settings on a fresh launch, the database query SELECT value FROM app_settings is executed before the table is ever created, throwing an SQL exception. While wrapped in try/catch, it leads to messy logs.
Solution : Always run CREATE TABLE IF NOT EXISTS app_settings (key TEXT PRIMARY KEY, value TEXT) inside the transaction block before querying.
|
|
||
| function isModelCompatible(sizeStr) { | ||
| if (!sizeStr) return true; | ||
| var isG = sizeStr.indexOf("G") !== -1; |
There was a problem hiding this comment.
Compatibility RAM check depends on indexOf("G") case-sensitivity. It might fail if a model size is labeled with "gb".
Solution : Normalize size string to uppercase and clean it using regex
var upperSize = sizeStr.toUpperCase();
var isG = upperSize.indexOf("G") !== -1;
Summary
This PR introduces voice-to-text enhancements, including UI improvements, dynamic timeout configurations, backend logic updates, and a toggle button to enable or disable the feature. It also addresses a text live-updation bug on the "Read More" page.
Type
Motivation
The goal is to improve the user experience and reliability of the voice-to-text functionality. Users needed a way to toggle the feature on/off, clear visual indicators (info icon), and more robust text updates in real-time. Dynamic timeouts ensure the system accommodates varying speech patterns.
Changes
Settings_Page.qml,Settings_VoiceModel.qml).RichTextEditor.qml,RichTextPreview.qml,HtmlEditorToolbar.qml).src/backend.pyandvoice_to_text/voice2text.pyto handle dynamic timeouts and core staging logic.Testing
clickable build && clickable review)clickable install)Screenshots (if UI change)
Checklist
mainorrelease\x.x.xbranchRelated Issues
Additional Notes
The backend changes introduce dynamic timeout staging which directly correlates with the new settings UI. Ensure the speech model is downloaded/available when testing on-device.