OP25 (Boatbod) Does an RPi HDMI monitor override the AlsaMixer for audio routing?

Status
Not open for further replies.

Carter911

Member
Joined
Aug 17, 2021
Messages
59
OP25 (Boatbod) Does an RPi HDMI monitor override the AlsaMixer for audio routing?

I am still a newbie, so perhaps I just don't have the settings quite right, yet.

I have an RPi 3B+ running OP25 (Boatbod), on the Ohio Marcs P25 Phase I system.

With help from the Forum I now have it running on Boot-up.

HDMI monitors come in versions that both include built-in speakers, and in versions that do not include built-in speakers.

In my current setup, (desktop tinkering), with an HDMI monitor without built-in speakers, and using either the RPi's AV Jack, or a USB audio dongle, it appears to me that the mere presence of the HDMI monitor being plugged into the RPI forces the OP25 (Boatbod) audio to the (absent) HDMI speakers.

When using both the AlsaMixer and the little RPi upper-right-hand-corner speaker icon to set the audio to either the AV Jack or the USB audio, this is ignored when an HDMI monitor is plugged into the RPI.
I also tried several versions of -O Audio Device to tell OP25 specifically which of the three internal audio devices to use.
That didn't work, but truth be told I am not sure exactly how to name the desired device, (1,2,3, or Headphones, etc....), several attempts failed.

I have include two command lines below as an example, (numerous other versions were also tried).

This version will Auto-start on boot-up with a speakerless HDMI monitor attached, but I can't play the audio through the AV Jack or through the USB audio dongle:
./rx.py --args 'rtl' -N 'LNA:35' --crypt-behavior 2 -S 1000000 -x 2 -o 2130 -q -1 -T trunk.tsv -D cqpsk -V -2 -U -l http:0.0.0.0:8080 2>stderr.2

This version will Auto-start on boot-up without the HDMI monitor attached, (headless), and one can then play the audio through the AV Jack:
./rx.py --args 'rtl' -N 'LNA:35' --crypt-behavior 2 -S 1000000 -x 2 -o 2130 -q -1 -T trunk.tsv -D cqpsk -V -2 -U -l http:0.0.0.0:8080 2>stderr.2

Adding the -w argument, mentioned in one of the Read Me files, also did not appear to impact the above behavior.

It would appear to me that the mere presence of the HDMI monitor being plugged into the RPi is forcing the (internal) audio to the HDMI port, (whether the HDMI monitor has built-in speakers or not), and that neither AlsaMixer nor the little RPi speaker icon can override this.

Once again, I might just be missing something, in which case guidance would be very much appreciated.

JC
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,494
Location
Talbot Co, MD
The RPi setup utility has the ability to define whether the default audio gets routed to hdmi or the 3.5mm jack. It works (I use it on my hdmi speakers at work) but the caveat is that Pulse Audio is not generally started at boot time until the desktop has logged in. If you start op25 at boot, you may need to configure it to use ALSA rather than Pulse if you want local audio to be functional.
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,097
Location
NE Wisconsin
There's a workaround on Raspbian OS (Buster) for Pulse Audio permission issues whereby you're are not logged in such as with headless or unattended operation and whereby you have applications (op25) starting as a service.
.
The fix is to set a job into chron that runs Pulse Audio when the Pi boots.

IE: crontab -e
@reboot pulseaudio --start [Add this line to bottom of the existing file, save, and reboot.]


Pulse Audio will not be started as if user "pi" was logged in.

This is also an example of the downside of imaging the Pi with either of the GUI Desktop versions of Raspbian OS that install and configure
Pulse Audio by default. The Raspbian Lite version does not install Pulse Audio leaving ALSA in charge (so to speak) of your audio devices that works well for headless operation of op25 without the PA permissions issues.
 

Carter911

Member
Joined
Aug 17, 2021
Messages
59
Live and learn...

I know just enough to turn the RPi on :)

The .../apps/README files states:

Internal Audio Server
Starting rx.py with the "-U" command ... enables the internal udp audio server which will play received audio through the default ALSA device.

I learned about the Alsamixer just the other day, so it is obviously on my RPi.
The Readme lead me to believe that the OP25 -U option would route the audio to the Alsa driver/mixer.
Hence my confusion on why I could toggle the settings on and off, back and forth, all day and yet the audio just wouldn't route to the AV Jack or the USB audio dongle like I was clearly instructing it to.

I didn't know / realize / appreciate the fact that I also had Pulse Audio which was pre-empting the ALSA driver.

Knowing the root cause of the problem is clearly the first step in resolving it!
I'll work on the above solution.

Bill mentioned the Raspbian Lite version the other day, but I have not yet, (obviously), ventured there.

The rapid feedback and expert guidance on the Forum is truly appreciated.

JC
 

Carter911

Member
Joined
Aug 17, 2021
Messages
59
Wow!

The RPi now automatically starts OP25 (Boatbod) on Boot-Up, and plays the audio through the USB audio dongle with or without the HDMI monitor attached!

Live is good!

At the risk of sounding repetitious:
The rapid feedback and expert guidance on the Forum is truly appreciated.

JC
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,494
Location
Talbot Co, MD
Note: the rx.py "-U" option send audio to the default sound destination using ALSA library calls. That does not mean that your underlying Linux sound system has not been hijacked by Pulse Audio, or that in some circumstances it might actually be better to output the sound using Pulse library calls. The problem with Linux is that it is so very flexible and this causes some challenges when trying to make something that will "just work" for everyone! Glad you got it working finally!
 
Status
Not open for further replies.
Top