diff --git a/WinRelease/hsmodem.exe b/WinRelease/hsmodem.exe index 147c1af..c71729f 100755 Binary files a/WinRelease/hsmodem.exe and b/WinRelease/hsmodem.exe differ diff --git a/WinRelease/oscardata.exe b/WinRelease/oscardata.exe index 291d103..c4979c8 100755 Binary files a/WinRelease/oscardata.exe and b/WinRelease/oscardata.exe differ diff --git a/hsmodem/Release/announcement.obj b/hsmodem/Release/announcement.obj index e76b20b..c5d368d 100755 Binary files a/hsmodem/Release/announcement.obj and b/hsmodem/Release/announcement.obj differ diff --git a/hsmodem/Release/codec2.obj b/hsmodem/Release/codec2.obj index c438c4c..a89f970 100755 Binary files a/hsmodem/Release/codec2.obj and b/hsmodem/Release/codec2.obj differ diff --git a/hsmodem/Release/constellation.obj b/hsmodem/Release/constellation.obj index e26331a..12d7607 100755 Binary files a/hsmodem/Release/constellation.obj and b/hsmodem/Release/constellation.obj differ diff --git a/hsmodem/Release/crc16.obj b/hsmodem/Release/crc16.obj index 615d8b5..9e1202b 100755 Binary files a/hsmodem/Release/crc16.obj and b/hsmodem/Release/crc16.obj differ diff --git a/hsmodem/Release/fec.obj b/hsmodem/Release/fec.obj index 4ccd97a..229f8d6 100755 Binary files a/hsmodem/Release/fec.obj and b/hsmodem/Release/fec.obj differ diff --git a/hsmodem/Release/fft.obj b/hsmodem/Release/fft.obj index 6083c26..a376fff 100755 Binary files a/hsmodem/Release/fft.obj and b/hsmodem/Release/fft.obj differ diff --git a/hsmodem/Release/fifo.obj b/hsmodem/Release/fifo.obj index ff18037..e91d07e 100755 Binary files a/hsmodem/Release/fifo.obj and b/hsmodem/Release/fifo.obj differ diff --git a/hsmodem/Release/fifo_voice.obj b/hsmodem/Release/fifo_voice.obj index af07891..24a0cf3 100755 Binary files a/hsmodem/Release/fifo_voice.obj and b/hsmodem/Release/fifo_voice.obj differ diff --git a/hsmodem/Release/frame_packer.obj b/hsmodem/Release/frame_packer.obj index d5c176a..3a326f5 100755 Binary files a/hsmodem/Release/frame_packer.obj and b/hsmodem/Release/frame_packer.obj differ diff --git a/hsmodem/Release/hsmodem.log b/hsmodem/Release/hsmodem.log index dd99036..f0fa945 100755 --- a/hsmodem/Release/hsmodem.log +++ b/hsmodem/Release/hsmodem.log @@ -1,7 +1 @@ - hsmodem.cpp - Code wird generiert. - 1 of 599 functions ( 0.2%) were compiled, the rest were copied from previous compilation. - 0 functions were new in current compilation - 1 functions had inline decision re-evaluated but remain unchanged - Codegenerierung ist abgeschlossen. - hsmodem.vcxproj -> E:\funk\hsmodem\hsmodem\..\WinRelease\hsmodem.exe + hsmodem.vcxproj -> E:\funk\hsmodem\hsmodem\..\WinRelease\hsmodem.exe diff --git a/hsmodem/Release/hsmodem.obj b/hsmodem/Release/hsmodem.obj index 1f3bce8..d4f57b6 100755 Binary files a/hsmodem/Release/hsmodem.obj and b/hsmodem/Release/hsmodem.obj differ diff --git a/hsmodem/Release/hsmodem.tlog/CL.command.1.tlog b/hsmodem/Release/hsmodem.tlog/CL.command.1.tlog index 7a8cdc0..e1e706d 100755 Binary files a/hsmodem/Release/hsmodem.tlog/CL.command.1.tlog and b/hsmodem/Release/hsmodem.tlog/CL.command.1.tlog differ diff --git a/hsmodem/Release/hsmodem.tlog/CL.read.1.tlog b/hsmodem/Release/hsmodem.tlog/CL.read.1.tlog index 46a481c..cbc30c4 100755 Binary files a/hsmodem/Release/hsmodem.tlog/CL.read.1.tlog and b/hsmodem/Release/hsmodem.tlog/CL.read.1.tlog differ diff --git a/hsmodem/Release/hsmodem.tlog/CL.write.1.tlog b/hsmodem/Release/hsmodem.tlog/CL.write.1.tlog index 91ff96a..39fb88e 100755 Binary files a/hsmodem/Release/hsmodem.tlog/CL.write.1.tlog and b/hsmodem/Release/hsmodem.tlog/CL.write.1.tlog differ diff --git a/hsmodem/Release/liquid_if.obj b/hsmodem/Release/liquid_if.obj index f7b40ad..a6ec5ee 100755 Binary files a/hsmodem/Release/liquid_if.obj and b/hsmodem/Release/liquid_if.obj differ diff --git a/hsmodem/Release/main_helper.obj b/hsmodem/Release/main_helper.obj index 301bd8d..13959d4 100755 Binary files a/hsmodem/Release/main_helper.obj and b/hsmodem/Release/main_helper.obj differ diff --git a/hsmodem/Release/scrambler.obj b/hsmodem/Release/scrambler.obj index c75b26a..a917911 100755 Binary files a/hsmodem/Release/scrambler.obj and b/hsmodem/Release/scrambler.obj differ diff --git a/hsmodem/Release/soundio.obj b/hsmodem/Release/soundio.obj index 2e9bd54..29c9d53 100755 Binary files a/hsmodem/Release/soundio.obj and b/hsmodem/Release/soundio.obj differ diff --git a/hsmodem/Release/speed.obj b/hsmodem/Release/speed.obj index b5b36dd..cadcd19 100755 Binary files a/hsmodem/Release/speed.obj and b/hsmodem/Release/speed.obj differ diff --git a/hsmodem/Release/symboltracker.obj b/hsmodem/Release/symboltracker.obj index 6b39de9..d9fc6fb 100755 Binary files a/hsmodem/Release/symboltracker.obj and b/hsmodem/Release/symboltracker.obj differ diff --git a/hsmodem/Release/udp.obj b/hsmodem/Release/udp.obj index e7f5277..80b4959 100755 Binary files a/hsmodem/Release/udp.obj and b/hsmodem/Release/udp.obj differ diff --git a/hsmodem/Release/vc140.pdb b/hsmodem/Release/vc140.pdb index 262d6e4..0cc524b 100755 Binary files a/hsmodem/Release/vc140.pdb and b/hsmodem/Release/vc140.pdb differ diff --git a/hsmodem/Release/voiceio.obj b/hsmodem/Release/voiceio.obj index 900b480..bb7ccea 100755 Binary files a/hsmodem/Release/voiceio.obj and b/hsmodem/Release/voiceio.obj differ diff --git a/hsmodem/Release/voiceprocessor.obj b/hsmodem/Release/voiceprocessor.obj index a0ee9c1..39e65a8 100755 Binary files a/hsmodem/Release/voiceprocessor.obj and b/hsmodem/Release/voiceprocessor.obj differ diff --git a/hsmodem/fft.cpp b/hsmodem/fft.cpp index 7d0de9d..75a70a8 100755 --- a/hsmodem/fft.cpp +++ b/hsmodem/fft.cpp @@ -135,7 +135,7 @@ uint16_t *make_waterfall(float fre, int *retlen) { if (sig == 1) { - //printf("===>>> level detected, reset modem\n"); + printf("===>>> level detected, reset modem\n"); trigger_resetmodem = 1; } } diff --git a/hsmodem/hsmodem.cpp b/hsmodem/hsmodem.cpp index 7d5b73f..0164ae6 100755 --- a/hsmodem/hsmodem.cpp +++ b/hsmodem/hsmodem.cpp @@ -249,8 +249,8 @@ int main(int argc, char* argv[]) } // demodulate incoming audio data stream - static int old_tm = 0; - int tm = getms(); + static uint64_t old_tm = 0; + uint64_t tm = getms(); if (tm >= (old_tm + 1000)) { // read Audio device list every 1s @@ -351,8 +351,8 @@ void io_setAudioDevices(uint8_t pbvol, uint8_t capvol, uint8_t announce, uint8_t // called from UDP RX thread for Broadcast-search from App void bc_rxdata(uint8_t* pdata, int len, struct sockaddr_in* rxsock) { - static int lastms = 0; // time of last received BC message - int actms = getms(); + static uint64_t lastms = 0; // time of last received BC message + uint64_t actms = getms(); if (len > 0 && pdata[0] == 0x3c) { @@ -383,7 +383,7 @@ void bc_rxdata(uint8_t* pdata, int len, struct sockaddr_in* rxsock) { // there was an appIP already // before accepting this new one, wait 3 seconds - int ts = actms - lastms; + int ts = (int)(actms - lastms); printf("new app IP: %s since %d, restarting modems\n", rxip,ts); if (ts < 3000) return; @@ -633,8 +633,8 @@ void toGR_sendData(uint8_t* data, int type, int status, int repeat) // called by liquid demodulator for received data void GRdata_rxdata(uint8_t* pdata, int len, struct sockaddr_in* rxsock) { - static int lasttime = -1; - static int triggertime = 0; + static int64_t lasttime = -1; + static uint64_t triggertime = 0; // raw symbols uint8_t* pl = unpack_data(pdata, len); @@ -665,43 +665,46 @@ void GRdata_rxdata(uint8_t* pdata, int len, struct sockaddr_in* rxsock) int bps = sr[speedmode].linespeed; // time for one frame [ms] int frmlen = UDPBLOCKLEN * 8; - int tmfrm_ms = (frmlen * 1000) / bps; + int tmfrm_ms = (frmlen * 1000) / bps; // ms for one frame - int acttm = getms(); + uint64_t acttm = getms(); if (lasttime == -1) { lasttime = acttm; return; } - int tdiff = (acttm - lasttime); //ms + int tdiff = (int)(acttm - lasttime); // elapsed time in ms int elapsed_frames = tdiff / tmfrm_ms; - //printf("difft:%d elfrm:%d\n", tdiff, elapsed_frames); + //if((tdiff%1000)==0) printf("elapsed time:%d frames:%d\n", tdiff, elapsed_frames); if (trigger_resetmodem == 1) { + // reset requested by FFT level detector trigger_resetmodem = 2; //printf("set triggertime\n"); - triggertime = getms(); + triggertime = acttm; } - if ((getms() - triggertime) > 1000 && trigger_resetmodem == 2) + if ((acttm - triggertime) > 1000 && trigger_resetmodem == 2) { - printf("signal detected, reset RX modem\n"); + // reset rx 1 second after level detection + //printf("reset RX modem, 1s since signal detection\n"); trigger_resetmodem = 0; rx_in_sync = 0; resetModem(); lasttime = acttm; } - if (tdiff > 5) + if (tdiff > 5000) { // in any case, only every 5s or longer + //printf("5s elapsed\n"); if (elapsed_frames > 2) { // reset modem if more than 2 frames have not been received trigger_resetmodem = 0; rx_in_sync = 0; - //printf("no signal detected, reset RX modem\n"); + printf("no signal detected, reset RX modem\n"); resetModem(); lasttime = acttm; } diff --git a/hsmodem/hsmodem.h b/hsmodem/hsmodem.h index 62274bf..f09687e 100755 --- a/hsmodem/hsmodem.h +++ b/hsmodem/hsmodem.h @@ -147,7 +147,7 @@ void setVolume_voice(int pbcap, int v); void sendAnnouncement(); void sleep_ms(int ms); -int getms(); +uint64_t getms(); void GRdata_rxdata(uint8_t* pdata, int len, struct sockaddr_in* rxsock); void toGR_sendData(uint8_t* data, int type, int status, int repeat); diff --git a/hsmodem/speed.cpp b/hsmodem/speed.cpp index 89f6d28..3bf40f6 100755 --- a/hsmodem/speed.cpp +++ b/hsmodem/speed.cpp @@ -31,26 +31,30 @@ int spdarr[MAXSPDARR]; int spdarrbps[MAXSPDARR]; #ifdef _LINUX_ -int getms() +uint64_t getms() { struct timeval tv; gettimeofday(&tv, NULL); uint64_t at = tv.tv_sec * 1000000 + tv.tv_usec; at = at / 1000; - return (int)at; + return at; } #endif #ifdef _WIN32_ -int getms() +uint64_t getms() { - int actms; + // get time in 100ns resolution + FILETIME ft_now; + GetSystemTimeAsFileTime(&ft_now); - SYSTEMTIME st; - GetSystemTime(&st); + // convert to full 64 bit time + uint64_t ll_now = (uint64_t)ft_now.dwLowDateTime + ((uint64_t)(ft_now.dwHighDateTime) << 32LL); - actms = st.wSecond * 1000 + (int)st.wMilliseconds; - return actms; + // convert to Milliseconds + ll_now /= (10 * 1000); // still needs 64 bit integer + + return ll_now; } #endif @@ -114,11 +118,11 @@ int meanvalbps(int v) // measures and calculates the speed in bit / s void measure_speed_syms(int len) { - static int lasttim = 0; + static uint64_t lasttim = 0; static int elems = 0; - int tim = getms(); - int timespan = tim - lasttim; + uint64_t tim = getms(); + int timespan = (int)(tim - lasttim); if(timespan < 0) { lasttim = tim; @@ -142,11 +146,11 @@ void measure_speed_syms(int len) void measure_speed_bps(int len) { - static int lasttim = 0; + static uint64_t lasttim = 0; static int elems = 0; - int tim = getms(); - int timespan = tim - lasttim; + uint64_t tim = getms(); + int timespan = (int)(tim - lasttim); if (timespan < 0) { lasttim = tim; diff --git a/hsmodemLinux/hsmodem b/hsmodemLinux/hsmodem index d5f7245..496e813 100755 Binary files a/hsmodemLinux/hsmodem and b/hsmodemLinux/hsmodem differ diff --git a/oscardata/oscardata/Form1.Designer.cs b/oscardata/oscardata/Form1.Designer.cs index b6cb624..ab7c312 100755 --- a/oscardata/oscardata/Form1.Designer.cs +++ b/oscardata/oscardata/Form1.Designer.cs @@ -118,6 +118,7 @@ this.cb_audioCAP = new System.Windows.Forms.ComboBox(); this.label4 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.lb_rec = new System.Windows.Forms.Label(); this.tb_recintro = new System.Windows.Forms.TextBox(); this.bt_astop = new System.Windows.Forms.Button(); this.bt_aplay = new System.Windows.Forms.Button(); @@ -148,7 +149,6 @@ this.progressBar_fifo = new oscardata.KmProgressBar(); this.vu_cap = new oscardata.KmProgressBar(); this.vu_pb = new oscardata.KmProgressBar(); - this.lb_rec = new System.Windows.Forms.Label(); this.statusStrip1.SuspendLayout(); this.tabPage_ber.SuspendLayout(); this.tabPage_image.SuspendLayout(); @@ -1202,6 +1202,17 @@ this.groupBox2.TabStop = false; this.groupBox2.Text = "Personal Settings"; // + // lb_rec + // + this.lb_rec.AutoSize = true; + this.lb_rec.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lb_rec.ForeColor = System.Drawing.Color.Red; + this.lb_rec.Location = new System.Drawing.Point(498, 101); + this.lb_rec.Name = "lb_rec"; + this.lb_rec.Size = new System.Drawing.Size(23, 13); + this.lb_rec.TabIndex = 29; + this.lb_rec.Text = "...."; + // // tb_recintro // this.tb_recintro.BackColor = System.Drawing.SystemColors.Control; @@ -1527,17 +1538,6 @@ this.vu_pb.Size = new System.Drawing.Size(100, 10); this.vu_pb.TabIndex = 19; // - // lb_rec - // - this.lb_rec.AutoSize = true; - this.lb_rec.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lb_rec.ForeColor = System.Drawing.Color.Red; - this.lb_rec.Location = new System.Drawing.Point(498, 101); - this.lb_rec.Name = "lb_rec"; - this.lb_rec.Size = new System.Drawing.Size(23, 13); - this.lb_rec.TabIndex = 29; - this.lb_rec.Text = "...."; - // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1562,7 +1562,7 @@ this.ForeColor = System.Drawing.SystemColors.ControlText; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Form1"; - this.Text = "AMSAT-DL Multimedia HS Modem V0.52 by DJ0ABR"; + this.Text = "AMSAT-DL Multimedia HS Modem V0.53 by DJ0ABR"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); diff --git a/oscardata/oscardata/Form1.resx b/oscardata/oscardata/Form1.resx index eab25bd..3ae742d 100755 --- a/oscardata/oscardata/Form1.resx +++ b/oscardata/oscardata/Form1.resx @@ -137,7 +137,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABw - FwAAAk1TRnQBSQFMAgEBDQEAAWgBBAFoAQQBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + FwAAAk1TRnQBSQFMAgEBDQEAAYABBAGAAQQBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAAUADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/oscardata/oscardata/bin/Release/oscardata.exe b/oscardata/oscardata/bin/Release/oscardata.exe index 291d103..c4979c8 100755 Binary files a/oscardata/oscardata/bin/Release/oscardata.exe and b/oscardata/oscardata/bin/Release/oscardata.exe differ diff --git a/oscardata/oscardata/udp.cs b/oscardata/oscardata/udp.cs index b09b07e..2b726c3 100755 --- a/oscardata/oscardata/udp.cs +++ b/oscardata/oscardata/udp.cs @@ -207,13 +207,14 @@ namespace oscardata gr.FillRectangle(bgcol, 0,0, panelw, panelh); // oscilloscope screen gr.DrawImage(new Bitmap(Properties.Resources.screen), 2, 1); + /* // screws at the 4 corners Bitmap screw = new Bitmap(Properties.Resources.schraube); gr.DrawImage(screw, 2, 2); gr.DrawImage(screw, panelw - 2-screw.Width, 2); gr.DrawImage(screw, 2, panelh - 2 - screw.Height); gr.DrawImage(screw, panelw - 2 - screw.Width, panelh - 2 - screw.Height); - + */ // draw constellation points for (int i = 0; i < sumidx; i++) { @@ -297,12 +298,14 @@ namespace oscardata gr.FillRectangle(bgcol, 0, 0, bm.Width, bm.Height); // scala gr.DrawImage(bmskala,16,2); + /* // screws at the 4 corners Bitmap screw = new Bitmap(Properties.Resources.schraube); gr.DrawImage(screw, 2, 2); gr.DrawImage(screw, 442 - 2 - screw.Width, 2); gr.DrawImage(screw, 2, 76 - 2 - screw.Height); gr.DrawImage(screw, 442 - 2 - screw.Width, 76 - 2 - screw.Height); + */ // spectrum int lastus = -1; // values