reticulum-meshchat icon indicating copy to clipboard operation
reticulum-meshchat copied to clipboard

LXST updates

Open markqvist opened this issue 5 months ago • 5 comments

Hi Liam. Got most of your request into the LXST 0.4.2 release :) Sorry for hijacking your issues, but figured it'd be convenient to have the info here if you're not on the matrix channel when I posted it.

Mute/unmute self, Mute/unmute remote

Done:

# On your Telephone instance:
telephone.mute_receive(self, mute=True)
telephone.unmute_receive(self, unmute=True)
telephone.mute_transmit(self, mute=True)
telephone.unmute_transmit(self, unmute=True)

Change outgoing audio codec during an active call (HQ or Codec2 etc)

Done:

# On your Telephone instance during an active call:
telephone.switch_profile(self, profile=Profiles.LOW_BANDWIDTH)

Fetch list of available mic/speaker devices

Done:

# Can be used as static methods on the class itself,
# or on an instantiated object
telephone.available_outputs()
telephone.available_inputs()

Change input microphone, Change output speakers

Use the set_microphone() and set_speaker() methods.

Callback when a call is rejected by the recipient, so UI can show "Call Declined"

Done, there are now separate callback setters for these events.

set_ended_callback(self, callback)
set_busy_callback(self, callback)
set_rejected_callback(self, callback)

Not sure if there's anything for "Call Dropped" or "Link Timeout" etc

I improved initial establishment timeout and handling in this version. It should be a lot more responsive now. Generally, if the call drops, you will receive the call_ended callback. There's still some stuff to do, to detect an active call that drops, right now it takes a long time before it gives up. Will have that improved in the next version.

Issue with volume, even with high MacOS/Android volume, call is quiet

Fixed across the board. You can now manually set gain for both receive and transmit, but I'll recommend leaving that totally alone, since there's now proper filtering and Automatic Gain Control implemented, so the Telephony primitive adjusts gain itself and targets a suitable level.

Issue using LXST on windows. pycodec2 complains about DLLs not found

Haven't been able to reproduce this here yet, pretty strange. I'll look into it more, but so far it's working OK here. Make sure you don't have some outdated versions of pycodec2 or other libs installed, earlier ones didn't come with the DLL, but the latest release does.

markqvist avatar Nov 24 '25 17:11 markqvist

I can't remember if I already mentioned it, but the mixer unmute bug was fixed and uploaded to a new build on pip. If you find anything else I haven't already fixed, let me know!

markqvist avatar Nov 26 '25 12:11 markqvist

Another point worth mentioning is echo cancellation. This is a relatively advanced filter to implement, and I need to write it in C for it to be fast enough. So I probably won't have it ready in time for you releasing an LXST-capable version of MeshChat, but it is coming as soon as I get the last little quirks with the windows audio driver worked out and such.

For now, LXST will have to rely on any build-in echo-cancellation in the OS audio pipeline, which is sometimes available, and sometimes not. This does lead to feedback / echo issues if both ends of the call are right next to each other, but it's not a major problem, since most of the time, people are far apart when calling ;)

Either way, I'll get it implemented natively as a filter in LXST as soon as I am able to, and let you know when it is ready!

markqvist avatar Nov 26 '25 12:11 markqvist

Sweet, just had a quick look. Only thing I noticed was __receive_muted wasn't used? My assumption is I could still do the same thing, but for received audio instead, where I mute received audio, and the remote side could change audio profile, leading to my side all of a sudden blasting sound again. Or maybe that commit wasn't synced there yet? ;)

liamcottle avatar Nov 26 '25 12:11 liamcottle

Uuh, let me just check if I actually synced it...

markqvist avatar Nov 26 '25 13:11 markqvist

Ah, I get it now. Read your message too quickly and assumed you'd tried it out, and it actually did unmute the receive side as well, so I was going over the code scratching my head trying to figure out how that might happen.

But no, the receive mixer is never re-created on codec profile switching, since the the LinkSource handles each incoming packet individually and detects and reacts to codec changes before sending it to the receive mixer. So the state is persisted on the receive mixer object throughout the call.

I just put the __receive_muted property there in case it might be needed in the future, and so it was consistent.

markqvist avatar Nov 26 '25 13:11 markqvist