OK... I've put my RPi3B+ to work...
Raspbian Image, updated, fully loaded.. (NOT NOOBS, this is just Raspbian Full )
Run through the install setup for OP25 from:
https://www.hagensieker.com/wordpress/2018/07/17/op25-for-dummies/
Did this for my reclaimed laptop and this Pi...
OP25 working on both... Local audio good on both. Tracks the PII system I need to put under review...
So that works good..
The problem is feeding audio to my IceCast server.. :( :( :(
I installed a MP3 capable Darkice with its deps... its starts up fine.. The feed appears on my server
I am using the info at https://www.hagensieker.com/wordpress/2018/07/20/op25-raspberry-pi-streaming...
I created /etc/asound.conf and /etc/modprobe.d/bcm2835.conf
I rebooted the Pi rather than any reloading of things, to ensure that loopback created and loaded etc...
For the ALSA Loopback etc. info and setup.....
so is the ALSA loopback setup????
/darkice $ cat /proc/modules | grep snd snd_aloop 24576 0 - Live 0x7f3a6000 snd_bcm2835 32768 1 - Live 0x7f399000 (C)
Check! Pi audio and ALSA loopback... CHECK CHECK!
snd_pcm 98304 2 snd_aloop,snd_bcm2835, Live 0x7f138000 snd_timer 32768 1 snd_pcm, Live 0x7f11d000 snd 69632 6 snd_aloop,snd_bcm2835,snd_pcm,snd_timer, Live 0x7f102000
ALSA seems to be a dark arts thing.. I use some plugins on another setup to create L/R into separate feeds into darkice and that works great.... so I took it this loopback thing would do the same...
Seems the loopback exists....from:
~/darkice $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA] Subdevices: 7/7 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI] Subdevices: 1/1 Subdevice #0: subdevice #0
card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM] Subdevices: 2/2 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM] Subdevices: 2/2 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1
Loopbacks!!!! WOOT!
With this I will take it that the loopback and needed config files are correct, and have not posted them...
Darkice cfg IS SET to loop0
~/darkice $ cat lakelandp25.cfg # sample DarkIce configuration file, edit for your needs before using # see the darkice.cfg man page for details
# this section describes general aspects of the live streaming session [general] duration = 0 # duration of encoding, in seconds. 0 means forever bufferSecs = 1 # size of internal slip buffer, in seconds reconnect = yes # reconnect to the server(s) if disconnected
# this section describes the audio input that will be streamed [input] device = loop0 # OSS DSP soundcard device for the audio input sampleRate = 22050 # sample rate in Hz. 22050 i bitsPerSample = 16 # bits per sample. 16 for mono feeds, 32 for stereo feeds channel = 1 # channels. 1 = mono, 2 = stereo
# this section describes a streaming connection to an IceCast server # there may be up to 8 of these sections, named [icecast-0] ... [icecast-7] # these can be mixed with [icecast2-x] and [shoutcast-x] sections
# If you want to send to your own icecast server, you basically copy # this whole section and put in the values to point the feed to your own # server i
# Don't forget, the name [icecast2-0] needs to change to [icecast2-1] # and 2 and 3 as you add more feed destinations.
[icecast2-0] # The audio format to encode to, we're using mp3 here format = mp3
# The bit rate mode to use, the commented out lines are for a fixed bit # rate "constant bit rate" at 16 bits. I prefer the variable bit rate # for the sound quality it has and the throughput is very similar on avg
#bitrateMode = cbr #bitrate = 16
sampleRate = 22050 # sample rate in Hz. 22050 is the bitrateMode = cbr bitrate = 16
# Quality at .1, max is 1.0, but as you increase, so does the bandwidth # used. For mono scanner audio .1 is totally fine. quality = 0.1
# Takes the input and mixes it down to a mono output for the feed. channel = 1
# Cuts frequency response over 5kHz. For scanner feed this mostly # eliminates hiss and harshness on paging tones. Saves a bunch of # bandwidth as well. lowpass = 5000
# From Feed Technical Details, the "Server" server = audio.myserver.net
# From Feed Technical Details, the "Port" port = 8000 # port of the IceCast server, usually 8000
# From Feed Technical Details, the Password exactly as shown password = hackmeNOT!
# From Feed Technical Details, the mount...remove the leading "/", it's # not needed in this file. So if it is /999999 make it just 999999 mountPoint = Redacatedfeed
# name of the stream # On My Live Audio Feeds, it's the first part ending in a colon ":" name = Redactedfeed
# On My Live Audio Feeds, it's the part in parentheses in the Feed name description = redactedfeed
start up OP25
./rx.py --args 'rtl' -N 'LNA:19' -l http:192.168.0.28:8080 -S 2400000 -f 8xx.7xxxxe6 -o 25000 -q 26 -T trunk.tsv -V -2 -O loop0 2> stderrstream.2
OP25 starts up... SILENCE on the feed
./rx.py --args 'rtl' -N 'LNA:19' -l http:192.168.0.28:8080 -S 2400000 -f 8xx.7xxxe6 -o 25000 -q 26 -T trunk.tsv -V -2 -M myststem.json -O loop0 2> stderrstream.2
SILENCE BUT I GET TAGS! ! ! ! So the audio is not piped through some where?????
I figured if it was a issue with audio, tags would come through with out the audio...
./rx.py --args 'rtl' -N 'LNA:19' -l http:192.168.0.28:8080 -S 2400000 -f 8xx.xxxxe6 -o 25000 -q 26 -T trunk.tsv -V -2 -U -W 127.0.0.1 2> stderrstream.2
Watching the http output I see data come in, TSBK count goes up, TG's appear etc... NO AUDIO :( on the feed, WITH tags.... :)
Local audio comes out the speakers.... So audio is recovered and in good quality even for a Pi..
Any hints, clues? ?? ? I've tried a couple of different setups for the loopback with an .asound.rc in the /home/user, used loop1, hw:1,0, hw:1,1 etc. tried as 2 channel audio v. single channel audio in darkice... still silence is not golden.... :(
Any hints on getting the loopback audio working?? ? ? ? ? I might try it on the laptop setup too to see if its a Pi thing... My hunch is the magic dark arts of the right ALSA name for where the audio is at is wrong in the darkice config....but I've tried everything I can think of
Thanks.
Quoting op25@zellners.com:
OK... I've put my RPi3B+ to work...
The problem is feeding audio to my IceCast server.. :( :( :(
I installed a MP3 capable Darkice with its deps... its starts up
Trying on the laptop... same things tags, NO AUDIO. ** LOCAL AUDIO ** is fine. URRGRRRRGGGhhhh!
I modified the instructions for the laptop to ensure that the indexes match.ie: audio card is ALSA 0 and Loopbacks are ALSA 1
./rx.py --args 'rtl' -N 'LNA:47' -S 2400000 -f 8xx.xxxxe6 -o 25000 -q 72 -v 10 -T trunk.tsv -V -2 -l http:192.168.0.26:8080 -M tags.json -O loop0 2>sterr.2 ^^^^^^^^^^
either the audio is not getting to the loopback or darkice is not getting that... or both I guess...
when I use -U I get local audio with out using nc | aplay.....
or I can use -W IP and then nc| aplay etc...
I've run out of ideas to try on the various foibles of ALSA to find where this audio is going or not going... I know place its not going loopback!
Any ideas?????????????????????????????????????????????? SHort of running a cable from the speakers out to a USB audio stick and into another PI! ! ! ! ??????
~$ arecord -l **** List of CAPTURE Hardware Devices **** card 0: Intel [HDA Intel], device 0: ALC268 Analog [ALC268 Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM] Subdevices: 7/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM] Subdevices: 8/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7
$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: Intel [HDA Intel], device 0: ALC268 Analog [ALC268 Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM] Subdevices: 8/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM] Subdevices: 8/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7
I've used all combos of things in darkice and rx.py for the name of the device, no audio
loop0, loop1, hw:1,0, hw:1,1 hw:Loopback1, hw:Looopback0 etc...
Silence.
Local audio works great.
/etc/modules ~$ cat /etc/modules # /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored.
snd_hda_intel snd-aloop options snd-aloop enable=1 index=1 pcm_substreams=2
/etc/asound.conf
$ cat /etc/asound.conf # 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" } } }
Quoting op25@zellners.com:
^^^^^^^^^^
either the audio is not getting to the loopback or darkice is not getting that... or both I guess...
Some progress... still no joy in OP25 to loop to darkice to icecast out to users....
On the laptop the loop config appears to work as I can FORCE VLC to output to ASLA loop0 and play and mp3, and it eventually will be heard... audio is exceptionally low though...
I've cranked everything in alasmixer playback and capture way up didn't seem to affect that audio in the least.
Any ideas on doing the same on the Pi??? I very rarely if very use anything gui or other media related on them... just darkice and inputs from USB dongles connected to real radios.
olmxplayer is the hotness over in piland, I think??? Does it offer a way to force out to ALSA loop0??? Last I knew vlc was a bomb on pi's wouldn't play as it lacked some lib or had to be hand coddlded or something....on;y time I see X on Pi's now is from the first boot and disabling all that stuff...
Quoting wllmbecks@gmail.com:
I trust that you see the process for darkice running.
runs and the silence of the feed plays in vlc, wouldn't play if it was not mounted to icecast
DarkIce 1.0 live audio streamer, http://code.google.com/p/darkice/ Copyright (c) 2000-2007, Tyrell Hungary, http://tyrell.hu/ Copyright (c) 2008-2010, 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: redacted.cfg 02-Jan-2019 20:44:13 Using ALSA DSP input device: loop0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
02-Jan-2019 20:44:13 encoding 02-Jan-2019 20:44:13 scheduler high priority 99 02-Jan-2019 20:44:13 Could not set POSIX real-time scheduling, this may cause recording skips. Try to run darkice as the super-user. 02-Jan-2019 20:44:14 set lame mode 3 02-Jan-2019 20:44:14 set lame channels 2 02-Jan-2019 20:44:14 set lame in sample rate 22050 02-Jan-2019 20:44:14 set lame out sample rate 22050 02-Jan-2019 20:44:14 set lame bit rate 16 02-Jan-2019 20:44:14 set lame quality 9 02-Jan-2019 20:44:14 set lame lowpass frequency 5000 02-Jan-2019 20:44:14 set lame highpass frequency 0 02-Jan-2019 20:44:14 set lame psycho acoustic model 1 02-Jan-2019 20:44:14 set lame error protection 1 LAME 3.99.5 32bits (http://lame.sf.net) Autoconverting from stereo to mono. Setting encoding to mono mode. Using polyphase lowpass filter, transition band: 5068 Hz - 5335 Hz 02-Jan-2019 20:44:14 MultiThreadedConnector :: tranfer, bytes 0 02-Jan-2019 20:44:14 MultiThreadedConnector :: ThreadData :: threadFunction, was (thread, priority, type): 0x13e5778 0 SCHED_OTHER 02-Jan-2019 20:44:14 MultiThreadedConnector :: ThreadData :: threadFunction, now is (thread, priority, type): 0x13e5778 1 SCHED_FIFO
I am suspect of your asound.conf.
Compared line by line, the same file for asound bcm removes one line does essentially the same.
For enumeration, I saved and replaced both asound.conf and bcm2835.conf with those attached reboot pi to ensure they load/reload
loopback drivers and devices are the same
$ cat /proc/modules |grep snd snd_aloop 24576 2 - Live 0x7f3d2000 snd_bcm2835 32768 0 - Live 0x7f161000 (C)
snd_pcm 98304 3 snd_aloop,snd_bcm2835, Live 0x7f13d000 snd_timer 32768 2 snd_pcm, Live 0x7f12f000 snd 69632 6 snd_aloop,snd_bcm2835,snd_pcm,snd_timer, Live 0x7f114000
$ arecord -l **** List of CAPTURE Hardware Devices **** card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM] Subdevices: 8/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM] Subdevices: 7/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 pi@raspberrypi:~/darkice $
NO AUDIO still. Tags... no audio on feed.
Quoting op25@zellners.com:
NO AUDIO still. Tags... no audio on feed.
Ok.. found out VLC is not available AND in the Raspbian image... like I said, I don't use the GUI at all on Pi's.. it boots up first time, and I run config to disable it and the autologin... :)
So...
asound.conf and bcm2835.conf installed BOTH My originals from the previous link I used to setup things... BOTH WORK with the below.
Used rtl_fm | aplay and get local NWR audio to speakers.... so good sound system.
scp over some mp3's..... and start up VLC.. reset output to ALSA and select loop0, save, exit, restart vlc.
Open up some of the mp3's... wait for 30+ seconds and out comes the MP3's audio on anther box... via my Icecast server using my darkice.cfg
So loop0 is setup properly and Darkice IS feeding loop0 to my Icecast server...
So where is it getting lost from OP25./rx.py to loop0???????????????????????
OP25's nuances are new to me and so I don't have any clue....
using -U will provide local audio out to the speakers of the Pi connected to the 1/8" jack... HDMI is connected to DVI conversion cable, and no speakers in monitor... but local audio works....
-O loop0 NO audio...
-M myfeed.json TAGS WORK
remove -M , obviously no tags, STILL NO AUDIO
tried with LOCAL normal terminal and with -l http:..... still no audio on loop0, local audio is fine with that.
So what to try next?????
Thanks!
Quoting op25@zellners.com:
Quoting op25@zellners.com:
NO AUDIO still. Tags... no audio on feed.
I found the issue...
rx.py options.
I read that you use -O loop0 so put that in the CLI for rx.py.
The PROBLEM IS that you REQUIRE -U as well.... Maybe thats clear to everyone else, but to me it reads OR not BOTH REQUIRED.. maybe documented the -U produces audio, *** to route that audio to a specific sound card or an ALSA plugin like snd-aloop you use the -O option AS WELL to specify where to send audio, other wise the DEFAULT audio device is used....ie: ALSA output etc..
Like :
Audio output: -U [-O (device/plugin)]
Audio is produced on the local device with the -U option, OPTIONALLY you can route this to specific devices ie: non default sound card or ALSA plugins like snd-aloop to send to other programs like Darkice, etc. for streaming
Example:
-U will produce local audio
-U -O hw:1,0 would route that audio to a SECOND sound device, say a better unit than the standard built in DAC on most systems
-U -O loop0 would route it to the ALSA Loopback driver to send to other programs like Darkice for streaming or others.
I read that them as exclusive like using the nc | play wireshark output option is -U or -W NOT BOTH...
SO adding -U -O loop0 TOGETHER and MAGICALLY NOW AUDIO is present...
So SOLVED - OPERATOR ERROR... Just didn't doesn't read that need -U AND then routing it via -O to me....
Any way THANKS for the input...
SOLVED! :)
Now on to fine tunning and prepping the other Pi's to be ready for a PII cut over thats coming....
Quoting wllmbecks@gmail.com:
I think there may be another issue. I configured my meta.json a while ago and lost audio. I changed the name then restarted and all is well. Have to run but will verify that this was the problem later this evening.
I stared with no feed.json and and still no audio then.. I added the feed.json to see that tags were being send/updated...
No audio.