ttscoff / nv

MultiMarkdown version of Notational Velocity with Markdown editing features and preview
http://brettterpstra.com/projects/nvalt
BSD 3-Clause "New" or "Revised" License
1.77k stars 198 forks source link

Dictation input flaky #268

Open nine9ths opened 10 years ago

nine9ths commented 10 years ago

In 10.9 with nvALT 2.2b (111) if you use Enhanced Dictation (possibly regular dictation as well) to input text, the input can sometimes become munged. I'm not seeing this behavior from any other apps.

If I use the shortcut to turn on dictation (fn fn) dictate a few words then turn off dictation either by clicking the "Done" button or tapping fn again, the words show up but if there is any keyboard input, they're immediately replaced by garbage (possibly some kind of escape sequence). Oddly this doesn't happen all the time, certain words seem to elicit the behavior more than others. I'm able to reliably reproduce by dictating 'maneuver' then pressing the left arrow, the text is replaced with '^]'. The time between ceasing dictation and the keyboard input doesn't seem to affect the reproducibility.

Here is the excerpt from the console for the duration of the event:

4/29/14 13:07:33.809    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    RDLiveSoundSource::SetMicOff
4/29/14 13:07:33.809    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    RDSoundSource::SetMicOff
4/29/14 13:07:33.809    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2: Info: set channel adaptation 1
4/29/14 13:07:33.809    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    Mic [Deferred toggle] is now OFF
4/29/14 13:07:33.809    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    RDLiveSoundSource::SetMicOn
4/29/14 13:07:33.817    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    Audio ducking is now ON 
4/29/14 13:07:33.817    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    RDSoundSource::SetMicOn
4/29/14 13:07:33.817    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2: Info: set channel adaptation 1
4/29/14 13:07:33.817    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2: Info: set channel adaptation 1
4/29/14 13:07:33.817    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    Mic [First grammar is listening] is now ON
4/29/14 13:07:33.817    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2: Info: detecting gap in external channel
4/29/14 13:07:35.217    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    RDS2Engine::BeginUtt
4/29/14 13:07:35.217    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2:        Header VocVersionID <mobi/eng-USA/searchmessaging/large/20120228/20120228130948>
4/29/14 13:07:35.218    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2:        Header Model 0 UsrVersionID Fri_30_Dec_2011__pan_yue_grid-unv12_24404>
4/29/14 13:07:35.218    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2:        Header Model 1 UsrVersionID Wed_28_Dec_2011__jonas_loof_grid-unn1_5974>
4/29/14 13:07:35.218    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2:        Header Model 2 UsrVersionID Thu_29_Dec_2011__jonas_loof_grid-cno23_32096>
4/29/14 13:07:35.218    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2:        Info: first pass recognition started
4/29/14 13:07:35.219    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2:        Info: setUpPrefilterer[0]
4/29/14 13:07:35.219    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2:        Info: ClsDSXSpeaker2Passv2::GetPrefilterer[0]
4/29/14 13:07:36.809    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    PhraseHypothesis, flags = 0001
4/29/14 13:07:36.814    Dock[198]   CGSConnectionByID: 0 is not a valid connection ID.
4/29/14 13:07:36.814    Dock[198]   CGSSetHotKeyEnabled: Invalid connection
4/29/14 13:07:36.814    Dock[198]   CGSConnectionByID: 0 is not a valid connection ID.
4/29/14 13:07:36.814    Dock[198]   CGSSetHotKeyEnabled: Invalid connection
4/29/14 13:07:36.823    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2:        Info: recog type 1
4/29/14 13:07:36.824    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2:        UTTERANCE: 0x0x5 : uttType: SPEECH : sourceDuration 39917626 : duration 1974334
4/29/14 13:07:36.824    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2:        Pass 2 skipped: First pass lattice is flat
4/29/14 13:07:36.824    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    EndPhrase, flags = 0003
4/29/14 13:07:36.824    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2:        DSXItn_GenerateResultAlternatives : TPItn_GenerateResultAlternatives returns 3 results
4/29/14 13:07:36.824    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    RDS2Engine::EndUtt (1 live)
4/29/14 13:07:36.829    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2:        Not loading accumulator file: bOUFACarryoverEnabled = 0, LoadFromFile = 0, FileExists = 0
4/29/14 13:07:36.857    Dock[198]   CGSConnectionByID: 0 is not a valid connection ID.
4/29/14 13:07:36.857    Dock[198]   CGSSetHotKeyEnabled: Invalid connection
4/29/14 13:07:36.857    nvALT[196]  -[NSConcreteMutableAttributedString isPairedCharacterWithMatchString:]: unrecognized selector sent to instance 0x618000235020
4/29/14 13:07:36.857    Dock[198]   CGSConnectionByID: 0 is not a valid connection ID.
4/29/14 13:07:36.857    Dock[198]   CGSSetHotKeyEnabled: Invalid connection
4/29/14 13:07:36.857    nvALT[196]  An uncaught exception was raised
4/29/14 13:07:36.857    nvALT[196]  -[NSConcreteMutableAttributedString isPairedCharacterWithMatchString:]: unrecognized selector sent to instance 0x618000235020
4/29/14 13:07:36.858    nvALT[196]  (
    0   CoreFoundation                      0x00007fff8e90a25c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff8b3b3e75 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8e90d12d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x00007fff8e868322 ___forwarding___ + 1010
    4   CoreFoundation                      0x00007fff8e867ea8 _CF_forwarding_prep_0 + 120
    5   nvALT                               0x0000000100026f23 nvALT + 159523
    6   AppKit                              0x00007fff8f1bf767 -[NSTextInputContext insertText:replacementRange:] + 379
    7   AppKit                              0x00007fff8f1bea18 -[NSTextInputContext handleTSMEvent:] + 8271
    8   AppKit                              0x00007fff8f1bc9a5 _NSTSMEventHandler + 205
    9   HIToolbox                           0x00007fff8c5751d4 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 892
    10  HIToolbox                           0x00007fff8c574787 _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 385
    11  HIToolbox                           0x00007fff8c588880 SendEventToEventTarget + 40
    12  HIToolbox                           0x00007fff8c5c9d0d SendTSMEvent + 33
    13  HIToolbox                           0x00007fff8c7775ff SendTextInputEvent + 1028
    14  HIToolbox                           0x00007fff8c7c20d8 -[IMKInputSession insertText:replacementRange:] + 153
    15  CoreFoundation                      0x00007fff8e7f5a5c __invoking___ + 140
    16  CoreFoundation                      0x00007fff8e7f58c4 -[NSInvocation invoke] + 308
    17  CoreFoundation                      0x00007fff8e898516 -[NSInvocation invokeWithTarget:] + 54
    18  CoreFoundation                      0x00007fff8e8680f4 ___forwarding___ + 452
    19  CoreFoundation                      0x00007fff8e867ea8 _CF_forwarding_prep_0 + 120
    20  CoreFoundation                      0x00007fff8e7f5a5c __invoking___ + 140
    21  CoreFoundation                      0x00007fff8e7f58c4 -[NSInvocation invoke] + 308
    22  Foundation                          0x00007fff9418bd47 -[NSConnection dispatchInvocation:] + 135
    23  Foundation                          0x00007fff9418ba0d -[NSConnection handleRequest:sequence:] + 1434
    24  Foundation                          0x00007fff94132d50 -[NSConnection handlePortCoder:] + 652
    25  Foundation                          0x00007fff94132688 -[NSConnection dispatchWithComponents:] + 50
    26  Foundation                          0x00007fff94116f38 __NSFireMachPort + 257
    27  CoreFoundation                      0x00007fff8e83ba74 __CFMachPortPerform + 388
    28  CoreFoundation                      0x00007fff8e83b8d9 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
    29  CoreFoundation                      0x00007fff8e83b84e __CFRunLoopDoSource1 + 478
    30  CoreFoundation                      0x00007fff8e82c886 __CFRunLoopRun + 1830
    31  CoreFoundation                      0x00007fff8e82bf25 CFRunLoopRunSpecific + 309
    32  HIToolbox                           0x00007fff8c59ba0d RunCurrentEventLoopInMode + 226
    33  HIToolbox                           0x00007fff8c59b7b7 ReceiveNextEventCommon + 479
    34  HIToolbox                           0x00007fff8c59b5bc _BlockUntilNextEventMatchingListInModeWithFilter + 65
    35  AppKit                              0x00007fff8ef663de _DPSNextEvent + 1434
    36  AppKit                              0x00007fff8ef65a2b -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
    37  AppKit                              0x00007fff8ef59b2c -[NSApplication run] + 553
    38  AppKit                              0x00007fff8ef44913 NSApplicationMain + 940
    39  nvALT                               0x000000010000a4f8 nvALT + 42232
    40  ???                                 0x0000000000000002 0x0 + 2
)
4/29/14 13:07:37.000    kernel[0]   SMC::smcIH WARNING: unexpected interrupt: 0x4f
4/29/14 13:07:37.882    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    Audio ducking is now OFF 
4/29/14 13:07:37.882    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    RDSoundSource::EndOfUtterance
4/29/14 13:07:37.910    com.apple.SpeechRecognitionCore.speechrecognitiond[3695]    S2:        ExternalChannel: isAtGap
4/29/14 13:07:41.539    nvALT[196]  remote: 0 updates
certainlyakey commented 9 years ago

Same here. Impossible to use Dictation because after you click Done and type something the dictated text disappears.