boatbod
Member
Using nc | aplay setup at moment, but will definitely try your changes later.
Anyway, verbosity level 10, stderr output and some source code reading helped me to pin down the problem.
From what I see, phase1 and phase2 decoders each using a separate UDP connection, so first decoded audio grabs the nc UDP port, making it unable to receive another phase audio packets. So you either hear every p1 or every p2 conversation, on a first-come first-serve basis.. Perhaps sockaudio.py is handling connections differently, will take a look.
You are correct that p25p1_fdma and p25p2_tdma separately open their own UDP sockets, but the protocol is by it's nature connectionless so there shouldn't be any downsides of doing that since the receiving app will neither know nor care where the data originated.
boatbod, I've downloaded and built your changes, had to manually merge your rx.py code with some latest git changes though.
Both phase1 and phase2 audio works now, no more UDP problems, so sockaudio.py its definitely more robust and comfortable way to listen. Thank you for your work, good job! Hope your code get pushed to official git repository soon.
The primary difference in logical handling between nc | aplay and sockaudio is that the latter knows when to flush the pcm stream at the end of a transmission. In itself this shouldn't really change the handling of intermingled Ph1 and Ph2 transmissions, but the new code you are running also has subtle changes to the trunking logic to keep the radio tuned to a given phase 2 audio frequency during MAC_HANGTIME until the repeater notifies MAC_END_PTT. This allows more stable listening in cases where back to back chatter occurs on a given TGID on the same voice channel. Previously you'd see numerous re-tunes to the control channel and back again every time a subscriber released the PTT, even if momentarily prior to reacquiring. Practically it seems to add about 1-2 sec silence at the end of a conversation (depending on repeater configuration) but the overall listening experience is better. Unfortunately there is no equivalent Ph1 capability, so that re-tunes immediately on receipt of DUID3 or DUID15.