Time shift on wsjtx

First of all I would like to congratulate and thank the programming team for this fantastic app they offer to the ham radio community. I use a PC as a server of the IC-7300, and a Mac-book pro as a client. On the Mac the applications that are interconnected with excellent results are wsjtx which shares logging data plus CAT with RumLog NG from which I control through TRX Control (ICOM IC-7300-Ctrl), the transceiver and all its functions, having also run the WF of RumLog. The setup has been tested both on a local and an external internet network with excellent results. Its only weak point is the time shifting, which is founded when downloading the wsjtx the audio data, and which is constantly this time shifting growing so that it does not wsjtx decode after a few minutes due to out timing, and it is necessary to refresh the client to calibrate time. Is there any way to reduce this continuous time shifting by any way? Thank you all for any advice.

you mean that the time skews on the mac?

Exactly. About 0.5 sec at 10 min.

you can enable ntpdate to keep time in sync

Thank you George. The problem comes from audio. The time is correct in wsjtx. The audio comes with delay from server and it is not in sync with the time of 15sec period. This delay grows over time and the calls not decoded after a while.

Hi Chris,

What method do you use to pass the audio from wfview to wsjt-x?

de W6EL

Hi Elliott
Screenshot 2022-12-08 at 00.17.29

Screenshot 2022-12-08 at 00.18.35
In server the usual for ic-7300 USB in and OUT.

Hi Chris,

What sample rate is configured in Soundflower? And what sample rate is used by wfview?

Can you see them all to 48k just in case this is a factor?

de W6EL

Hi again Elliott
As far as I know soundflower doesn’t do any conversion on the stream. It simply transfers a stream from one source to another input. And it doesn’t intervene by changing it. After all, it has no setting for changing the bit rate. I think this also happens with the input of wsjtx, since there is no option to change the bit-rate either, except for the source, which in this case is the bit rate coming from the wfview server and the USB audio output from the ic-7300 and I have chosen the 16bit 48,000 Hz from the Windows sound properties. The streaming i think stay the same in in bit-rate at all way from source to wsjtx input.

Thank you for answers
Chris SV1HEP

Hi Chris,

Are you 100% sure the clock on the computer is not the issue?

What order do you open the programs? I would guess that, if soundflower is similar to the loopback device in linux, the first client to use it sets the sample rate and format.

I think wsjt-x uses 48k internally if I recall.

de W6EL

Hi Elliott
I don’t have a problem with the computer clock because when I connect the ic-7300 directly to it there is no problem. I have determined that the audio is delayed and this results in it sitting at the wrong time which is fixed as it is set by the computer clock. It is a delay in the sound which over time lags behind the fixed time period. When I refresh the client it comes with a difference of 0.2 sec and after half an hour it can have a delay of up to 2 sec. The order in which applications are opened is as follows. First the server, then the client and then wsjtx. During startup, I have, as I described, a difference of 0.2 0.3 sec max and then I see what the photo shows to make it easier to understand. This differences happen in just a few minutes as you can see in DT table. Starts with drift 0.2 0.3 sec and then goes to 0.5 0.6 and 0.7 in some cases.
Screenshot 2022-12-08 at 02.11.51
Screenshot 2022-12-08 at 02.15.40
Thank you for your patience on this

Hi Chris,

This is all very interesting to me.

The only way to introduce more and more delay would be to have a mismatch in sample rate and to not realize this and keep the packets rolling at the same rate. But this would only be maintainable if the buffer was getting larger and larger.

Do you have any errors in the wfview log (press the Log button)?

2 seconds of delay should be audible, for example, if you tune into an AM broadcast station or WWV and compare with a second receiver. Do you observe the delay with a listening comparison? Can we pin the delay on the wfview audio stream and eliminate soundflower?

de W6EL

The only thing I haven’t done is try with another laptop with windows 10 the process. There is no soundflower or anything else and it remains to be seen if this is the cause of this situation, because on the Macbook there is no other way for wsjtx to work. In a test that I have done in usb mode there is any time delay of these sizes of 1 sec is not noticeable as you imagine. Only in wsjtx can it be seen since there are strict times. I will test with the second computer tomorrow and report back with the results. I attach part of the log for reference. Thank you for everything Elliott

Hi Chris,

Yeah you are having some packet drops or something.

You might want to try these codecs (change them at the client side prior to connecting):

  • uLaw 8-bit
  • Opus

uLaw 8-bit is, of course, half the size of the 16-bit packets. The uLaw encoding restores a lot of the fidelity lost in a standard linear 8-bit encoding. Opus, on the other hand, is a 4x-5x reduction in bandwidth over the 16 bit PCM, and the lower bandwidth requirement may help with the packet loss.

It may also be worth trying the lower sample rates. I generally use 16 KHz, which still has more audio bandwidth (about 8 KHz worth) than most radio receivers, including the 7300. This will introduce more sample rate conversion, but if the SR conversion isn’t the issue then this could help more with the network bandwidth, if that is part of the problem.

de W6EL

Hello Elliott hello everyone.
After the advice to change the audio protocols, I tried various combinations from the Server and the Client in all bit-rates without significant differences.
I also noticed that after a lot of data flow such as band noise the log showed that it has lost many packets of information, and immediately after looking at the wsjtx I could see the incoming audio delay increasing.

This pic shows the next audio data out of time when the packet lost detected before
Screenshot 2022-12-08 at 12.27.47

Eventually I found out that I had a parameter maybe wrong using the IP and the port that there was no reason to load with control data and audio. In the wsjtx connection, I used the port of the server and not of the client. This may have had a negative effect on the audio data transfer.
Screenshot 2022-12-08 at 15.44.36

Screenshot 2022-12-08 at 15.45.12

I made the changes and found an improvement but not the ultimate solution to the issue. Something is obviously wrong with the amount of information in UDP maybe.
I am not able to know how much data can be transferred via UDP on an internal network, or if there is a WiFi problem since the client is connected via WiFi. Anyway, it’s not a serious problem and I’ll leave it as it is.
I will try in to another PC not MAC the client to see what happens.
Thanks for taking the time to read my messages.

Hi Chris.

Looking at your log, it appears that packets are arriving out-of-order, this will cause various issues to wfview. The only situation that I have seen this happening is when people are using wireless/powerline extenders or mesh wifi networks. Can you describe your network infra-structure? Streaming UDP requires stable network connectivity and this generally means good quality CAT5e (or better) wired connectivity between all points or a good quality wireless access point (not mesh)

73 Phil M0VSE

Hi Phil
My network doesn’t have any complexity. The computer that I use as a server is connected to the router via WiFi and the computer that works as a client is also connected to the same router and in the same room with very good WiFi coverage without channel noise. No bad cables no firewall or proxy intervenes between them, and the data rate with speed test is very high. After all, there are no problems in transferring a large amount of data, such as viewing videos on both computers via the Internet without interruptions in the flow or any kind of lags in video or audio.
I have also set the IP addresses of the two computers on the router as static to avoid changes with DHCP. I have also opened ports 50001-50003 on the router for an external connection and I connect normally using the IP of the provider. If there is something I have done wrong and the connection is losing packets, any suggestions are welcome.
Thank you for the great work you and the rest team of this project.
Chris SV1HEP

could d you skip wifi and use a wired connection to rule out wifi?

Yes. I’ll try it with a wired connection as well and Ι get back with the results.

1 Like