OP25 OP25 Value error when running ./rx.py

Status
Not open for further replies.

Falcon4

Member
Joined
May 5, 2017
Messages
117
Location
West Chester,PA
Hello everyone its been a while. So sometime last year my lovely wife threw out my working RPI4 running OP25 flawlessly running liquidsoap the whole 9. I finally got another Pi, No,I didn't get a divorce :D Anyways, I'm getting a weird value error and I'm thinking it has to do with the NAC I'm trying to monitor being "00A"? Here's what I got:

File "/home/falcon4/op25/op25/gr-op25_repeater/apps/helper_funcs.py", line 156, in read_tsv_file
key_val = int(fields[key], 0)
ValueError: invalid literal for int() with base 0: '00a'

Any help would be appreciated. I hoping I can get this running again with not too much pain because the more roadblocks I encounter the more I think about calling my laywer :cool:
 

Falcon4

Member
Joined
May 5, 2017
Messages
117
Location
West Chester,PA
Sorry, for the delayed response got really busy at work. Well ,figured out my rx.py issue my NAC was incorrect in my trunk file. Now that I moved past that i'm in the dreaded no audio phase of the build. Last time I built it I remember it magically working one day after just letting in run. I went back and read a lot of my old threads after all that I should've just copied my SD card to a file somewhere just in case. I'll definitley do that this time around.

For some strange reason my Do_Audio_output is reading [0] no matter what I try. -O,-O alsa , -O Pulse. Ran a test .wav can hear that loud and clear. Here's my Stderr.2 and my Rx.Py/

GNU nano 5.4 stderr.2
Using Python /usr/bin/python3
gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.8.2.0
built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy airspyhf soapy redpitaya f>
Using device #0 Nooelec NESDR SMArt v5 SN: 00000001
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
gain: name: LNA range: start 0 stop 0 step 0
setting gain lna to 35
supported sample rates 250000-2560000 step 24000
[R82XX] PLL not locked!
Using two-stage decimator for speed=288000, decim=6/2 if1=48000 if2=24000
p25_frame_assembler_impl: do_imbe[0], do_output[0], do_audio_output[0], do_phase2_tdma[1], do_nocrypt[0]
metadata update not enabled
python version detected: 3.9.2 (default, Mar 12 2021, 04:06:34)
[GCC 10.2.1 20210110]
Allocating 15 zero-copy buffers
Flowgraph completed. Exiting

./rx.py --args 'rtl' --gains 'lna:35' --phase2-tdma -T trunk.tsv -S 288000 -O 2> stderr.2

Thank you again, Got another long week of work ahead of me.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,411
Location
Talbot Co, MD
./rx.py --args 'rtl' --gains 'lna:35' --phase2-tdma -T trunk.tsv -S 288000 -O 2> stderr.2
The -O command line option requires a parameter, so the command line you quoted is incorrect as written. I'd suggest simply removing the -O and leaving op25 to use the default audio device as that works most of the time. The other common option would be "-O pulse" to force the use of Pulse Audio (rather than ALSA).

Also, you can lower your sample rate to save some CPU. There is no real advantage to sampling a wider bandwidth than the minimum for any given sdr device. e.g. for an RTL use "-S 1e6" or "-S 1000000"
 

Falcon4

Member
Joined
May 5, 2017
Messages
117
Location
West Chester,PA
The -O command line option requires a parameter, so the command line you quoted is incorrect as written. I'd suggest simply removing the -O and leaving op25 to use the default audio device as that works most of the time. The other common option would be "-O pulse" to force the use of Pulse Audio (rather than ALSA).

