Difference between revisions of "PulseAudio on OpenWRT with MPD and other Stuff"

Wiki.TerraBase.info
Jump to navigation Jump to search
m
m
Line 6: Line 6:
The PulseAudio people are brilliant.  But their documentation is a bit questionable.  Case in point is the https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/ page.  It starts off on a big tangent, then seems to go off on other tangents before addressing the main concepts.  That's cool and not a complaint against the PulseAudio people.  It's just a little note to let people know who are reading it and just want to get RTP to work that they shouldn't get frustrated.  Just keep reading, ignore most of the stuff at the beginning and you'll get there.
The PulseAudio people are brilliant.  But their documentation is a bit questionable.  Case in point is the https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/ page.  It starts off on a big tangent, then seems to go off on other tangents before addressing the main concepts.  That's cool and not a complaint against the PulseAudio people.  It's just a little note to let people know who are reading it and just want to get RTP to work that they shouldn't get frustrated.  Just keep reading, ignore most of the stuff at the beginning and you'll get there.


=== A Deep, Deep Hole with PulseAudio at the Very Beginning (on OpenWRT) ===
===A Deep, Deep Hole with PulseAudio at the Very Beginning (on OpenWRT)===
The nice people with the OpenWRT project and all their hard work is very much appreciated.  But there are also the head scratching (and head exploding) moments too.  For instance: How can so much effort be put into something, yet one little item is allowed to (or isn't configured correctly) remain in place that prevents the PulseAudio service from operating properly?
The nice people with the OpenWRT project and all their hard work is very much appreciated.  But there are also the head scratching (and head exploding) moments too.  For instance: How can so much effort be put into something, yet one little item is allowed to (or isn't configured correctly) remain in place that prevents the PulseAudio service from operating properly?


Line 13: Line 13:
The issue?  As noted, the root User is not included in the audio Group.  Add it in there using groupadd (which in and of itself is interesting to install) or just edit the /etc/group File.
The issue?  As noted, the root User is not included in the audio Group.  Add it in there using groupadd (which in and of itself is interesting to install) or just edit the /etc/group File.


=== Ready?  Let's Install PulseAudio (and dependencies, plus other tools, and see what happens) ===
===Ready?  Let's Install PulseAudio (and dependencies, plus other tools, and see what happens)===
 
==== Installation of Software ====
opkg update
opkg update


Line 19: Line 21:


Do NOT install pulseaudio-daemon (plain), if you want to use Bluetooth to connect to Speakers.  The pulseaudio-daemon-avahi contains the necessary bluetooth modules, pulseaudio-daemon (plain) does NOT.  One can always disable the avahi service too, without affecting PulseAudio.
Do NOT install pulseaudio-daemon (plain), if you want to use Bluetooth to connect to Speakers.  The pulseaudio-daemon-avahi contains the necessary bluetooth modules, pulseaudio-daemon (plain) does NOT.  One can always disable the avahi service too, without affecting PulseAudio.
Dependencies include some basic ALSA (Advanced Linux Sound Architecture) stuff, but a couple of more items are nice to have for several reason, including testing, so;
opkg install alsa-utils alsa-ucm-conf mpd-full mpd-avahi-service mpc lib<ins>mpd</ins>client
...and maybe opkg install madplay mpg123 (they don't install any services, so they're just there if you need them)
==== The Errors ====
Are these the errors referred to earlier as the "show stopper" for PulseAudio.  Nope.  Just an annoyance that can be fixed.<syntaxhighlight lang="text">
chown: /dev/mixer: No such file or directory
chown: /dev/dsp: No such file or directory
chmod: /dev/mixer: No such file or directory
chmod: /dev/dsp: No such file or directory
</syntaxhighlight>Will this fix it (spoiler alert, NO, so like Frankie said "don't do it")?: opkg install gst1-mod-dv<ins>dsp</ins>u gst1-mod-audiomixer (a bunch of dependencies would be installed too).  We'll get to the fix later, let's focus on the "Show Stopper"
===== The "Show Stopper" for PulseAudio =====
Issue this command (it is for 'talking' to the PulseAudio Service): pactl list short sinks
The result: Connection failure: Access denied
Why (as noted earlier, but more details and a solution later): The root User (that's right, the ROOT user) doesn't have the privileges to execute the command.  WTF!?
How long did it take to figure out and what was the anger level: ''10 Page Diatribe DELETED''
Solution: Add the root user to the Audio Group: nano /etc/group;<syntaxhighlight lang="text">
Before: audio:x:29:
After: audio:x:29:root,mpd
</syntaxhighlight>

Revision as of 16:33, 4 August 2024

First of all, good to be back. Issues with MediaWiki, along with time constraints on fixing it, have prevented new articles from being created.

Anyway, working on several different Routers running OpenWRT 23.05.03 using PulseAudio, MPD (MPC), Bluetooth (BlueZ), and a bunch of other stuff including PulseMixer (works great on OpenWRT, even though the 'required' version is above the version of Python3 available in OpenWRT).

Starting Thoughts

The PulseAudio people are brilliant. But their documentation is a bit questionable. Case in point is the https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/ page. It starts off on a big tangent, then seems to go off on other tangents before addressing the main concepts. That's cool and not a complaint against the PulseAudio people. It's just a little note to let people know who are reading it and just want to get RTP to work that they shouldn't get frustrated. Just keep reading, ignore most of the stuff at the beginning and you'll get there.

A Deep, Deep Hole with PulseAudio at the Very Beginning (on OpenWRT)

The nice people with the OpenWRT project and all their hard work is very much appreciated. But there are also the head scratching (and head exploding) moments too. For instance: How can so much effort be put into something, yet one little item is allowed to (or isn't configured correctly) remain in place that prevents the PulseAudio service from operating properly?

Short Answer: Configure and / or compile the PulseAudio Service in such way that it requires whatever user (including the ROOT User!) be a member of the audio Group. And then don't put that User in the Audio Group as part of the installation. There you go, problem created! And all the work done to include PulseAudio in OpenWRT? Pointless (until the issue is corrected).

The issue? As noted, the root User is not included in the audio Group. Add it in there using groupadd (which in and of itself is interesting to install) or just edit the /etc/group File.

Ready? Let's Install PulseAudio (and dependencies, plus other tools, and see what happens)

Installation of Software

opkg update

opkg install pulseaudio-daemon-avahi pulseaudio-profiles pulseaudio-tools

Do NOT install pulseaudio-daemon (plain), if you want to use Bluetooth to connect to Speakers. The pulseaudio-daemon-avahi contains the necessary bluetooth modules, pulseaudio-daemon (plain) does NOT. One can always disable the avahi service too, without affecting PulseAudio.

Dependencies include some basic ALSA (Advanced Linux Sound Architecture) stuff, but a couple of more items are nice to have for several reason, including testing, so;

opkg install alsa-utils alsa-ucm-conf mpd-full mpd-avahi-service mpc libmpdclient

...and maybe opkg install madplay mpg123 (they don't install any services, so they're just there if you need them)

The Errors

Are these the errors referred to earlier as the "show stopper" for PulseAudio. Nope. Just an annoyance that can be fixed.

chown: /dev/mixer: No such file or directory
chown: /dev/dsp: No such file or directory
chmod: /dev/mixer: No such file or directory
chmod: /dev/dsp: No such file or directory

Will this fix it (spoiler alert, NO, so like Frankie said "don't do it")?: opkg install gst1-mod-dvdspu gst1-mod-audiomixer (a bunch of dependencies would be installed too). We'll get to the fix later, let's focus on the "Show Stopper"

The "Show Stopper" for PulseAudio

Issue this command (it is for 'talking' to the PulseAudio Service): pactl list short sinks

The result: Connection failure: Access denied

Why (as noted earlier, but more details and a solution later): The root User (that's right, the ROOT user) doesn't have the privileges to execute the command. WTF!?

How long did it take to figure out and what was the anger level: 10 Page Diatribe DELETED

Solution: Add the root user to the Audio Group: nano /etc/group;

Before: audio:x:29:
After: audio:x:29:root,mpd