Hi Al, freedv_mixed_rx doesn't have support for 700D. It is intended to show mixed usage with both codec and data frames which 700D doesn't support. Because of this it also does not perform the necessary freedv_open_advanced() call needed for 700D with additional settings like the interleaver.
On 07/05/2020 08:59 AM, Al Beard wrote: > *Hi all, David, Jeroen and developers,* > * > * > Houston, we have a problem: > > On testing freedv_mixed_rx in mode 700D, with the flag "--codecrx" > the output file is correct size but garbled. > > The source 700D audio was ve9qrp_700d.wav passed speaker to mic, > and was intact on my Odroid N2, decoding well as in > 2020-07-04-16.raw > > with the --codecrx flag set > 2020-07-04-16b.raw > > Files at http://www.unixservice.com.au/parrot > > (cannot send large files > 200Kb here) > > I've been tearing my hair out looking into my "parrot" code looking > for my error, three days now!!!! > > The original "freedv_mixed_rx.c" has tests for mode 700D but is not > allowed to be used by the main() argument processing. > > Developers, can you please look at this? > > Alan VK2ZIW > > > *At this point, I'm not a good enough C programmer.* > * > * > *Alan VK2ZIW* > * > * > *On Fri, 3 Jul 2020 13:56:11 +1000, Al Beard wrote* > > *Hi Jeroen, David and developers,* > > * > > * > > *In the old code, on SourceForge SVN 3955, in freedv_api.c we have > clearly* > > *defined locations of rx "packed_bits".* > > * * > > > > * f->packed_codec_bits = (unsigned > char*)malloc(nbyte*sizeof(char));* > > * if (f->packed_codec_bits == NULL) return(NULL);* > > > > So, to get said "*packed_codec_bits" I added a function to the end > of freedv_api.c and defined in .h* > > * > > * > > *So, in the new API, how do I extract 700C frames out > from **freedv_rawdatarx() ?* > > * > > * > > *I'd be happy with unpacked bits as the routine to pack is easy.* > > * > > * > > *BTW: my "parrot.c" code is taken from current "freebeacon.c" code, > mode set to 700D.* > > * > > * > > * > > * > > *==== last email ====* > > *It all looks to be working until.......* > > * > > * > > *1) the received packed bits file is rubbish.* > > *2) transmitting out the packed bits, doesn't read down my buffer > quick enough.* > > *3) squelch does not work properly. Sync stays up on noise. A quick > whistle* > > * will get it out of sync. I've set squelch_en = 1 and given it > a level.* > > * > > * > > *usage: ./parrot --dev 5 -v* > > * > > * > > *speaker to mic from file ve9qrp_700d.wav* > > * > > * > > *Compiling:* > > *Add parrot.c to freebeacon and add this to CMakeLists.txt* > > * > > * > > > > *############ Parrot ################* > > *add_executable(parrot parrot.c)* > > *target_link_libraries(parrot ${FREEBEACON_LINK_LIBS} codec2)* > > *if(FREEBEACON_STATIC_DEPS)* > > * add_dependencies(parrot ${FREEBEACON_STATIC_DEPS})* > > *endif()* > > * > > * > > *install(TARGETS parrot RUNTIME DESTINATION bin)* > > ----------- > > then, as usual, mkdir build; cd build; cmake ../ ; make > > > > Running FreeDV GUI on the same machine, decodes ve9qrp_700d.wav > > just fine, from the same microphone input. > > > > -------------------------- In the previous parrot version > ------------------ > > I added a function in freedv_api.c to make available the packed_bits > and that worked. > > > > I'm trying to NOT modify the freedv_api. > > > > Alan VK2ZIW > > * > > * > > *On Sat, 27 Jun 2020 21:57:31 +0200, Jeroen Vreeken wrote* > > > Hi Al, > > > > > > On first glance your code looks ok. > > > (Haven't looked at the whole thing in detail though) > > > > > > 73, > > > Jeroen PE1RXQ > > > > > > On 06/27/2020 01:37 PM, Al Beard wrote: > > > >> *Hi Jeroen and David,* >> > > * >> > > * >> > > *I fixed it, use freedv_rawdatatx().* >> > > * >> > > * >> > > *Anyway, it compiles and needs testing.* >> > > * >> > > * >> > > *Can you look at my code please?* >> > > * >> > > * >> > > *Alan VK2ZIW* >> > > * >> > > * >> > > * >> > > * >> > > *On Sat, 20 Jun 2020 21:56:31 +0200, Jeroen Vreeken wrote* >> > > > Hi Al, >> > > > >> > > > Yes, my repeater code is available, >> (https://github.com/JeroenVreeken/eth_ar), but it might be a bit >> overkill as it implements everything needed for a mixed mode UHF >> repeater. (And is poorly documented) >> > > > But have a look if you get any usefull ideas from it. >> > > > >> > > > If you are targetting mode 700D for your setup the >> freedv_rawdata functions are probably the best match. >> > > > (freedv_datatx won't be usefull as 700D has no dedicated VHF >> data channel). >> > > > The only additional challenge you have is that you want to >> locally listen to it. >> > > > For that you can use the 'use_codecrx==1' snippet of >> freedv_mixed_rx.c as an example. >> > > > It basicly does the same thing: receive the 'raw' codec2 frames >> and decodes it to audio using codec2_decode. >> > > > >> > > > For you parrot repeater you just need one extra step: store the >> frames and send them again with freedv_rawdatatx() >> > > > >> > > > 73, >> > > > Jeroen PE1RXQ >> > > > >> > > > On 06/19/2020 01:52 AM, Al Beard wrote: >> > > > >>> *Hi Jeroen,* >>> > > > *> So what kind of 'data' do you want to repeat?* >>> > > > * >>> > > > * >>> > > > *First, the repeater will be on HF, 80m, 40m or 20m.* >>> > > > *Built already is a MST3 kit along with a Banana Pi M2 Berry >>> (Pi clone).* >>> > > > *(and a 500Gb spinning hard disk for storage)* >>> > > > * >>> > > > * >>> > > > *What 'data' ? Mode 700D, is what I expect is what most >>> activity is.* >>> > > > >>> > > > > An other thing they are usefull for are repeaters (like >>> yours and mine) where you want to re-transmit the incomming data >>> without loosing quality by passing through an decoder/encoder again. >>> > > > * >>> > > > * >>> > > > *I did not know you had "repeater" code.* >>> > > > * >>> > > > * >>> > > > *I'm not trying to reinvent the wheel, I'm wanting to >>> implement, build the said repeater.* >>> > > > * >>> > > > * >>> > > > *My reasoning in decoding to voice the received signal is, >>> when at the repeater site, it'd* >>> > > > *be great to be able to listen to the audio.* >>> > > > * >>> > > > * >>> > > > *So, is your "repeater" code available for me to implement.* >>> > > > * >>> > > > * >>> > > > *As mentioned, I'm not a "C" guru. I can "tinker".* >>> > > > * >>> > > > * >>> > > > *MRFE6S9160 (somewhat more useful than a >>> 73)* >>> > > > * >>> > > > * >>> > > > *Alan VK2ZIW* >>> > > > * >>> > > > * >>> > > > *On Thu, 18 Jun 2020 23:23:58 +0200, Jeroen Vreeken wrote* >>> > > > > Hi Al, >>> > > > > >>> > > > > You might be confused by the different types of 'data' we send. >>> > > > > A number of modes (2400A, 2400B, 800XA, 6000) have a >>> dedicated data channel (David sugested to call it the 'VHF data >>> channel'). When packets of data are transmitted with it a different >>> sync word is used on air and the freedv library will pass the >>> received packets to callback functions. (In case of freedv_mixed_rx >>> the function my_datarx()) >>> > > > > >>> > > > > If such a data frame is received the >>> freedv_rx/freedv_rawdatarx function will return zero to indicate >>> there was no voice payload. >>> > > > > >>> > > > > The other modes only have the 'voice' data channel (and a >>> few varicode text bits, which could also be called 'data'). >>> > > > > When the regular freedv_rx/freedv_tx functions are used it >>> will always contain codec2 or lpcnet frames. >>> > > > > The freedv_rawdatarx/freedv_rawdatarx work on the same data, >>> but allow you access the 'raw' bits that go into the actual modem >>> functions. >>> > > > > They are usefull if you want to send alternate data (or >>> alternate codecs), but there is no way the receiver 'knows' about this. >>> > > > > An other thing they are usefull for are repeaters (like >>> yours and mine) where you want to re-transmit the incomming data >>> without loosing quality by passing through an decoder/encoder again. >>> > > > > >>> > > > *> So what kind of 'data' do you want to repeat? >>> > > > > Is it the voice codec data? then receiving with >>> freedv_rawdatarx and sending with freedv_rawdatatx will do the trick >>> and can be triggered by varicode text. >>> > > > > Is it the 'VHF' data channel? then you can use callback >>> functions for the packets. To switch to the frames instead of voice >>> used freedv_datatx instead of the regular ones. >>> > > > > Whether 'data' wants to be repeated is indeed a good >>> question, the text like you used before could work, or in case of >>> the VHF data channel you could select based on the destination >>> address of a packet. (e.g. if it is the 'broadcast' address the >>> sender appearently wanted as many people to know as possible)* >>> > > > > >>> > > > > 73, >>> > > > > Jeroen PE1RXQ >>> > > > > >>> > > > > On 06/18/2020 01:46 PM, Al Beard wrote: >>> > > > > >>>> *Hi Jeroen,* >>>> > > > > *I've just looked at "freedv_mixed_rx.c" and it looks not >>>> to extract a data frame,* >>>> > > > > *only a codec2 frame or frames.* >>>> > > > > * >>>> > > > > * >>>> > > > > *In my proposed repeater, once triggered, I'd want to >>>> repeat data frames.* >>>> > > > > *Also, if only data frames are received, how do I determine >>>> that this data stream* >>>> > > > > *"wants" to be repeated?* >>>> > > > > * >>>> > > > > * >>>> > > > > *Alan VK2ZIW* >>>> > > > > * >>>> > > > > * >>>> > > > > *On Thu, 18 Jun 2020 16:34:25 +1000, Al Beard wrote* >>>> > > > > > *Hi again Jeroen,* >>>> > > > > > * >>>> > > > > > * >>>> > > > > > *In adding codec2_decode(c2, ...), I now need to add to >>>> /usr/local/include/codec2/* >>>> > > > > > *newamp2.h* >>>> > > > > > *newamp1**.h* >>>> > > > > > *kiss_fftr.h* >>>> > > > > > *kiss_fft.h* >>>> > > > > > *defines.h* >>>> > > > > > *codec2_fft.h* >>>> > > > > > *codec2_internal.h* >>>> > > > > > * >>>> > > > > > * >>>> > > > > > *and in the end, void codec2_decode() does not return how >>>> many samples* >>>> > > > > > *of audio it had decoded. So, if it were a data frame, it >>>> might return zero.* >>>> > > > > > * >>>> > > > > > * >>>> > > > > > *Still in progress. So far, it compiles, but not tested. * >>>> > > > > > * >>>> > > > > > * >>>> > > > > > *Alan VK2ZIW* >>>> > > > > > * >>>> > > > > >* >>>> > > > > >>>> > > > > --------------------------------------------------- >>>> > > > > Alan Beard >>>> > > > > >>>> > > > > OpenWebMail 2.53 >>>> > > > > >>>> > > > > >>>> > > > > >>>> >>>> > > > > >>>> > > > > >>>> >>>> > > > > >>>> _______________________________________________ >>>> Freetel-codec2 mailing >>>> >>>> list >>>> [email protected] >>>> https://lists.sourceforge.net/lists/listinfo/freetel-codec2 >>>> >>> >>> > > > >>> > > > --------------------------------------------------- >>> > > > Alan Beard >>> > > > >>> > > > OpenWebMail 2.53 >>> > > > >>> > > > >> >> > > >> > > --------------------------------------------------- >> > > Alan Beard >> > > >> > > OpenWebMail 2.53 >> > > >> > > > > > > > --------------------------------------------------- > > Alan VK2ZIW > > > > OpenWebMail 2.53, nothing in the cloud. > > > > > > > --------------------------------------------------- > Alan VK2ZIW > > OpenWebMail 2.53, nothing in the cloud. > > > > > > _______________________________________________ > Freetel-codec2 mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/freetel-codec2
_______________________________________________ Freetel-codec2 mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freetel-codec2