Also, you can lower your sample rate to save some CPU. There is no real advantage to sampling a wider bandwidth than the minimum for any given sdr device. e.g. for an RTL use "-S 1e6" or "-S 1000000"
Tried -O pulse,removed the -O parameter, no audio. Minimized the sampling rate. I played test audio using the $ aplay command and heard it so my thought process its not a pi issue. I'm still getting do_audio_output [0] in my stderr.2.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,411
Location
Talbot Co, MD
Eureka!! Thank you! I feel like an idiot how could I have missed "enable built-in UDP audio player" total face palm on my part. Hahah on to the next part of the build...liquid soap. Again thank you!
Hint: when you implement liquidsoap you'll need to remove the "-U" parameter ;)
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,029
Location
NE Wisconsin
Hint: when you implement liquidsoap you'll need to remove the "-U" parameter ;)
And add the "-w" and "-V" parameters. Just a heads-up, you may experience difficulties with Liquidsoap that will depend upon the
version of Raspbian OS used to image your Raspberry Pi. Specifically, the Desktop (GUI) versions install pulseaudio by default that can
be problematic for headless operation whereby Liquidsoap has been configured to run as a system service.

Don't let that discourage you, just come back if you run into any problems and we'll help you out.
 
Last edited:

Falcon4

Member
Joined
May 5, 2017
Messages
117
Location
West Chester,PA
Ok, so back at it again. I'm pretty sure I configured my meta.json,op25.liq and my icecast.xml. I tried to follow the readme rpi3-liquidsoap. In there in instructs to install liquidsoap to "sudo apt-get install liquidsoap liquidsoap-plugin-all". However, when I did that it said that "liquidsoap-plugin-all" is not available. I used "Sudo apt-get install liquidsoap" but now I'm getting an error:

falcon4@raspberrypi:~/op25/op25/gr-op25_repeater/apps $ ./op25.liq
2023/08/06 15:11:57 >>> LOG START
2023/08/06 15:11:57 [main:3] Liquidsoap 1.4.3
2023/08/06 15:11:57 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=[unspecified] sedlex=2.2 menhirLib=20201216 dtools=0.4.2 duppy=0.8.0 cry=0.6.5 mm=0.5.0 xmlplaylist=0.1.5 lastfm=0.3.2 ogg=0.5.2 vorbis=0.7.1 opus=0.1.3 speex=0.2.1 mad=0.4.6 flac=0.1.7 flac.ogg=0.1.7 dynlink=[distributed with Ocaml] lame=0.3.4 shine=0.2.1 gstreamer=0.3.0 frei0r=0.1.1 theora=0.3.1 gavl=0.1.6 ffmpeg=0.4.3 bjack=0.1.5 alsa=0.3.0 ao=0.2.1 samplerate=0.1.4 taglib=0.3.6 ssl=0.5.9 magic=0.7.3 camomile=[unspecified] inotify=2.3 yojson=[unspecified] faad=0.4.0 soundtouch=0.1.8 portaudio=0.2.1 pulseaudio=0.1.3 ladspa=0.1.5 sdl=0.9.1 camlimages=4.2.6 lo=0.1.2 gd=1.0a5
2023/08/06 15:11:57 [gstreamer.loader:3] Loaded GStreamer 1.18.4 0
2023/08/06 15:11:57 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder

Am I missing an encoder that was in the "plugin all" package?
 

Falcon4

Member
Joined
May 5, 2017
Messages
117
Location
West Chester,PA
You don't need the fdkaac encoder so the warning can be ignored.
So it's safe to say something isn't right with my files I'll have to go over them again. Reason why I say that is because that is the last line I see and im not logging anything.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,411
Location
Talbot Co, MD
So it's safe to say something isn't right with my files I'll have to go over them again. Reason why I say that is because that is the last line I see and im not logging anything.
You might have to play around with these parameters in the .liq script
Code:
set("log.stdout", true)
set("log.file", false)
set("log.level", 1)
In particular the log.level likely needs to be 3 or higher to be useful.
 

Falcon4

Member
Joined
May 5, 2017
Messages
117
Location
West Chester,PA
I'm back at it again today after a 2 month hiatus. I got it running but now I'm trying to stream it. Looks like I got part way there. Time to get this done especially after an escaped convict was on the loose
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,029
Location
NE Wisconsin
I got it running but now I'm trying to stream it. Looks like I got part way there.

Questions:

