OP25 Setting up op25 to stream to broadcastify

Status
Not open for further replies.

faff29

Member
Joined
Jul 30, 2008
Messages
51
Location
Eastlake, OH
I am currently getting the below error when running ./rx.py --args 'rtl' -N 'LNA:47' -M meta.json -S 2500000 -f 855.8625e6 -o 17e3 -O loop0 -T trunk.tsv -V -2 -U 2> stderr-stream0.2

DarkIce 1.3 live audio streamer, Google Code Archive - Long-term storage for Google Code Project Hosting.

Copyright (c) 2000-2007, Tyrell Hungary, Tyrell Hungary Corporation

Copyright (c) 2008-2013, Akos Maroy and Rafael Diniz

This is free software, and you are welcome to redistribute it

under the terms of The GNU General Public License version 3 or

any later version.



Using config file: darkice-stream0.cfg

Using ALSA DSP input device: loop0

Using POSIX real-time scheduling, priority 4

ALSA lib pcm_dsnoop.c:583:(snd_pcm_dsnoop_open) unable to create IPC semaphore

DarkIce: DarkIce.cpp:1273: can't open connector [0]
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,392
Location
Talbot Co, MD
I am currently getting the below error when running ./rx.py --args 'rtl' -N 'LNA:47' -M meta.json -S 2500000 -f 855.8625e6 -o 17e3 -O loop0 -T trunk.tsv -V -2 -U 2> stderr-stream0.2

DarkIce 1.3 live audio streamer, Google Code Archive - Long-term storage for Google Code Project Hosting.

Copyright (c) 2000-2007, Tyrell Hungary, Tyrell Hungary Corporation

Copyright (c) 2008-2013, Akos Maroy and Rafael Diniz

This is free software, and you are welcome to redistribute it

under the terms of The GNU General Public License version 3 or

any later version.



Using config file: darkice-stream0.cfg

Using ALSA DSP input device: loop0

Using POSIX real-time scheduling, priority 4

ALSA lib pcm_dsnoop.c:583:(snd_pcm_dsnoop_open) unable to create IPC semaphore

DarkIce: DarkIce.cpp:1273: can't open connector [0]
Permissions problem.
Are you running darkice as a user or as root? You'll likely need to do it as root.
 

monorailmedic

Member
Feed Provider
Joined
Oct 15, 2015
Messages
19
I used this post to get set up and running a few months back and all was well (on a Pi 3B+). Now I am getting the following error:
Code:
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
failed to open audio device: loop0
audio closing

