linhpsdr stuttering tx audio

187 views
Skip to first unread message

Matthew

unread,
Jan 31, 2020, 11:11:12 AM1/31/20
to Hermes-Lite
Stuttering tx audio has previously been reported with linhpsdr/HL2. see https://groups.google.com/d/msg/hermes-lite/UQNZ5C7kaUc/uBtId-kNAwAJ

I have been back through previous HL2 gateware and confirm this problem appears in 20190907 Release (67). Can anyone else confirm prior builds of HL2 gateway do not cause this stuttering tx audio with linhpsdr?

73 Matthew M5EVT.


Alan Hopper

unread,
Jan 31, 2020, 11:29:59 AM1/31/20
to Hermes-Lite
Hi Matthew,
sorry I've not got any useful linhpsdr data on this but the hl2 tx buffer code did get tweaked around this time, it possibly made life harder for software but made the latency far more predictable, the more recent releases have a tx buffer level fed back which might be useful in diagnosing the problem.
73 Alan M0NNB

Jonas Sanamon

unread,
Jan 31, 2020, 2:47:19 PM1/31/20
to Matthew, Hermes-Lite
Hi,

I have tested LinHPSDR also with my Hermes Lite (1) with gateware from late 2016, with exactly the same results == stuttering.

Best Regards,
Jonas


--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hermes-lite/d1dee1eb-12cc-486c-b249-a482fa2ada89%40googlegroups.com.

Steve Haynal

unread,
Jan 31, 2020, 10:39:41 PM1/31/20
to Hermes-Lite
Hi Matthew,

Did you find a version of the gateware *without* stuttering. If so, let me know and I will see what changed.

I think the fork of pihpsdr has the stuttering fixed according to Graeme. Maybe that patch can be ported to linhpsdr.

I don't think there is anything in the HL2 gateware which makes the HL2 any more sensitive than other openhpsdr radios. Do people see this stuttering with other openhpsdr radios and linhpsdr?

73,

Steve
kf7o

Matthew

unread,
Feb 2, 2020, 12:21:10 PM2/2/20
to Hermes-Lite
I started with what I considered a stable test case, linhpsdr commit: https://github.com/g0orx/linhpsdr/commit/ab35f4caf417dbcf703c5a0210cfea0bd3a86e78 if anyone wants to repeat these tests. I recommend using this commit.

I started by going back to HL2 gateware 20190412 from here:

https://github.com/softerhardware/Hermes-Lite2/tree/master/gateware/bitfiles/archive

I was using Ethernet direct from laptop to HL2, no router involved. My setup was to transmit audio in AM mode (on 1.8 MHz) into a dummy load and monitor on a separate receiver. I could hear no stuttering on the separate receiver.

Next I went to HL2 gateware 20190616. No stuttering. Then I put on 20190907. I could hear stuttering.

I went back to HL2 20190616, then went to the latest commit of linhpsdr:

https://github.com/g0orx/linhpsdr/commit/a8aa9e517ac8a1583b771383d090b3b389ed5a8c

This stutters and has the tx audio at the wrong sample rate. I have a fix for the wrong sample rate issue:

https://github.com/g0orx/linhpsdr/pull/48

The stuttering remains. I am sure Alan's clue is the path to success. This should be fixable.