Are you looking to setup a private stream for your own use or will you need to configure a public stream such as feeding BCFY?
Will you need to retain local headphone (speaker) audio?
What Raspbian image did you use to flash your Raspberry Pi-4? IE: Lite or one of the two Desktop (GUI) versions?
Do you desire to run op25 and liquidsoap automatically as system services?
 

Falcon4

Member
Joined
May 5, 2017
Messages
117
Location
West Chester,PA
Raspian image: Raspberry Gnu/Linux 11 (bullseye) desktop version
I'm trying to have it for personal use. No need for headphone jack. It would be nice to have local audio as well but not a deal-breaker. I don't need to run them headless or automatically.

Thank you!!
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,029
Location
NE Wisconsin
Did you install Icecast and configure op25.liq to push op25's audio as an mp3 stream to Icecast? If so, post your op25.liq file
and be sure to redact the password field from the output.icecast line(s).
 
Last edited:

Falcon4

Member
Joined
May 5, 2017
Messages
117
Location
West Chester,PA
ever seen this before?

falcon4@raspberrypi:~/op25/op25/gr-op25_repeater/apps $ ./op25.liq
bash: ./op25.liq: /usr/bin/liquidsoap: bad interpreter: No such file or directory

but wait there's more

falcon4@raspberrypi:~/op25/op25/gr-op25_repeater/apps $ ls
5-sdr_hw.rules log_ts.py p25_conventional_example.json sdrhw_removed.sh
audio.py meta.json p25_decoder.py setTrunkFreq.sh
cces.tsv multi_rx.py p25_demodulator_dev.py smartnet_example.json
cfg.json nyseg.tsv p25_demodulator.py sockaudio.py
cfgtrunk.py onondaga.tsv p25_rtl_example.json stderr.2
CMakeLists.txt ontario.tsv p25_rtl_example.sh tdma
corr op25_iqsrc.py __pycache__ terminal.py
dmr_airspy_example.json op25.liq README tk_p25.py
dmr_rtl_example.json op25-liq.service README-analog tk_smartnet.py
example_keys.json op25_nbfm.py README-configuration tk_trbo.py
example_liquidsoap.liq op25_python README-dmr tompkins.tsv
gr_gnuplot.py op25-rx.service README-metadata trunking.py
helper_funcs.py op25.sh README-op25_stats trunk.tsv
http_server.py op25_stats.sh README-smartnet tx
icemeta.py op25_wavsrc.py rms_agc.py util
iq_example.json p25_airspy_example.json rx.py wav_example.json

:LOL::LOL::LOL:


Boom goes the dynamite:poop: 3rd time today. I have two SD cards that I just keep rotating. If i remember the last time correctly i just kept doing it over and over again until it magically worked. This time around once I get this running i'm going to clone the sd card about 5 times and make a youtube video for the masses. Hell, in the meantime I might livestream it. I think people would find humor in my pain. I keep telling myself I did this less than 2 years ago and its even more painful this time around.

Now that I got my rant out the way I think once I understand the connection between meta.json,op25.liq, and icecast.xml and what purpose they serve it'll make more sense to me. I'm going to approach it tomorrow AM with a less is more ideology. Keep simple passwords make the mountpoint the letter z or something simple. Now I know icecast.xml is the server op25.liq configures it? and meta.json tells rx.py where to look? please correct me if I'm wrong.

Thank you for all your help and patience with me. I've always been a fit a square piece into a round hole kind of kid and no I'm not going to buy a sds100 like everyone else even though I feel like buying one off the mrs. budget for sending me down this road again.

Until tomorrow
Falcon4

PS I am going to livestream it got a new camera coming tomorrow if I'm going to get beat to death im going to have fun in the process :ROFLMAO:
 

a417

Active Member
Joined
Mar 14, 2004
Messages
4,669
Do you have a shebang line?
9 out of 10 times the issue is a malformed / incorrect shebang...like you passed it something it can't do, or isn't valid.

Code:
#!/usr/bin/liquidsoap
is that the first line of whatever script you are trying to run?
 
Status
Not open for further replies.
Top