OP25 Setting up op25 to stream to broadcastify

Status
Not open for further replies.

boatbod

Member
Joined
Mar 3, 2007
Messages
3,409
Location
Talbot Co, MD
Dont think I'm following you there, or there's a miscommunication somewhere.
I'm currently streaming several of the talk groups on our p25ph2 system to a single feed, and it's quite busy.
Rather than split them on completely seperate streams, I'd like to be able to have two instances of op25 running (One for the Leo's and the other for fire) and put both of those on one stream but in seperate (L/R) channels.

I was under the impression that broadcastify feeds are mono not stereo? I guess what you describe would work if you run your own ices server.
 
Joined
Oct 8, 2005
Messages
46
Location
Metro Atlanta
I had this running just fine in the past but when I recently tried listening, I got no audio, which led me down the path of figuring out what was wrong. Darkice is running fine (and feeding IceCast2), but when I check the op25 service, I get the following output. Anyone know what coudl be wrong?


op25-stream0.service - cobbp25
Loaded: loaded (/etc/systemd/system/op25-stream0.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2019-02-15 06:34:00 EST; 22ms ago
Process: 4669 ExecStart=/bin/bash -- op25-stream0.sh (code=exited, status=139)
Main PID: 4669 (code=exited, status=139)

Feb 15 06:34:00 raspberrypi systemd[1]: op25-stream0.service: Unit entered failed state.
Feb 15 06:34:00 raspberrypi systemd[1]: op25-stream0.service: Failed with result 'exit-code'.




for reference, here is the contents of the op25-stream0.sh:

./rx.py --args 'rtl' -N 'LNA:47' -S 2400000 -f 857.2125e6 -o 25000 -T trunk.tsv -V -2 -U 2> stderr.2 -O loop0 -l http:127.0.0.1:8080
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,409
Location
Talbot Co, MD
I had this running just fine in the past but when I recently tried listening, I got no audio, which led me down the path of figuring out what was wrong. Darkice is running fine (and feeding IceCast2), but when I check the op25 service, I get the following output. Anyone know what coudl be wrong?


op25-stream0.service - cobbp25
Loaded: loaded (/etc/systemd/system/op25-stream0.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2019-02-15 06:34:00 EST; 22ms ago
Process: 4669 ExecStart=/bin/bash -- op25-stream0.sh (code=exited, status=139)
Main PID: 4669 (code=exited, status=139)

Feb 15 06:34:00 raspberrypi systemd[1]: op25-stream0.service: Unit entered failed state.
Feb 15 06:34:00 raspberrypi systemd[1]: op25-stream0.service: Failed with result 'exit-code'.




for reference, here is the contents of the op25-stream0.sh:

./rx.py --args 'rtl' -N 'LNA:47' -S 2400000 -f 857.2125e6 -o 25000 -T trunk.tsv -V -2 -U 2> stderr.2 -O loop0 -l http:127.0.0.1:8080

One obvious issue is that you have placed several command line options after stderr redirection ("2> ...") which is not correct. The 2> stderr.2 redirection must come at the very end.

Other than that, there is insufficient information to determine why op25 quit. I recommend making the change above, re-running, then examine the stderr.2 log for clues about the error.
 
Joined
Oct 8, 2005
Messages
46
Location
Metro Atlanta
Thanks, changed it to:

./rx.py --args 'rtl' -N 'LNA:47' -S 2400000 -f 857.2125e6 -o 25000 -T trunk.tsv -V -2 -U -O loop0 -l http:127.0.0.1:8080 2> stderr.2


When I run the above, it gives me a segmentation fault.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,409
Location
Talbot Co, MD
Thanks, changed it to:

./rx.py --args 'rtl' -N 'LNA:47' -S 2400000 -f 857.2125e6 -o 25000 -T trunk.tsv -V -2 -U -O loop0 -l http:127.0.0.1:8080 2> stderr.2


When I run the above, it gives me a segmentation fault.

Recommend you rebuild and reinstall op25:
Code:
cd ~/op25/build
rm -rf *
cmake ../
make
sudo make install

I'd also recommend you reduce your sample size to something less close to the RTL maximum. There's really no need to run it wide open like that. Suggest "-S 960000".
 
Joined
Oct 8, 2005
Messages
46
Location
Metro Atlanta
Recommend you rebuild and reinstall op25:
Code:
cd ~/op25/build
rm -rf *
cmake ../
make
sudo make install

I'd also recommend you reduce your sample size to something less close to the RTL maximum. There's really no need to run it wide open like that. Suggest "-S 960000".


at cmake, I get:

cmake: error while loading shared libraries: /usr/lib/arm-linux-gnueabihf/librtmp.so.1: invalid ELF header
 

treycash

Member
Joined
Mar 30, 2011
Messages
10
Location
NC
My script file or the rx.py will not run with the following (What am I am I doing wrong?):

#1 /bin/sh

/home/pi/op25/op25/gr_op25_repeater/apps

./rx.py -args 'rtl' -N 'LNA: 47' -S 2400000 -f 853.6125e6 -o loop0 -T trunk.tsv -V -2 -U 2> stderr-stream0.2
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,409
Location
Talbot Co, MD
My script file or the rx.py will not run with the following (What am I am I doing wrong?):

#1 /bin/sh

/home/pi/op25/op25/gr_op25_repeater/apps

./rx.py -args 'rtl' -N 'LNA: 47' -S 2400000 -f 853.6125e6 -o loop0 -T trunk.tsv -V -2 -U 2> stderr-stream0.2

First problem is the typo on line 1.
#!/bin/sh

Second problem is the missing 'cd' command on line 3.
cd /home/pi/op25/op25/gr_op25_repeater/apps

Third problem is incorrect specification of audio output device on line 5.
./rx.py -args 'rtl' -N 'LNA: 47' -S 2400000 -f 853.6125e6 -O loop0 -T trunk.tsv -V -2 -U 2> stderr-stream0.2

The rest of the rx.py command looks ok-ish, but I can't help wishing people wouldn't unnecessarily use such a large sample size. It's not needed for normal functionality and can degrade performance of some RTL & CPU hardware types. I suggest either "-S 960000" or "-S 1440000". Note: the "-f" parameter is unnecessary if you have a properly configured trunk.tsv.
 

treycash

Member
Joined
Mar 30, 2011
Messages
10
Location
NC
The rest of the rx.py command looks ok-ish, but I can't help wishing people wouldn't unnecessarily use such a large sample size. It's not needed for normal functionality and can degrade performance of some RTL & CPU hardware types. I suggest either "-S 960000" or "-S 1440000". Note: the "-f" parameter is unnecessary if you have a properly configured trunk.tsv.[/QUOTE]

Thank you! What sample size should I use? I was just using the code found on another website. I am just a novice trying to figure it out.
 

brad2388

Member
Feed Provider
Joined
May 3, 2019
Messages
52
Location
Climax, NC
is the raspberry pi 3 b+ fast enough to stream to broadcastify? is there specific instructions on how to set it up?

i ahve op25 running pretty well now thru the headphone jack. but want to send it to broadcastify and hopefully the headphone jack at the same time.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,409
Location
Talbot Co, MD
is the raspberry pi 3 b+ fast enough to stream to broadcastify? is there specific instructions on how to set it up?

i ahve op25 running pretty well now thru the headphone jack. but want to send it to broadcastify and hopefully the headphone jack at the same time.

Just about fast enough, provided you set the sample rate nice and small and avoid running any of the gui plots or anything else on the machine.
See ~/op25/README-rpi3-liquidsoap
 
Joined
Jul 1, 2019
Messages
1
Location
Vernon Hills, IL
Note: Opening up this slightly dead thread. I'm not using op25; I want to simply stream all audio coming out of my Raspberry Pi to Icecast through DarkIce.

@boatbod I'm trying to wrap my head around "loopbacks". Currently, I just want a simple setup to stream any audio coming out of my raspberry pi 3b+. I've gotten icecast2 and DarkIce all up and running, however, when I tried using your ~.asoundrc files, I get no sound from my stream. I know my DarkIce and Icecast is correct for other setups, such as, streaming from a "microphone input". I've tried researching everywhere, but I can't find a proper tutorial about streaming the main audio with loopbacks. Can you guide me? My files are a bit around the place, so bear with me:
darkice.cfg
Code:
[general]
duration        = 0      # duration in s, 0 forever
bufferSecs      = 1      # buffer, in seconds
reconnect       = yes    # reconnect if disconnected
 
[input]
device          = loop0 # Soundcard device for the audio input
sampleRate      = 44100   # sample rate 11025, 22050 or 44100
bitsPerSample   = 16      # bits
channel         = 2       # 2 = stereo

[icecast2-0]
bitrateMode     = cbr       # variable bit rate (`cbr' constant, `abr' average)
quality         = 0.8       # 1.0 is best quality
format          = mp3       # format. Choose `vorbis' for OGG Vorbis
bitrate         = 2048       # bitrate
server          = localhost # or IP
port            = 8000      # port for IceCast2 access
password        = hackme    # source password to the IceCast2 server
mountPoint      = mystream.mp3  # mount point on the IceCast2 server .mp3 $
name            = mystream

darkice.sh
Code:
#!/bin/bash
sudo /usr/bin/darkice -c /home/pi/darkice.cfg

/etc/modules
Code:
i2c-dev

crontab
Code:
@reboot sleep 15 && sudo /home/pi/darkice.sh

/etc/modprobe.d/bcm2835.conf
Code:
oftdep snd-bcm2835 post: snd-aloop
options snd-aloop enable=1 index=1 pcm_substreams=2

/etc/asound.conf
Code:
# output device
pcm.loopout0 {
  type plug
  slave.pcm "hw:Loopback,0,0"
}

# input device
pcm.loopin0 {
  type dsnoop
  ipc_key 686592
  slave.pcm "hw:Loopback,1,0"
}

# duplex plug device
pcm.loop0 {
  type plug
  slave {
    pcm {
      type asym
      playback.pcm "loopout0"
      capture.pcm "loopin0"
    }
  }
}

# output device
pcm.loopout1 {
  type plug
  slave.pcm "hw:Loopback,0,1"
}

# input device
pcm.loopin1 {
  type dsnoop
  ipc_key 686593
  slave.pcm "hw:Loopback,1,1"
}

# duplex plug device
pcm.loop1 {
  type plug
  slave {
    pcm {
      type asym
      playback.pcm "loopout1"
      capture.pcm "loopin1"
    }
  }
}
Oh yeah, Thanks for posting your findings/research :)
 

BigRedBox80

Member
Feed Provider
Joined
Apr 23, 2015
Messages
170
I'm having troubles getting my loop device to work properly, not sure what I'm missing. Using Ubuntu 18 on a Dell PC.

Code:
audio device: loop0
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
failed to open audio device: loop0

My asound.conf looks just like all the tutorials, what am I missing?
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,409
Location
Talbot Co, MD
I'm having troubles getting my loop device to work properly, not sure what I'm missing. Using Ubuntu 18 on a Dell PC.

Code:
audio device: loop0
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
failed to open audio device: loop0

My asound.conf looks just like all the tutorials, what am I missing?
Did you load the kernel module "snd-aloop" at boot? Assuming your system has an Intel HDA audio subsystem you can cause it to be loaded by making it a dependency. Just create the file hda-intel.conf in the /etc/modprobe.d/ directory with the following content:

e.g. cat /etc/modprobe.d/hda-intel.conf

Code:
softdep snd-hda-intel post: snd-aloop
options snd-aloop enable=1 index=1 pcm_substreams=1
 

BigRedBox80

Member
Feed Provider
Joined
Apr 23, 2015
Messages
170
Did you load the kernel module "snd-aloop" at boot? Assuming your system has an Intel HDA audio subsystem you can cause it to be loaded by making it a dependency. Just create the file hda-intel.conf in the /etc/modprobe.d/ directory with the following content:

e.g. cat /etc/modprobe.d/hda-intel.conf

Code:
softdep snd-hda-intel post: snd-aloop
options snd-aloop enable=1 index=1 pcm_substreams=1

I think that did it for that, thanks!

Code:
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], do_nocrypt[0]
metadata update not enabled
audio device: loop0
Allocating 15 zero-copy buffers