There are still some audio/GUI crashes (https://github.com/g0orx/linhpsdr/issues/43) that need fixing before these later commits are usable. I am working on this.

73 Matthew M5EVT.

Steve Haynal

unread,
Feb 3, 2020, 12:46:56 AM2/3/20
to Hermes-Lite
Hi Matthew,

Do I understand correctly that with an older stable version of linhpsdr there is no TX stuttering with 20190616 but TX stuttering with 20190907? I can look for any gateware changes that might cause or be related to this between those two versions. Can you file an issue on github?

73,

Steve
kf7o

Matthew

unread,
Feb 3, 2020, 2:48:10 PM2/3/20
to Hermes-Lite
That is correct Steve. I think the problem lies in linhpsdr and I will aim to fix this. I have made some progress already.

Provided no existing SDR software supporting Hermes (and hence HL2) exhibits this problem, I suggest no gateware changes are needed. Nonetheless, I will file an issue on github.

73 Matthew M5EVT.

Matthew

unread,
Feb 7, 2020, 3:12:14 PM2/7/20
to Hermes-Lite
I would be interested if anyone could comment on pihpsdr and this audio problem on transmit (I don't have an rpi >rpi1). This would need to be with HL2 gateware dated 20190907 or more recent. As far as I can tell from the source, the pihpsdr C code is similar to linhpsdr. Tx packets are not synchronised to the rx packets in linhpsdr. I've fiddled with software audio buffers in linhpsdr, but can't get something acceptable. I am trying to re-write to synchronise tx packets with the rx packets and make TX packets more consistent in the time they are sent, but this isn't as simple as I first thought. However, I am persisting with this.

I don't think anyone ever got to a version of cusdr with transmit, but looking wireshark, I also see tx packets are not synchronised with rx packets. As a result I can see some gaps between tx packets (from SDR software) of 23-25 ms (this is on a wired network connect between HL2 and PC).

73 Matthew M5EVT.

Chris

unread,
Feb 7, 2020, 6:34:15 PM2/7/20
to Matthew, Hermes-Lite
Hi Matthew -

I have the same problem in linhpsdr, but pihpsdr works fine on an rpi3 and 4 with gateware 2020011.  Hope that helps!

Chris - AG5RR

--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.

Graeme Jury

unread,
Feb 7, 2020, 7:44:16 PM2/7/20
to herme...@googlegroups.com
Hello Matthew,

It is the same in my case, linhpsdr stutters for me but pihpsdr does not. I do find that pihpsdr will sometimes give a couple of stutters when first keyed and then settles. Quisk is still the most stable and reliable Linux software for HL2 and the digital features of SparkSDR make it the best choice for me for whisper.

73, Graeme ZL2APV

Matthew

unread,
Feb 8, 2020, 3:53:03 AM2/8/20
to Hermes-Lite
Thanks for info.

Without too much code change, the following commit is a reasonable fix that works ok for me (there are still occasional glitches):


But I am not too happy with how robust this approach is and would like to improve upon it.

73 Matthew M5EVT.

Joe LB1HI

unread,
Feb 8, 2020, 8:42:11 AM2/8/20
to Hermes-Lite
Hi,
Quisk even works successfully on the ARM64 processor architecture. S922X. OS Ubuntu Mate.

73, Jozef lb1hi


On Saturday, February 8, 2020 at 1:44:16 AM UTC+1, Graeme Jury wrote:
Hello Matthew,

It is the same in my case, linhpsdr stutters for me but pihpsdr does not. I do find that pihpsdr will sometimes give a couple of stutters when first keyed and then settles. Quisk is still the most stable and reliable Linux software for HL2 and the digital features of SparkSDR make it the best choice for me for whisper.

73, Graeme ZL2APV

On 8/02/20 12:34 pm, Chris wrote:
Hi Matthew -

I have the same problem in linhpsdr, but pihpsdr works fine on an rpi3 and 4 with gateware 2020011.  Hope that helps!

Chris - AG5RR

On Fri, Feb 7, 2020 at 2:12 PM Matthew <bal...@gmail.com> wrote:
I would be interested if anyone could comment on pihpsdr and this audio problem on transmit (I don't have an rpi >rpi1). This would need to be with HL2 gateware dated 20190907 or more recent. As far as I can tell from the source, the pihpsdr C code is similar to linhpsdr. Tx packets are not synchronised to the rx packets in linhpsdr. I've fiddled with software audio buffers in linhpsdr, but can't get something acceptable. I am trying to re-write to synchronise tx packets with the rx packets and make TX packets more consistent in the time they are sent, but this isn't as simple as I first thought. However, I am persisting with this.

I don't think anyone ever got to a version of cusdr with transmit, but looking wireshark, I also see tx packets are not synchronised with rx packets. As a result I can see some gaps between tx packets (from SDR software) of 23-25 ms (this is on a wired network connect between HL2 and PC).

73 Matthew M5EVT.
--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to herme...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to herme...@googlegroups.com.

Roger Critchlow

unread,
Feb 8, 2020, 10:56:22 AM2/8/20
to Hermes-Lite
Oh, that's right, Melton used pulse-audio on linhpsdr so he could use it as virtual audio cables.  Just watched the Friedrichshafen video a week or two ago.  So the pihpsdr audio goes direct through alsa, but all the linhpsdr audio goes indirect through pulse.

The TX stuttering may not be a problem with linhpsdr or the hermes-lite, it could be entirely in the pulse-audio configuration.


-- rec -- ad5dz --



To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hermes-lite/198c8870-abe5-4232-8364-049449f6c05e%40googlegroups.com.

Matthew

unread,
Feb 8, 2020, 12:05:58 PM2/8/20
to Hermes-Lite
I will try and summarise my findings.

Linhpsdr tx packets are not synchronised with the rx packets. The pulseaudio buffer feeds the microphone buffer, the microphone buffer feeds the iq buffer. If left to work out what is best, pulseaudio seems to collect up a stream and dump in one go. This will be to reduce glitches. The payment is latency. Linhpsdr receives one of these dumps and there is a rush of tx packets. Then around 25 ms with nothing (on my PC). In a more recent HL2 gateware update the tx buffer became sensitive to jitter between tx packets. In the commit I reference above, I have tried to reduce the time between pulse audio buffer dumps into linhpsdr. I have added a verbose output in linhpsdr to alert when the tx buffer underflows/overflows. This is still happening infrequently. I would like to stop linhpsdr sending, say, 5 tx packets in a very short space of time. I think synchronising with the rx packet makes sense for this. This requires a fair bit of rework. I've got something working, but it needs more work. This will make linhpsdr much less sensitive to audio issues I think, then the user has to do less tweaking/fiddling with linux audio.

The later versions of linhpsdr can support alsa, pulseaudio and through soundio, jack too. I've mostly used pulseaudio, I suggest linux users stick with pulseaudio rather than soundio or alsa for now.

I've added temperature display, corrected the power display and fixed the SWR display:


I welcome feedback on these changes and would like to know if anyone still has tx audio problems.

73 Matthew M5EVT.

Steve Haynal

unread,
Feb 8, 2020, 1:40:13 PM2/8/20
to Hermes-Lite
Hi Matthew,

Thanks for all your work on this. I've been looking at Wireshark data from PowerSDR and linhpsdr this week too while working on CWX. I also noticed that both of these programs send a group of TX packets all at once. For example, at 48kHz I see 8 TX packets and then ~16 RX packets from PowerSDR. Quisk and Spark will send 1 TX packet for 2 RX packets. Each packet represents 2*63*(1.0/48000)=2.6ms of time. So 8 packets is ~21ms of data which could overflow the HL2 buffer as it is 42ms deep and tries to run half full all the time. But I would then expect to see this in PowerSDR too. I'm changing the way I do the TX buffering to work better with CWX. This will avoid the potential ~21ms of data sent when the 42ms buffer is half full problem. I'll send you a beta gateware to try soon.


Are you sure that Linhpsdr is not synchronizing TX and RX packets, maybe at some higher ratio?

Linhpsdr seems to interleave TX and RX packets better at higher sampling rates. Do you see the same stuttering at 96, 192 and 384 kHz? With multiple receivers open?

I saw the jack option with soundio when I recompiled Linhpsdr the other day. The jack backend is not working for me but I haven't debugged much. Does anyone have the jack backend working?


73,

Steve
kf7o

Graeme Jury

unread,
Feb 8, 2020, 3:56:53 PM2/8/20
to herme...@googlegroups.com
Hi Matthew,

Thanks for all the work that you are doing on this. I can confirm that your changes have fixed the pulsing and it is working very well for me. The temperature display is working 100% but I do not have a bridge installed at present so cannot comment on power and SWR. I notice that when opening the config screen and altering a setting it mostly freezes for a few seconds although the spectrogram and spectragram sometimes are working as is the sound. Might be something on my system and I will investigate further but I raise it in case some other testers have the same issue.

Mni tnx es 73, Graeme ZL2APV
--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.

Matthew

unread,
Feb 8, 2020, 4:53:47 PM2/8/20
to Hermes-Lite
Glad to hear this fix works for you.

The config screens glitch has been on my to do list. It could completely crash when clicking on an rx or tx tab. I think I have fixed it in this commit:


73 Matthew M5EVT.

Chris Moore

unread,
Feb 8, 2020, 5:04:36 PM2/8/20
to Matthew, Hermes-Lite
Working well for me also Matthew -  (running on a Pi4).  Thanks for the great work.

Sent from my iPhone

On Feb 8, 2020, at 3:53 PM, Matthew <bal...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.

Graeme Jury

unread,
Feb 9, 2020, 4:04:53 AM2/9/20
to herme...@googlegroups.com
Wow Matthew that is really impressive. All the config screen glitches have gone and the radio seems to be working well. I see others are reporting good results too so the software is progressing well. A slider for the LNA gain would be a good step but I am not sure of how it would integrate. I have an 80 M  regular sked in the morning and the guys I regularly chat to will be able to comment on how my signal compares. With Quisk I run 12 dB of compression on my audio which is not an option with linHPSDR so their comments will be interesting.

73, Graeme ZL2APV
--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages