ggerganov / kbd-audio

🎤⌨️ Acoustic keyboard eavesdropping
https://ggerganov.github.io/keytap
MIT License
8.55k stars 588 forks source link

keytap2 crashes on ubuntu 18.04 #6

Closed informatimago closed 5 years ago

informatimago commented 5 years ago

[pjb@L0253344 :0 build]$ ./record record.kbd
Recording 5 frames per key press
Found 1 capture devices:
    - Capture device #0: 'Built-in Audio Analog Stereo'
Opened capture device 2
    Frequency:  24000
    Format:     33056 (4 bytes)
    Channels:   1
    Samples:    512

Last recorded key -  10 '[enter]'. Total times recorded so far -   1. Total data saved: 0.00976562 MB
  C-c C-c
[pjb@L0253344 :0 build]$ ./keytap2 record.kbd 
Usage: ./keytap2 record.kbd
[+] Loading recording from 'record.kbd'
[+] Loaded recording: of 2562 samples (sample size = 4 bytes)
    Size in memory:          0.00977325 MB
    Sample size:             4
    Total number of samples: 2562
    Recording length:        0.10675 seconds
[+] Searching for key presses
[+] Detected a total of 0 potential key presses
[+] Search took 0.000 seconds
[+] Calculating CC similarity map
[+] Calculation took 0.000 seconds
   -1 
--------------------------------------------------------------------------------------------------------------------------------------

[+] Top 10 pairs
Segmentation fault (core dumped)
[pjb@L0253344 :0 build]$ 
[pjb@L0253344 :0 build]$ coredumpctl dump    25539 > keytap2.core
           PID: 25539 (keytap2)
           UID: 1000 (pjb)
           GID: 1000 (pjb)
        Signal: 11 (SEGV)
     Timestamp: Fri 2018-11-30 14:25:40 CET (2min 43s ago)
  Command Line: ./keytap2 record.kbd
    Executable: /home/pjb/src/kbd-audio/build/keytap2
 Control Group: /user.slice/user-1000.slice/session-2.scope
          Unit: session-2.scope
         Slice: user-1000.slice
       Session: 2
     Owner UID: 1000 (pjb)
       Boot ID: 01b5433ca7d64ffebbb9631c12690f2c
    Machine ID: 3c990c4b0b06406caa7241e23025e717
      Hostname: L0253344
       Storage: /var/lib/systemd/coredump/core.keytap2.1000.01b5433ca7d64ffebbb9631c12690f2c.25539.1543584340000000.lz4
       Message: Process 25539 (keytap2) of user 1000 dumped core.

                Stack trace of thread 25539:
                #0  0x000055665c312020 n/a (/home/pjb/src/kbd-audio/build/keytap2)

keytap2.core.xz.base64.txt

ggerganov commented 5 years ago

Keep in mind that 'keytap2' and 'keytap2-gui' are still in development stage and problems can be expected. Will be providing more info on those soon.

Other than that:

  1. Use the 'record-full' tool instead of 'record' to capture the recording. This is what 'keytap2' expects.
  2. The line saying:

    [+] Detected a total of 0 potential key presses

means that the keypress detection algorithm didn't detect any peaks in the recording. Make sure your mic level is turned to the max and is able to capture the sound from the keys. You can verify this by replaying the recording with:

./play-full record.kbd

If you hear distinct keypresses then you should be fine.