Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in radae_rxe.py during decode of freedv-gui recording #36

Closed
tmiw opened this issue Dec 3, 2024 · 4 comments
Closed

Exception in radae_rxe.py during decode of freedv-gui recording #36

tmiw opened this issue Dec 3, 2024 · 4 comments

Comments

@tmiw
Copy link
Collaborator

tmiw commented Dec 3, 2024

I just tried to play a file someone sent to the digitalvoice list through freedv-gui and got the following exception on the console:

Traceback (most recent call last):
  File "/Users/mooneer/freedv-gui/build_osx/src/FreeDV.app/Contents/Resources/radae_rxe.py", line 260, in do_radae_rx
    self.tmax,self.fmax = acq.refine(rx_buf, self.tmax, self.fmax, tfine_range, ffine_range)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mooneer/freedv-gui/build_osx/src/FreeDV.app/Contents/Resources/radae/dsp.py", line 219, in refine
    Dt1[t_ind,f_ind] = np.dot(rx[t:t+M],w_vec1_p)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: shapes (0,) and (160,) not aligned: 0 (dim 0) != 160 (dim 0)
Error: return value from do_rx_radae
zsh: segmentation fault  src/FreeDV.app/Contents/MacOS/FreeDV

This is using commit 98cf722 (which is the latest in dr-cport but I don't see anything checked into main since then). I can also duplicate using just command line tools by doing the following:

(radae-venv) mooneer@macaron radae % sox -t wav ~/Downloads/FreeDV_FromRadio_20241201-191336sample.wav -t raw -r 8000 -c 1 -e signed-integer -b 16  - pad 1@0 | python3 int16tof32.py --zeropad |  python3 radae_rxe.py >/dev/null
bypass_dec: False foff_err: 0.000000
encoder: 937200 weights
decoder: 907764 weights
encoder: 937200 weights
decoder: 907764 weights
Rs: 33.33 Rs': 50.00 Ts': 0.020 Nsmf: 120 Ns:   4 Nc:  30 M: 160 Ncp: 32
Input BPF bandwidth: 1740.000162 centre: 1474.999994
  1 state: search     valid: 1 0  0 Dthresh:     0.68 Dtmax12:     1.03     0.00 tmax:  635 fmax:  37.50
  2 state: candidate  valid: 1 0  1 Dthresh:     1.41 Dtmax12:     1.46     0.00 tmax:  589 fmax: -47.50
  3 state: search     valid: 0 0  1 Dthresh:     1.49 Dtmax12:     1.37     0.00 tmax:  803 fmax: -50.00
  4 state: search     valid: 0 0  1 Dthresh:     1.55 Dtmax12:     1.37     0.00 tmax:  764 fmax: -32.50
  5 state: search     valid: 0 0  1 Dthresh:     1.62 Dtmax12:     1.45     0.00 tmax:   23 fmax:   5.00
  6 state: search     valid: 0 0  1 Dthresh:     1.56 Dtmax12:     1.35     0.00 tmax:  285 fmax: -20.00
  7 state: search     valid: 1 0  1 Dthresh:     1.52 Dtmax12:     1.58     0.00 tmax:  787 fmax:  12.50
  8 state: candidate  valid: 0 0  1 Dthresh:     1.56 Dtmax12:     1.38     0.00 tmax:  792 fmax: -35.00
  9 state: search     valid: 1 0  1 Dthresh:   863.41 Dtmax12:  1601.33     0.00 tmax:  812 fmax:  32.50
 10 state: candidate  valid: 1 0  1 Dthresh:  2317.01 Dtmax12:  2510.61     0.00 tmax:  796 fmax: -10.00
 11 state: candidate  valid: 1 0  2 Dthresh:  3213.08 Dtmax12:  6914.64     0.00 tmax:  959 fmax:  20.00
 12 state: search     valid: 1 0  2 Dthresh:  6022.60 Dtmax12: 13662.83     0.00 tmax:  959 fmax:  20.00
 13 state: candidate  valid: 1 0  1 Dthresh:  8079.92 Dtmax12: 13626.27     0.00 tmax:    0 fmax:  20.00
 14 state: search     valid: 1 0  1 Dthresh:  7250.26 Dtmax12: 13342.15     0.00 tmax:    0 fmax:  20.00
 15 state: candidate  valid: 1 0  1 Dthresh:  6840.37 Dtmax12: 12041.50     0.00 tmax:    0 fmax:  22.50
 16 state: candidate  valid: 1 0  2 Dthresh:  6796.86 Dtmax12: 12025.92     0.00 tmax:    0 fmax:  22.50
 17 state: candidate  valid: 1 0  3 Dthresh:  6729.95 Dtmax12: 11991.35     0.00 tmax:    0 fmax:  22.50
Traceback (most recent call last):
  File "/Users/mooneer/radae/radae_rxe.py", line 332, in <module>
    valid_output = rx.do_radae_rx(buffer_complex, floats_out)
  File "/Users/mooneer/radae/radae_rxe.py", line 260, in do_radae_rx
    self.tmax,self.fmax = acq.refine(rx_buf, self.tmax, self.fmax, tfine_range, ffine_range)
  File "/Users/mooneer/radae/radae/dsp.py", line 219, in refine
    Dt1[t_ind,f_ind] = np.dot(rx[t:t+M],w_vec1_p)
ValueError: shapes (0,) and (160,) not aligned: 0 (dim 0) != 160 (dim 0)
Traceback (most recent call last):
  File "/Users/mooneer/radae/int16tof32.py", line 50, in <module>
    sys.stdout.buffer.write(x) 
BrokenPipeError: [Errno 32] Broken pipe
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe

Link to audio file: FreeDV_FromRadio_20241201-191336sample.wav.zip

@tmiw tmiw changed the title Exception in radae_txe.py during decode of freedv-gui recording Exception in radae_rxe.py during decode of freedv-gui recording Dec 3, 2024
@drowe67
Copy link
Owner

drowe67 commented Dec 3, 2024

@tmiw try dr-timing-bug branch. I can't seem to create a PR around this, GitHub is giving me web server errors on two machines. Good catch, and well presented - a recording and repeatable with the cmd line tools. Just the sort of repeatable bugs we want to track down from beta testers 👍

I noticed something strange in the Tx "over" of the sample around 59 seconds, it's seems to be pulsing the signal off and on at the end, around 59s. Have a listen to the sample and see what you think.

@drowe67
Copy link
Owner

drowe67 commented Dec 3, 2024

Strange pulsed audio from about 59 sec:

Screenshot from 2024-12-04 06-11-51

@tmiw
Copy link
Collaborator Author

tmiw commented Dec 3, 2024

Strange pulsed audio from about 59 sec:

Screenshot from 2024-12-04 06-11-51

Might be an issue with how EOO is injected into the TX stream by freedv-gui. That will probably be something I'll need to look into once I'm ready to start on the reporting stuff.

@tmiw
Copy link
Collaborator Author

tmiw commented Dec 4, 2024

@tmiw try dr-timing-bug branch. I can't seem to create a PR around this, GitHub is giving me web server errors on two machines. Good catch, and well presented - a recording and repeatable with the cmd line tools. Just the sort of repeatable bugs we want to track down from beta testers 👍

Just tried this branch on freedv-gui and the above test file seems to decode without any problems now. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants