OP25 as SYSTEMD service Audio Issues

KmanOz

Member
Joined
Apr 21, 2019
Messages
18
Location
Melbourne, Australia
So running OP25 from standard shell works fine and use the - U && -O pulse option makes OP25 appear in the Pulse Mixer as OP25.

pulse.png

The problem I am having is if I run it as a service, (which does work) although I get sound output I get no slider and furthermore, it does create a problem with other audio which sometimes creates a situation where no other device can output any audio at all. Effectively the OP25 services hogs pulse audio. I have tried to make sure that it starts after pulse audio as below but have no there clues. Has anyone experienced this?

[Unit]
Description=op25 Recieve Service
After=output.alsa output.pulseaudio
Requires=output.pulseaudio

[Service]
User=peter
WorkingDirectory=/home/peter/Applications/op25/op25/gr-op25_repeater/apps
ExecStart=/bin/bash -- op25.sh
RestartSec=5
Restart=on-failure

[Install]
WantedBy=multi-user.target
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,411
Location
Talbot Co, MD
PA can be a pita due to permissions issues if you start it headless or prior to logging on. You might try switching op25 over to ALSA (-O "default"), but I'm not sure this is going to give you a volume slider either.
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,029
Location
NE Wisconsin
What Linux OS are you using? I might be able to help you with some PA configs to address the permissions issues that would be necessary
to facilitate running applications like op25 and liquidsoap as system services.
 

KmanOz

Member
Joined
Apr 21, 2019
Messages
18
Location
Melbourne, Australia
What Linux OS are you using? I might be able to help you with some PA configs to address the permissions issues that would be necessary
to facilitate running applications like op25 and liquidsoap as system services.
Debian Bookworm. Thanks any help would be awesome.
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,029
Location
NE Wisconsin
Debian Bookworm. Thanks any help would be awesome.

Oh boy! Debian Bookworm is problematic for a number of applications that build and run perfectly on other distro's such as
Ubuntu 22.04.3. Liquidsoap is one such application that doesn’t run on Bookworm unless you downgrade the FFMPEG package.

It appears you're not interested in streaming op25's audio, but instead are only looking to output the audio locally. Therefore, the
procedure listed below may work on for you, but keep in mind it's not been tested on Bookworm.

This procedure removes normal PulseAudio user-based permissions restrictions to facilitate the unattended and headless operation
applications like op25 and Liquidsoap to run as a system services under the control of systemd.

Bill

sudo systemctl --global disable pulseaudio.service pulseaudio.socket
Create the file:
/etc/systemd/system/pulseaudio.service containing the following lines;

[Unit]
Description=PulseAudio system server

[Service]
Type=notify
ExecStartPre=/bin/sleep 10
ExecStart=pulseaudio --daemonize=no --system --disallow-module-loading --log-target=journal

[Install]
WantedBy=multi-user.target

Enable the service
sudo systemctl --system enable pulseaudio.service
sudo systemctl --system start pulseaudio.service


Edit Client conf /etc/pulse/client.conf and replace as below;
default-server = /var/run/pulse/native
autospawn = no

Add root and local user to pulse group
sudo adduser root pulse-access
sudo adduser
username pulse-access

sudo reboot
 

KmanOz

Member
Joined
Apr 21, 2019
Messages
18
Location
Melbourne, Australia
Oh boy! Debian Bookworm is problematic for a number of applications that build and run perfectly on other distro's such as
Ubuntu 22.04.3. Liquidsoap is one such application that doesn’t run on Bookworm unless you downgrade the FFMPEG package.

It appears you're not interested in streaming op25's audio, but instead are only looking to output the audio locally. Therefore, the
procedure listed below may work on for you, but keep in mind it's not been tested on Bookworm.

This procedure removes normal PulseAudio user-based permissions restrictions to facilitate the unattended and headless operation
applications like op25 and Liquidsoap to run as a system services under the control of systemd.

Bill

sudo systemctl --global disable pulseaudio.service pulseaudio.socket
Create the file:
/etc/systemd/system/pulseaudio.service containing the following lines;

[Unit]
Description=PulseAudio system server

[Service]
Type=notify
ExecStartPre=/bin/sleep 10
ExecStart=pulseaudio --daemonize=no --system --disallow-module-loading --log-target=journal

[Install]
WantedBy=multi-user.target

Enable the service
sudo systemctl --system enable pulseaudio.service
sudo systemctl --system start pulseaudio.service


Edit Client conf /etc/pulse/client.conf and replace as below;
default-server = /var/run/pulse/native
autospawn = no

Add root and local user to pulse group
sudo adduser root pulse-access
sudo adduser
username pulse-access

sudo reboot

Thank you Sir. Worked a charm.
 

KmanOz

Member
Joined
Apr 21, 2019
Messages
18
Location
Melbourne, Australia
Actually after doing this it seems the Bluetooth service no longer adds a speaker. Not super important but if you have any ideas glad to hear them. Once again cheers.
 
Top