Now I'm getting this on my DarkIce, investigating this.
Code:
Using config file: /etc/darkice-stream0.cfg
Using ALSA DSP input device: loop0
Using POSIX real-time scheduling, priority 4
DarkIce: VorbisLibEncoder.cpp:194: vorbis encode init error [1]
 

BigRedBox80

Member
Feed Provider
Joined
Apr 23, 2015
Messages
170
Now I'm getting this on my DarkIce, investigating this.
Code:
Using config file: /etc/darkice-stream0.cfg
Using ALSA DSP input device: loop0
Using POSIX real-time scheduling, priority 4
DarkIce: VorbisLibEncoder.cpp:194: vorbis encode init error [1]

Fixed by changing format to MP3 like it should have been.
 

james18211

Member
Joined
Oct 28, 2012
Messages
25
Is there any way to pipe the output from op25 to a remote syslog rather than the separate log files? I'd like to setup a way to be alerted to issues with my feeds rather than having to manually check that they're still getting data blocks.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,409
Location
Talbot Co, MD
Is there any way to pipe the output from op25 to a remote syslog rather than the separate log files? I'd like to setup a way to be alerted to issues with my feeds rather than having to manually check that they're still getting data blocks.

The op25 code presently only logs to stderr so you would need to redirect stderr to syslog. A cursory search yields a suggestion to use the "logger" command. Redirecting standard output to syslog
 
Status
Not open for further replies.
Top