Goal: Play music on a server, preferably using cmus, using SSH for player control.
First try: cmus
I run cmus
in a terminal, literally nothing happens. It just loads (i guess). Tried cmus -vvvvv
- Also just loads. Tried this and this - No changes to the issue. But: running it from a physical terminal on the computer works! (Both starting cmus, and playing audio successfully)
Second try: MOC
Running mocp
opens it up, I can add files too. When trying to play a song, this message appears: can't open audio: device or resource busy MOC
- No possible solution found.
Third try: mp3blaster
It starts. I can add files. It doesn't play: Failed to open sound device
Tried several suggestions (very outdated) from google, nothing helped. The one that seemed to help many others with this was padsc mp3blaster
- But again, no help for me.
I am using ALSA with PulseAudio. Audio itself works fine. play
or mplayer
both work fine, but they don't offer libraries and playlists. Both work fine over SSH too.
I'm really clueless to what to do here since cmus doesn't print anything and . I checked mplayer
works finealsamixer
and nothing is muted or disabled. There's only one single soundcard.
Not trying to have a broad suggest-me-something question here, I just added the other players since it might help find the issue, but the question aims to focus on getting cmus
to work.
I've tried DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus cmus
too (found here), same result.
Edit: TO BE CLEAR: The music is on the machine I SSH into and I want to play the music locally from the machine, controlling the CLI music player via SSH. Sorry for the confusion. I'm not trying to stream audio over SSH. I just want to use cmus
in an SSH Terminal to play music that already is on the server I'm connecting to.
Edit: mplayer
doesn't work anymore either, it used to all the time until I just tried:
AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'
[AO_ALSA] alsa-lib: pcm_hw.c:1602:(snd_pcm_hw_open) open '/dev/snd/pcmC0D0p' failed (-16): Device or resource busy
[AO_ALSA] alsa-lib: pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
[AO_ALSA] Playback open error: Device or resource busy
Failed to initialize audio driver 'alsa'
[AO SDL] Samplerate: 32000Hz Channels: Stereo Format s16le
[AO SDL] using aalib audio driver.
[AO SDL] Unable to open audio: No available audio device
Failed to initialize audio driver 'sdl:aalib'
Could not open/initialize audio device -> no sound.
Audio: no sound
Video: no video
Same for play
:
ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
play FAIL formats: can't open output file `default': snd_pcm_open error: Device or resource busy
I've tried it as root
too, same result. But: If I run either as the user which is logged into the X session (even over SSH), it works.
mp3blaster
, make sure it has selected the SDL audio driver, and then try forcing SDL to use the right backend withexport SDL_AUDIODRIVER=pulseaudio
or maybeexport SDL_AUDIODRIVER=alsa
mplayer
output show which audio device it eventually uses?play
.