Skip to content

Determine which (if any) changes need to be PR'ed to Titta re: errors finishing recording #15

@anna-stacey

Description

@anna-stacey

Famously, there have been issues when quitting the program.

In our fork of Titta, I had pushed 2 relevant commits, which involved moving the line self._stop = True out of TalkToProLab.finalize_recording() and into its own fxn, so that it could be called separate from anything to do with whether we were recording.

To give a bit more detail on the flow, we have a fxn stop_recording_gaze() which calls Titta's stop_recording() and finalize_recording(), and we have close_recorder() which calls our new fxn that just does self._stop = True and Titta's disconnect().

There's two potential motivations for this change. One is if the recording and the connection need to be better separated out. I think originally I had been trying to have multiple recordings per connection, in which case this is certainly necessary. Even absent that, this might make more sense. For example, if you start the connection but do not start recording (maybe due to an early quit or an error starting the recording), you need to end the connection but not stop the recording. (Plus, if these two acts in fact need not be separated, then it would be simpler to just have them all be one big fxn anyways...)

The second potential motivation is if the change fixes the plague of errors we used to get when quitting. These no longer seem to happen. When I moved self._stop = True back to its original spot, just to see what happened, I got these results from my many print statements:

Stopping recording...
**FIRST ATTEMPT:**
State BEFORE trying to stop the recording: recording
There was a problem stopping the recording.
Response: {'reason': 'Can not stop a recording', 'status_code': 103, 'operation': 'StopRecording'}
State AFTER trying to stop the recording: recording

**SECOND ATTEMPT:**
State BEFORE trying to stop the recording: awaits_finalization
There was a problem stopping the recording.
Response: {'reason': 'Can not perform operation in a current state', 'status_code': 103, 'operation': 'StopRecording'}
State AFTER trying to stop the recording: awaits_finalization

**THIRD ATTEMPT:**
State BEFORE trying to stop the recording: awaits_finalization
There was a problem stopping the recording.
Response: {'reason': 'Can not perform operation in a current state', 'status_code': 103, 'operation': 'StopRecording'}
State AFTER trying to stop the recording: awaits_finalization
State after (trying to) stop recording (however many times): awaits_finalization
Finalizing recording...
State before (trying to) finalize recording: {'state': 'awaits_finalization', 'status_code': 0, 'operation': 'GetState'}
Successfully finalized.

So it did successfully stop the recording, but it took a couple tries. Weirdly, the state after the first attempt doesn't match the state before the second attempt, suggesting the first try did work but it just... took a second to take effect? Not good.
This might seem to suggest that the move of self._stop = True was necessary (since reverting it led to this), but in fact this seems unrelated -- recall that stopping the recording happens before self._stop = True would be called in either location.

So I guess, the questions are: what's up with this weird difficulty stopping recording? And does the movement of self._stop = True help and/or is it necessary for any other reason(s)?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions