Need 12 VACs for CubicSDR on Pi4 - ie creating more than one also snd-aloop audio help.

Status
Not open for further replies.

thebaldgeek

thebaldgeek
Joined
Apr 11, 2018
Messages
143
Location
SoCal
Hi All.

Need some help if I can regarding Linux virtual audio cables (VAC).
I am using the SDRplay Pi image on a Pi4. Everything is working great. I can use either my RSP1a or my RTLSDRv3 dongle no problem.
I have built from source the decoding program I want - Jaero - no problem.

The problem I have is how to pipe audio out of CubicSDR into Jaero.... and yes, I need around 12 VACs when I get everything working (Satcom ACARS L-Band).

CubicSDR only sees alsa devices, NOT pulse. So pulse and Jack are off the table. CubicSDR just does not see them at all.

Issuing the command
Code:
sudo modprobe snd-aloop
creates a two loop devices that CubicSDR sees, and Jaero sees some of the devices, but none of them actually pipe the audio through from one to the other.

Sorry for the potato screenshot, but it might help show what I am seeing. (CubicSDR does not work over VNC so I cant use my screencap software).
So you can see the Cubic sound options and the Jaero sound options.
I have tested every single combination and can not pipe audio from cubic to jaero.

I have a feeling I am doing (or not doing) something in Linux to join the two devices, but after 6-8 hours of Google foo, I can't find the missing link.

So, two questions.
1. How to pipe audio from Cubic to Jaero?
2. How to make 12 VACs (not just the default two alsa snd-aloop devices).

Thanks.

Ben.
K6TBG
 

Attachments

  • cubicsoundoptions.PNG
    cubicsoundoptions.PNG
    915.3 KB · Views: 7
  • jaerosoundoptions.PNG
    jaerosoundoptions.PNG
    588.4 KB · Views: 7

deadite66

Member
Joined
Jul 31, 2016
Messages
41
Maybe try SDR++

you can use pulseaudio null-sinks to create as many virtual audio channels as you wish.

add to /etc/pulse/default.pa

load-module module-null-sink sink_name=VirtualSink1 sink_properties=device.description=VirtualSink1
load-module module-null-sink sink_name=VirtualSink2 sink_properties=device.description=VirtualSink2
load-module module-null-sink sink_name=VirtualSink3 sink_properties=device.description=VirtualSink3
load-module module-null-sink sink_name=VirtualSink4 sink_properties=device.description=VirtualSink4
etc...

then you can use Pulse Audio Volume Control (pavucontrol) to route the channels.

though i do wonder if the Pi4 can handle 12 vfo's without overloading the cpu.
 

thebaldgeek

thebaldgeek
Joined
Apr 11, 2018
Messages
143
Location
SoCal
@deadite66 Thanks so much for replying.

SDR++ demodulators are sort of broken for Satcom work. I have been working with the author on his discord, but satcom is outside of his user group and its hard to get traction.

I added those pulse audio sinks to that file, rebooted and somewhat as expected, none of them show up in CubicSDR.
I already had pavucontrol installed and there is no option in its GUI to route audio from one source to another sink.
So I cant send audio from the radio to anywhere since they are not an option in CubicSDR.

You might be right, perhaps the Pi wont support all of them, but as it stands, it cant support even 1, and at this stage I just want to see it work, just a little bit.

Ben.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,466
Location
Talbot Co, MD
/etc/modprobe.d/snd-aloop.conf
Code:
softdep snd-hda-intel post: snd-aloop
options snd-aloop enable=1 index=1 pcm_substreams=12

You will have to change "snd-hda-intel" to be the same name of whatever driver the RPI4 is using. It's probably a "bcm" something...
 

thebaldgeek

thebaldgeek
Joined
Apr 11, 2018
Messages
143
Location
SoCal
@boatbod Thanks for helping out.

I created that file, consulted the oral Google and put the following lines in:

softdep snd-bcm2835 post: snd-aloop options snd-aloop enable=1 index=1 pcm_substreams=2

When I invoke snd-aloop now, I get the following error:
modprobe: ERROR: could not insert 'snd_aloop': No such device

I have seen this error a heap of times in my efforts to get this working.
It seems to have something to do with the index numbering?


pi@54L:~ $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1] Subdevices: 4/4 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones] Subdevices: 4/4 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3

My understanding is that the new aloop device you help me add is on the same index or some other non-sequential one and so throws the error?

Checking CubicSDR shows no extra sound devices. Just the HDMI and headphones (neither of which pipe audio to Jaero).

Again, thanks for your help.
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,065
Location
NE Wisconsin
thebaldgeek,

I believe the issue is with how pulseaudio was implemented on the Raspberry Pi Raspbian Buster) OS in that there are permission issues
that your can work around by manually starting pulseaudio. This works best by simply adding a line to the bottom of the existing crontab per the example below.

crontab -e [Add the following line, save and reboot]

@reboot pulseaudio --start


I have my Raspberry Pi's loaded with Raspbian Lite as I typically run the headless and login using SSH from PuTTY using Xming to facilitate graphics functionality. That said, I had to install pulseaudio (sudo apt-get install pulseaudio pulseaudio-utils) manually being that it doesn't exist in the Lite version.

I was then able to create four (4) VitualSinks for testing along with the /etc/modprobe.d/snd-aloop.conf file as suggested by @boatbod in (Post #4) that has yielded the results shown below.

I don't know if this is what you're looking for, and I haven't actually tested the VAC's, but it appears there are four virtual loopback devices
that hopefully are now available for use with applications. No guarantees implied or expressed!!!

Bill


pi@raspberrypi-4B:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
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 0: Loopback PCM [Loopback PCM]

Subdevices: 3/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]

Subdevices: 4/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3



pi@raspberrypi-4B:~ $ pavucontrol

pavucontrol panel.png
 
Last edited:

thebaldgeek

thebaldgeek
Joined
Apr 11, 2018
Messages
143
Location
SoCal
@wgbecks Thanks for your help.
Your confidence of having been here before is super encouraging.

I already had those packages installed ( sudo apt-get install pulseaudio pulseaudio-utils ).
I added the cronjob and rebooted.
aplay -l showed no new devices.
And once again,
sudo modprobe snd-aloop modprobe: ERROR: could not insert 'snd_aloop': No such device

I am starting to think that the SDRplay distro is not as stock as they and I thought it was.

Also thanks for the tip about x2ming. I spent a few minutes testing it out and get nothing more than a putty shell. I will spend some more time with it since I know that CubicSDR does not work over any VNC server/clients and I really need it working since I want to run headless.
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,065
Location
NE Wisconsin
@wgbecks Thanks for your help.
Your confidence of having been here before is super encouraging.

I already had those packages installed ( sudo apt-get install pulseaudio pulseaudio-utils ).
I added the cronjob and rebooted.
aplay -l showed no new devices.
And once again,
sudo modprobe snd-aloop modprobe: ERROR: could not insert 'snd_aloop': No such device

I am starting to think that the SDRplay distro is not as stock as they and I thought it was.

Also thanks for the tip about x2ming. I spent a few minutes testing it out and get nothing more than a putty shell. I will spend some more time with it since I know that CubicSDR does not work over any VNC server/clients and I really need it working since I want to run headless.

What does aplay -l show now that you've added the @reboot pulseaudio --start ?
What distro of Raspbian OS do you have imaged on your Pi-4?


I just ran a test of the loopback devices using a prebuilt mono test wav file (440Hz.wav) recorded with a sampling rate of 8000 Hz then
opened to curses terminal instances per the following.

First Terminal

pi@raspberrypi-4B:~ $ aplay -D hw:1,0,0 440Hz.wav
Playing WAVE '440Hz.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

Second Terminal

pi@raspberrypi-4B:~ $ arecord -D hw:1,1,0 -f s16_le capture_test.wav
Recording WAVE 'capture.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono


I then let arecord run for about 30 seconds before sending Control-C to stop execution. Indeed, I had a file named "capture_test.wav"
that I was able to playback using aplay to verify that the loopback stream actually worked. I even sent the file over to my Windows
machine to verify with Audacity and it also checked out there as well.

I also ran a second test but left off the numeric stream parameter in both the aplay and arecord commands and it too worked. presumably
using stream 0 (default ?). IE: aplay -D hw:1,0 440Hz.wav | arecord -D hw:1,0 -f s16_le capture_another.wav

It's getting a little late to try installing any apps to test any further but will be glad to and report back. I just wonder what
happened on your Pi-4? Might need to retrace a few installation and configuration steps or we can compare files.

Bill
 

thebaldgeek

thebaldgeek
Joined
Apr 11, 2018
Messages
143
Location
SoCal
aplay -l shows the usual Pi devices:

aplay -l **** List of PLAYBACK Hardware Devices **** card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1] Subdevices: 4/4 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones] Subdevices: 4/4 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3

Since the sudo modprobe snd-aloop throws an error, I don't expect to see anything in there?

What am I running?

uname -a Linux 54L 5.10.17-v7l+ #1421 SMP Thu May 27 14:00:13 BST 2021 armv7l GNU/Linux cat /etc/*-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

I don't doubt it's working for you, I just cant seem to be able to turn it 'on'. I just get the error about 'no such device'.
As best as I can tell I am running a very stock, clean and out-of-the-box distro build.

Ben.
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,065
Location
NE Wisconsin
Decided to run another test in that I have op25 setup on the same Raspberry Pi-4 that I normally have configured to send UDP PCM packets over to a local instance of Liquidsoap for audio processing and streaming....

I reconfigured my rx.py command line with -U -O hw:1,0 to direct the audio output to one of the VirtualSink Loopback devices
them started recording, arecord -D hw:1,0 -f s16_le -c 2 p25_audio.wav and let it run for a few minutes until I observed a couple
of transmission on the local P25 system. stopped the recording then checked the captured wav file and all was good!

Perhaps tomorrow, I will test a bit further with OP25's multi_xrx.py that I have another configuration with two separate voice channels
that focus on different talkgroups on the P25 system that I will test using two simultaneous loopback streams to as many instances
of arecord to see how that all works out.

I believe that the VirtualSinks support up to eight streams per loopback. So another test would be to use a common audio source
but pipe it to two or more sinks to see how that works.

BTW, I rebooted the RPi before running either series of tests just to be sure that the loopback functionality remained operational.

Bill
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,065
Location
NE Wisconsin
Ben,

I am wondering if your ALSA subsystem didn't become partially corrupted with all of the attempts to get your VAC's up and runnng?

FWIW, I burned a clean image of Raspbian Lite and plugged the MicroSD into an RPi-3B+ that I had laying around to see how a clean image
would look and feel with regard to creating the the (sudo modprobe snd-aloop) sound loopback devices.

As you'd expect, aplay -l output the onboard ALSA (bcrm2835 Headphone) device while arecord -l displayed an empty list.

pi@raspberrypi-3B:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
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


pi@raspberrypi-3B:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****

I then input sudo modprobe snd-aloop and repeated aplay -l and arecord -l commands -l obtaining the following outputs.

**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
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 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

pi@raspberrypi-3B:~ $ 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: 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

This suggests that the ALSA subsystem in a clean repo image is alive and well, and does accept the addition of the loopback
devices. I also successfully repeated the same aplay -D hw:1,0,0 440Hz.wav and arecord -D hw:1,1,0 -f s16_le capture_test.wav test
performed last night and again made the capture.wav of the test of the 440Hz test track using the ALSA loopback device.

Please note that prior to the above stated test that I had not installed pulseaudio, pulseaudio-utils, pavucontrol, had not crated
or modified any configuration scripts. The only notable difference is that the ALSA snd-loopback devices do not remain following
a reboot as they did when pulseaudio was installed. However, adding @reboot sudo modprobe snd-aloop to the crontab made
them persistent following system restarts.

May I suggest that if you have a spare MicroSD card that you flash it with Raspbian Lite to see if you can at least repeat the above
noted behavior on your Pi-4.

The task of initializing a new Pi image can be made less painless if you make copies of your existing /etc/dhcpcd.conf file if it's
been configured for static IP as well as to make a copy of your existing /etc/wpa_supplicant/wpa_supplicant.conf file if using
the WiFi network device to connect to your LAN.

Copy the above files if they are significant to your present configuration and crate a dummy file "ssh" and place the above along
with the blank ssh file into the /boot folder of the clean image before installing the SD in your Pi. Upon first boot the OS will copy
these files to their correct folders and will enable SSH access to enable remote access from the start without having to run the
raspi-config form a locally attached keyboard to turn it on.

Finally, I am wondering if you need to deal with pulseaudio at all? You could continue on with the clean image and try installing
your applications to see if they will allow you to configure them with ALSA devices alone.

Good luck,

Bill
 

thebaldgeek

thebaldgeek
Joined
Apr 11, 2018
Messages
143
Location
SoCal
Thanks everyone.

I am a bit cranky after spending so long on the SDRplay (yes, I am going to call them out!). Downloaded and flashed v0.7 to my card 3 times to reset things and start fresh each time, but in the end (about post 2-3 here), I took @wgbecks advice (well, sort of) and tried a different distro.
I went with PiSDR because reasons.
Built Jaero following my guide: Ins and outs of Jaero.
And in 15 minutes I was decoding L-Band ACARS messages.
It really was that easy. Thanks for nothing SDRplay. (And oh, to add to my grumpy outlook, the $110 RSP1a has the exact same performance as the $30 RTLSDRv3 at ~1.5GHz.... well, that's not actually true, the Bias-T on the RSP1a is not powerful enough to turn on the NooElec L-Band LNA where as the v3 does it with ease).

I don't know what SDRplay did to that distro, and at the moment I don't care to dig into it, but they sure tweaked something in a bad way.
All that said, I am still having trouble adding more than one aloop, but given how CPU hungry Jaero is, I don't think it matters.

So, here it is:

jareoonlinux.PNG

SDRangel or CubicSDR both decode at the same rate, but SDRangel uses less CPU.
I am going to spin up a few more Jaeros to stress test the Pi 4. I suspect the most I will be able to run is 4-5 Jaeros. I really need 14, so the whole project was a bit of a bust, but hey, I learned a TON about stuff.

Thanks again everyone.

Cheers,

Ben. aka thebaldgeek.
K6TBG
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,065
Location
NE Wisconsin
Ben,

Don't be too quick to discount the Mighty Raspberry Pi-4 just yet. Another fellow ham out in Maryland has six instances of op25's rx.py with six RTL SDR's all decoding and streaming different TGID's on the new Montgomery County P25 Phase-II system. I can't believe that it was possible but it all works actually very well. All instances (Icecasat streams) going t BCFY are handled by a single instance of Liquidsoap. : - )

Bill
 
Status
Not open for further replies.
Top