I went back through the instructions in the thread again and everything seems just as it was, just as it should be. My Linux knowledge is rough (that's perhaps being kind), and I'm a bit stuck.

Anything I should be looking for?
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,392
Location
Talbot Co, MD
I used this post to get set up and running a few months back and all was well (on a Pi 3B+). Now I am getting the following error:
Code:
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
failed to open audio device: loop0
audio closing

I went back through the instructions in the thread again and everything seems just as it was, just as it should be. My Linux knowledge is rough (that's perhaps being kind), and I'm a bit stuck.

Anything I should be looking for?
For the most part we've given up using aloop and darkice as a streaming methodology in preference for liquidsoap. That said, if the 'loop0' device isn't able to be opened it's probably because the aloop kernel module did not load at boot or the /etc/asound.conf file does not have an appropriate configuration.
 

monorailmedic

Member
Feed Provider
Joined
Oct 15, 2015
Messages
19
For the most part we've given up using aloop and darkice as a streaming methodology in preference for liquidsoap.
That'll give me something else to research. My hope would just be to fix this since it had been working fine, but options are good.

That said, if the 'loop0' device isn't able to be opened it's probably because the aloop kernel module did not load at boot or the /etc/asound.conf file does not have an appropriate configuration.
My Linux knowledge is garbage. I searched but am clearly missing something as far as establishing if the kernel module is loading.
The asound.conf is exactly as it was in the instructions when things worked.

What confuses me is how to even debug. Based on the below error I was hoping to find some file named pcm_hw.c so I could see what is on line 1822, but I can't seem to get that far.
Code:
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
 

monorailmedic

Member
Feed Provider
Joined
Oct 15, 2015
Messages
19
Running 'sudo modprobe snd-aloop' resulted in:
modprobe: ERROR: could not insert 'snd_aloop': No such device

Not sure which device it's referring to.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,392
Location
Talbot Co, MD
Running 'sudo modprobe snd-aloop' resulted in:
modprobe: ERROR: could not insert 'snd_aloop': No such device

Not sure which device it's referring to.
Assuming your machine has Intel HDA audio hardware, if your create a text file called "/etc/modprobe.d/hda_intel.conf" and enter the following command in it you should find that snd-aloop gets loaded at next reboot.
Code:
softdep snd-hda-intel post: snd-aloop
 

monorailmedic

Member
Feed Provider
Joined
Oct 15, 2015
Messages
19
Assuming your machine has Intel HDA audio hardware, if your create a text file called "/etc/modprobe.d/hda_intel.conf" and enter the following command in it you should find that snd-aloop gets loaded at next reboot.
Code:
softdep snd-hda-intel post: snd-aloop

The HW is a Pi 3B+, which I'm pretty sure uses the bcm2835 chip. I added that config file just in case and rebooted, but as expected the problem remains. :-/
 

monorailmedic

Member
Feed Provider
Joined
Oct 15, 2015
Messages
19
You have to change "snd-hda-intel" to whatever driver name the Rpi3 uses, but the concept is similar.
Right right, which I've had in place since the start (including when things were working). Specifically...

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

boatbod

Member
Joined
Mar 3, 2007
Messages
3,392
Location
Talbot Co, MD
Right right, which I've had in place since the start (including when things were working). Specifically...

/etc/modprobe.d/bcm2835.conf
oftdep snd-bcm2835 post: snd-aloop options snd-aloop enable=1 index=1 pcm_substreams=2
cat /proc/modules | grep 'aloop'
(to see if it's loaded)
 

monorailmedic

Member
Feed Provider
Joined
Oct 15, 2015
Messages
19
cat /proc/modules | grep 'aloop' returns nothing. no error, just moves on to the next line in the terminal
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,392
Location
Talbot Co, MD
cat /proc/modules | grep 'aloop' returns nothing. no error, just moves on to the next line in the terminal
That confirms the snd-aloop driver has not loaded, which is why your loopback device doesn't work.
I assume you did a kernel upgrade somewhere along the way and the new kernel either did not come with the snd-aloop module or it isn't being loaded.

At this point you'll have to trust me that setting up liquidsoap is way less effort and more reliable than continuing to troubleshoot the darkice method of streaming. There is a reason we moved away from that as the recommended way of doing things.
 

monorailmedic

Member
Feed Provider
Joined
Oct 15, 2015
Messages
19
First off @boatbod big thanks for your help with this. I had to step away (life got in the way a bit) but logged back in tonight to look into liquidsoap.

I disabled the darkice service (not using that anymore), took the -o parameter off my op.25 script and added -w. I followed the readme file for liquidsoap (in the op25 folder), including putting my broadcastify info into the op25.liq file (incl uncommenting out that line) and setup new services.

I thought I'd be in good shape, but I'm clearly missing something. Despite this it doesn't seem as if it's trying to connect to broadcastify (or if it is, I'm seeing no evidence of that in my logfile or in my broadcastify dash).

What I do note in my logs is the absence of any reference to connecting to a streaming server. In other posts I see people with logs that contain something like:
streaming server url="http://audio9.broadcastify.com:80/xcjkdywvz0f2.m3u" <--- not mine, just an example

It seems like inclusion of -w should start the audio service and the stream - but it's as if that part is never happening.

I've attached an example of my logs and my startup script is below.
Code:
./rx.py --args 'rtl' --gains 'lna:16' -q-1 -S 2400000 -o 25000 --gain=50 -l http:0.0.0.0:1234 -2 -v 2 -w -T trunk.tsv 2> -V -x 2 2> stderr-stream0.2

I have a hunch I am missing something REAL simple here and would appreciate any ideas on where to look.
 

Attachments

  • op25log1.txt
    1.6 KB · Views: 8

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
982
Location
NE Wisconsin
Your rx.py command line is incorrect. Try the example below as a starting point, then adust PPM compensation and LNA gain to obtain
reliable trunk signaling blocks (TSBK's) count as shown at the top of the curses terminal.

./rx.py --args 'rtl' --gains 'lna:49' -T trunk.tsv -q 0 -S 1000000 -D cqpsk -2 -V -w -l http:0.0.0.0:1234 2> sdterr-stream0.2

he above ordering of arguments isn't critical following the intial ./rx.py except that the redirect to standard out (2> xxxxx) needs to
be placed at the end of the command line. The (-w) sends audio via UDP to the looparound (Wireshark) adpater where it is received by
liquidsoap's input line of your op25.liq file containing "./audio.py -s")).

I would suggest that your first concentrate on getting op25 running well before you enable the streaming output in liqidsoap to your
BCFY moun point assignment. Feel free to post your op25.liq file for assistance, but please blank out the mountpoint and password assignments from pubic view.

Bill
 

monorailmedic

Member
Feed Provider
Joined
Oct 15, 2015
Messages
19
I would suggest that your first concentrate on getting op25 running well before you enable the streaming output in liquidsoap to your
BCFY moun point assignment. Feel free to post your op25.liq file for assistance, but please blank out the mountpoint and password assignments from pubic view.

Thanks for your reply Bill. I've been successfully decoding for months (in fact I'm watching activity in the web interface for OP25 on my other display as I type this). I'm no expert at all (quite the opposite), but point this out to say that my challenge at this point is just getting the stream to Broadcastify. I'd been doing that using darkice for a while, but it looks like a kernel update resulted in my system not loading snd-aloop so that stopped working. That (combined with an unrelated SDR issue) has had me off the air for a bit, and now I'm trying to start back up, adapting my setup (previously using darkice and aloop) to using liquidsoap.

So, that gets us to the core issue - which is why liquidsoap isn't connecting to Broadcastify. I've attached a copy of my op25.liq file (with some info redacted). Note that I did try assembling the URL manually (in case the other parameters weren't being properly parsed) and putting into that param value, but it didn't make any difference so I backed it out. I also tried removing the forward slash ahead of the mount string to no avail. Perhaps most puzzling is that I don't get any errors that seem relevant, which has left me repeatedly checking to see if I failed to uncomment the icecast output line :) - I'm just waiting for the "aha!" moment. I also checked audio.py but I don't think I set anything there when initially configuring darkice (for the previous setup) and nothing within that file jumps out at me for any other reason.

I appreciate your time and input.
 

Attachments

  • op25_redacted.txt
    1.7 KB · Views: 16

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
982
Location
NE Wisconsin
monorailmedic,

Admittedly, I haven't read all of your posts. However, in looking at your op25.liq script, and without the benifit of having seen your error log,
I am confident the issue with liquidsoap is aborting at startup is because of an incompatability between liquidosap and the underlying Linux sound system.

Edit your op25.liq script and simply comment out (#) the reference to local audio output, save, and restart liquidosap.

# LOCAL AUDIO OUTPUT
# Uncomment the appropriate line below to enable local sound
#
# Default audio subsystem
#out (input)
#
# PulseAudio
#output.pulseaudio(input)
#
# ALSA
#output.alsa(input)

If you desire to have local audio support from the headphone jack on your Raspberry Pi and assumming that your MicroSD was immaged with Raspbian Buster, you'll need to perform the following additonal steps.

(1) Run crontab (crontab -e) then insert "@reboot pulseaudio --start" to the end of the file.
(2) Edit op25.liq and uncoment "output.pulseaudio(input)" then reboot the system.

Upon the restart the cron process will start pulseaudio and liquisoap will load and start with local audio support in additon to steaming
your auido to BCFY.

Bill
 

monorailmedic

Member
Feed Provider
Joined
Oct 15, 2015
Messages
19
I am confident the issue with liquidsoap is aborting at startup is because of an incompatability between liquidosap and the underlying Linux sound system.

Edit your op25.liq script and simply comment out (#) the reference to local audio output, save, and restart liquidosap.

That was it, thanks!

So as someone that is very bad with Linux (as I seem to only use it every six months when something somewhere breaks), where could I have seen indication of this failure? I set the log level to 3 op25.liq but then realized that in /var/log/liquidsoap there is no log, and I don't see an operator that let's me specify a log output for op25.liq.

I do see that log.file was set to false (in op25.liq), but changing that to true seems to make it fail...and of course I can't see why.

In short - working now, thanks! How can I enable (or find) log outputs for op25.liq in the event I need it in the future?
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,392
Location
Talbot Co, MD
where could I have seen indication of this failure? I set the log level to 3 op25.liq but then realized that in /var/log/liquidsoap there is no log, and I don't see an operator that let's me specify a log output for op25.liq.
Yup, this is why I was suggesting running the op25.liq script from a terminal window where it could printed the log to the screen.

From a general unix/linux standpoint you will probably get logging to /var/log/syslog unless you configure things differently.
 
Status
Not open for further replies.
Top