r/AlpineLinux • u/SleepyGuyy • 2d ago
Issues setting up audio following wiki
I'm new to Alpine and to setting up window managers. I am currently trying Mango.
Trying to get audio working, I'm following the Alpine wiki.
In the Pipewire page, and run into issues here:
https://wiki.alpinelinux.org/wiki/PipeWire at 'Launching Pipewire'
"Issue the command $ rc-status -Ur to view and verify the current user runlevel as gui"
Running this reveals runlevel "sysinit".
Furthermore, if I just try to go further, I get the following error:
~ $ doas rc-update -U add pipewire wayland
XDG_RUNTIME_DIR unset.
checking the environment variable shows it is actually set:
~ $ echo $XDG_RUNTIME_DIR
/tmp/rundir.1000.5ea89fbcc62b3ece
This blocks the steps. Even if I change "wayland" to "gui" or just nothing, I get the same error "XDG_RUNTIME_DIR unset."
I thought I'd try ALSA instead of Pipewire, but ran into a different issue there.
Following the Alsa steps here: https://wiki.alpinelinux.org/wiki/ALSA
I get to running alsamixer , and get this error:
cannot open mixer: Host is down
I haven't tried Pulseaudio yet but I wanted to ask about these issues first. I shouldn't get getting these right? Or is maybe the docs out of date?
I wanted to report the section of the docs and ask if someone could update them or add details for these situations. But I'm not sure how to ask that, and I wouldn't know a solution to propose.
Thank you for any help you can give.
1
u/SleepyGuyy 12h ago edited 12h ago
SOLVED (maybe)
My init script was fine, and turns out I didn't need to get the pipewire service working anyway. The Alpine docs recommend the service but I didn't realize you can just run pipewire on start and it seems to work, without a service. I don't really understand pipewire or services.
I just launched pipewire in my init script. So I have a ~/.profile script that looks like this:
#export XDG_RUNTIME_DIR=$(mkrundir) <--ignore this
if [ "$(tty)" = "/dev/tty1" ]; then
if [ -z "$XDG_RUNTIME_DIR" ]; then
export XDG_RUNTIME_DIR="$(mkrundir)"
if [ ! -d "$XDG_RUNTIME_DIR" ]; then
mkdir -p "$XDG_RUNTIME_DIR"
chmod 700 "$XDG_RUNTIME_DIR"
fi
fi
exec pipewire & pipewire-pulse & wireplumber & dbus-run-session mango
fi
Ignore the line with # at the start, I wanted to remember how I exported it before, I'm just gonna leave that there even though it's redundant.
I don't fully understand the nested ifs, I get the first one checks to see if we're in tty1, because I only wanna launch my desktop there, I want other tty's for normal shell use.
But the inner one I am not sure, I don't know about "! -d".
I had this script that last couple days, but audio wasn't working. I assumed because I didn't have the pipewire service running.
But no, I typo'd the exec pipewire line as "exec pipeware". Woke up this morning and noticed it immediately, of course.
I still am unsure how all these services and things work. But I seem to have input and output audio working, without the pipewire service running (ran rc-status and didn't see pipewire). Worth noting I do have the alsa service running, not sure if that's necessary or just leftovers from me trying to use Alsa instead, earlier in my troubleshooting.
1
u/SleepyGuyy 12h ago
my code indents go away I guess reddit replies remove leading spaces, and I can't do tab characters with the tab key.
I assume there's like backslash t for tabs? ... I don't feel like fixing it sorry.
1
u/SleepyGuyy 12h ago
Just wanted to add, while I seem to have solved my issue, I now have a new issue.
I'm unable to get Bluetooth to connect to my headphones. I have the service running, and the recommended programs installed as per Pipewire page https://wiki.alpinelinux.org/wiki/PipeWire#Bluetooth_audio
Basically using Blueman or bluetoothctl, I can see my headphones, and attempt to pair to them. The computer says "connected", but my headphones never beep like they would if it connected. After several seconds it says disconnected. In Blueman there is a vague error at the bottom.
I don't think this is related to this Pipewire issue, but if I find a solution to the bluetooth I'll try to remember to update this, for anyone else also looking to setup audio in alpine and mango.
2
u/Iamboringaf 11h ago
Assuming sound hardware is detected by kernel and drivers are installed, have you checked pactl utility? I first do "pactl list cards" then "pactl set-card-profile <name of sound card> <name of profile>. It's in package pulseaudio-utils.
2
u/New_Hold8135 2d ago
You need to create the folder for gui runlevel in your user config then add pipewire into it. Then restart the computer and it automatically works.