FS#5076 - voice UI crash after exiting recording screen

Attached to Project: Rockbox
Opened by James Teh (jteh) - Sunday, 09 April 2006, 14:14 GMT
Task Type Bugs
Category User Interface
Status Closed
Assigned To No-one
Operating System Iriver H300 series
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


If the voice UI is in use and one exits the recording screen without having made a recording, the voice UI will die and most often cause Rockbox to crash. To reproduce this:
1. Ensure that the voice UI is enabled and a voice file is being used.
2. Enter the recording screen.
3. Press stop to exit.

As a work around, one can enable prerecording. (Set it to 1 second if prerecording is not actually desired.) If prerecording is enabled, this crash does not occur.

Code thoughts:
It seems that both making a recording and using prerecording cause talk_buffer_steal() to be called, so I assume calling talk_buffer_steal() prevents the voice UI crash from occurring. Speech does not work in the recording screen anyway (at least on SWCODEC targets), so perhaps talk_buffer_steal() could always be called on the recording screen regardless of whether prerecording is enabled. I understand, however, that this might be a dirty hack which does not address the actual cause.
This task depends upon

Closed by  Peter D'Hoye (petur)
Monday, 01 May 2006, 13:23 GMT
Reason for closing:  Fixed
Additional comments about closing:  pretty sure this is fixed, notify me if not correct
Comment by Daniel Stenberg (bagder) - Thursday, 27 April 2006, 15:00 GMT
Does this still happen in a recent build?
Comment by James Teh (jteh) - Friday, 28 April 2006, 10:11 GMT
Sure does, although thankfully, the prerecording work around still works. I'm not sure whether this is entirely related, but this comment/patch might also be useful:
Comment by James Teh (jteh) - Monday, 01 May 2006, 03:40 GMT
This has been fixed in CVS:
"30 Apr 22:28: Peter: apps/recorder/recording.c 1.106 firmware/pcm_record.c 1.21: The recording buffer should not try to use the voice buffer, so map our buffer after it. On swcodec targets, recording always uses this buffer so always notify the others that we did. Fixes  bug 4754 ."
This is definitely a fix for this bug (5076). However, regarding  bug 4754 , according to my understanding of the code, talk_buffer_steal() was always called when recording was started (i.e. the rec button was pressed). Therefore, a crash after stopping subsequent to a certain time of recording could not have been related to this talk_buffer_steal() fix.
Comment by Peter D'Hoye (petur) - Monday, 01 May 2006, 12:27 GMT
There were in fact two bugs: not calling talk_buffer_steal(),
but also the fact that recording didn't care about the part of the buffer in use by voice and happily overwrote it.

Can you please confirm that this bug can be closed?