OP25 on Ubuntu 20.04 - sockaudio problem

Status
Not open for further replies.

jm650

Newbie
Joined
Jun 29, 2016
Messages
4
Reaction score
2
Location
california
I am OP25 from Osmocom. I have applied the GR3.8 patch and I am starting OP25 like this,

Code:
./rx.py --nocrypt --args "rtl" --gains 'lna:36' -S 960000 -X -q 1 -v 0 -2 -V -U -T trunk.tsv -U -O plughw:2,0

and I get this error...


Code:
apps# tail -30f /tmp/outfile
This is free software, and you are welcome to redistribute it
under certain conditions; see the file ``LICENSE'' for details.
op25_audio::open_socket(): enabled udp host(127.0.0.1), wireshark(23456), audio(23456)
p25_frame_assembler_impl: do_imbe[1], do_output[0], do_audio_output[1], do_phase2_tdma[1]
Allocating 15 zero-copy buffers
__set_rx_from_osmosdr(): failed to set frequency
Using two-stage decimator for speed=960000, decim=10/4 if1=96000 if2=24000
added talkgroup 3405 from whitelist.txt
added talkgroup 3407 from whitelist.txt
added talkgroup 3606 from whitelist.txt
added talkgroup 3707 from whitelist.txt
added talkgroup 5503 from whitelist.txt
added talkgroup 6008 from whitelist.txt
added talkgroup 7455 from whitelist.txt
added talkgroup 7556 from whitelist.txt
added talkgroup 7605 from whitelist.txt
added talkgroup 7712 from whitelist.txt
added talkgroup 10005 from whitelist.txt
audio device: plughw:2,0
python version detected: 3.8.5 (default, May 27 2021, 13:30:53)
[GCC 9.3.0]
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/jason/src/op25/op25/gr-op25_repeater/apps/sockaudio.py", line 320, in run
    data_a = self.scale(data_a)
  File "/home/jason/src/op25/op25/gr-op25_repeater/apps/sockaudio.py", line 338, in scale
    pcm_r = struct.unpack('<h', next(iter_d, chr(0)) + next(iter_d, chr(0)))[0]
TypeError: a bytes-like object is required, not 'int'

There are multiple audio devices on the system. Each device throws back a different 'bytes like object' error. The the sound device on the motherboard throws this error, for example

Code:
audio device: plughw:1,0
python version detected: 3.8.5 (default, May 27 2021, 13:30:53)
[GCC 9.3.0]
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/jason/src/op25/op25/gr-op25_repeater/apps/sockaudio.py", line 296, in run
    flag_a = ord(in_a[0][0]) + (ord(in_a[0][1]) << 8)   # 16 bit little endian
TypeError: ord() expected string of length 1, but int found




Got any ideas?
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,712
Reaction score
1,113
Location
Talbot Co, MD
Did the patch apply properly without error?
I use basically the same patch in the boatbod version but have automated the build process a little more. Suggest you compare the versions of sockaudio.py from the two repos to see if there are differences which might account for the error.
 

awasser1

Member
Premium Subscriber
Joined
Jul 31, 2004
Messages
618
Reaction score
58
Location
Apache Jct, AZ
i see python 3.8.5 doesnt it only run on python 2.7? thats what mine says. I could be wrong. Im still learning

Alec
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,206
Reaction score
462
Location
NE Wisconsin
Here's the answer, at least on Intel hardware.

sudo nano /etc/modprobe.d/alsa-base.conf
Then at the following text, "options snd-hda-intel dmic_detect=0" (without the quotes) at the end of the file and save.

Similarly....

sudo nano /etc/modprobe.d/blacklist.conf
Add the following text, "blacklist snd_soc_skl" (without the quotes) at the end of the file and save.

Reboot Ubuntu, then retest rx.py with the (-U) option and you should now have sound with no more
errors in regard to sock audio.

Bill
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,206
Reaction score
462
Location
NE Wisconsin
Here's the answer, at least on Intel hardware.

sudo nano /etc/modprobe.d/alsa-base.conf
Then at the following text, "options snd-hda-intel dmic_detect=0" (without the quotes) at the end of the file and save.

Similarly....

sudo nano /etc/modprobe.d/blacklist.conf
Add the following text, "blacklist snd_soc_skl" (without the quotes) at the end of the file and save.

Reboot Ubuntu, then retest rx.py with the (-U) option and you should now have sound with no more
errors in regard to sock audio.

Bill

Update:

I built a new Ubuntu 20.04.2 VM this morning and did not have to apply the above edits to get sockaudio working. Perhaps this is due to updates over my previous build some time ago. I suggest sudo apt-get update && sudo apt-get upgrade -y before applying any fixes.


Bill
 
Status
Not open for further replies.
Top