Hi all, further investigation on the UHSDR F7 shows an interesting problem: in each (!) frame first part (roughly 20ms or so) of the 160ms frame is distorted and shows extremely high I and Q values. If I ran the same simple code both on PC and UHSDR Firmware without an other stuff, I get very different frames for silence. Which is weird. They should be similar if not identical. The unwanted noise is created inside the functions freedv_comptx. I have not had the time to track the problem down but it could be an uninitialized memory area being used somewhere (malloced but not cleared, on PC you often still have zeroed out memory if if you don't explicitly clear it, on the STM32F7 this is not the case, it will have random value but they tend to be stable, i.e. after reboot you get similar or identical values in the memory). Since codec2_encode function is used in all of the modes, I assume the problem is not there. I will try to track this down maybe next weekend but if someone else has an idea where to look for issues, I'd appreciate that. You'll need an F7 or H7 to run the code, it is #ifndef CORTEX_M4 so not so easy to run it on a F4 target. Memory could be an issue too on F4.
Rough outline of the relevant parts of code I am running on the PC (modified freedv_tx.c). In the UHSDR firmware it is identical minus the fprintf, there I use the ST Link debugger to check values in memory. ... struct freedv* freedv = freedv_open(FREEDV_MODE_700D ); freedv_set_snr_squelch_thresh(freedv, -100.0); freedv_set_squelch_en(freedv, 1); freedv_set_clip(freedv, use_clip); freedv_set_tx_bpf(freedv, use_txbpf); memset(speech_in,0,sizeof(short)*n_speech_samples); COMP mod_out_c[1280]; freedv_comptx(freedv, mod_out_c, speech_in); for (int i = 0; i < n_nom_modem_samples;i+=4) { for (int j=0; j < 4; j++) { fprintf(stderr,"%f %f ",mod_out_c[i+j].real,mod_out_c[i+j].imag); } fprintf(stderr,"\n"); } exit(1); ... 73 Danilo On 07.06.2018 08:22, Danilo Beuche wrote: > Hi David, > > further investigation showed that the UHSDR firmware used the wrong > buffer size (which caused the crashes...). Now this works and we can see > that we produce 160ms frames back to back (so performance is probably > more or less sufficient on the F7) but each frame has some unwanted > noise of exactly 20ms in it instead of the FreeDV signal. This happens > in always exactly the same position in each frame so I assume it is a > fault on our UHSDR buffer handling side. We'll see. > > 73 > Danilo > On 06.06.2018 22:53, David Rowe wrote: >> Hi Danilo, >> >> I'm surprised that (especially) the tx is too slow for that class of >> CPU. The modem (especially the modulator) is quite simple in terms of >> CPU compared to the early parallel tone modems, e.g. for FreeDV 1600. >> >> On a x86 I get similar CPU load for 1600 and 700D - and 700D has >> powerful FEC. >> >> Do you ave any profiling information you can share? >> >> Thanks, >> >> David >> >> On 07/06/18 06:08, Danilo Beuche wrote: >>> Hi, >>> >>> I have been working to get FreeDV 700D running on the STM32F743 as part >>> of the UHSDR firmware. After being stopped for while by a bug in the STM >>> supplied data cache init code I was able to get the OVI40 TRX to >>> transmit for a brief moment the FreeDV sound to my RX. But unfortunately >>> the STM32F7 is not fast enough to transmit 700D continuously. It is >>> simply not able to produce a 160ms frame fast enough. Can't say anything >>> about receive yet, but I can see also a serious load when in RX. >>> >>> Next up is to run the same code on a STM32H7, I have some hope that this >>> one is fast enough with the code as it is (it is about twice as fast the >>> STM32F7 clockwise). >>> >>> 73 >>> Danilo >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> Check out the vibrant tech community on one of the world's most >>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >>> _______________________________________________ >>> Freetel-codec2 mailing list >>> Freetel-codec2@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/freetel-codec2 >>> >> ------------------------------------------------------------------------------ >> >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >> _______________________________________________ >> Freetel-codec2 mailing list >> Freetel-codec2@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/freetel-codec2 > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Freetel-codec2 mailing list > Freetel-codec2@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/freetel-codec2 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Freetel-codec2 mailing list Freetel-codec2@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freetel-codec2