I want to access sound without logging in, i.e. from the lightdm login screen. (The idea is to run spotifyd in the background, connect via phone to it, play some music).
I have a fresh manjaro install with xfce, if that matters.
When I login to xfce sound works fine, e.g. youtube or from terminal (“speaker-test -t sine -p 1”).
When I reboot, without login into my account via lightdm, but when I then ssh into the machine and login, I see that I have no soundcard.
[monkee@manjaro-TV ~]$ aplay -l
aplay: device_list:279: no soundcards found...
I guess the question is: How can I load my sound drivers/card right after boot in lightdm, without login into xfce. Other suggestions are also welcome, I am just guessing that this might solve this issue.
One additional info: The speakers are connected via USB if that matters.
Linux - generally speaking - is a multi user system - but a sound card is not a multi user device.
Imagine the conflicts if several users would use the sound card to play different files at the same time.
I am thinking you may be able to use pactl to enable the card and direct the sound to the usb-connected speakers.
I have seen a lot of topics on audio but I am not an audio user - in fact I prefer silence - it is easier to think and ponder on complex topics in silence.
One of the easier method would be something like plex or another media focused application where you can remotely control the system with a phone.
If user is logged in, speaker-test would usually play audio via software sound server PulseAudio or PipeWire (default output in aplay -L)
To play audio direct to an ALSA device (sydefault output(s) in aplay -L), ALSA device must be specified using option -D or --device, for example, To play audio to card 0, subdevice 0:
speaker-test -D hw:0,0 -t sine -p 1”
If no soundcards are found when logged in via SSH ALSA cannot load audio drivers to play audio.
there would also be no audio controls in alsamixer. If a software audio server was running and could not detect audio devices it would create a Dummy Output
There might be an issue with SSH permissions for audio devices in /dev/snd/
But I have never used SSH for networking audio
pactl info would show if PulseAudio/PipeWire was running and default-sink for audio playback
to check if either are using audio devices
sudo fuser --all --verbose /dev/snd/*
Manjaro is configured for one user account with a software audio server running in user-space