Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snapclient daemon on raspbian #229

Closed
deisi opened this issue Apr 2, 2017 · 4 comments
Closed

snapclient daemon on raspbian #229

deisi opened this issue Apr 2, 2017 · 4 comments

Comments

@deisi
Copy link

deisi commented Apr 2, 2017

I can't get snapclient to work properly under raspbian with the -d option. Without the daemon option snapclient starts. If I start it like:
sudo snapclient -d --user snapclient
It doesn't play anything. I have tried with different users, but no difference.

I have the impression, that it has something todo with pulseaudio, but just removing it didn't help, because I couldn't get Alsa to work properly either. Confusing is, that it works without the daemon option.

@badaix
Copy link
Owner

badaix commented Apr 3, 2017

It might happen that different users "steal" other user's privileges to play audio (kind of first comes, first served).
When running daemonized on my notebook (and being logged in a desktop session as normal user johannes), I can see such messages in /var/log/syslog:

[pulseaudio] main.c: Failed to acquire autospawn lock

or

[pulseaudio] sink-input.c: Failed to create sink input: sink is suspended.

changing the user in /etc/default/snapclient to my user name (or root) solves the problem for me:

USER_OPTS="--user johannes:audio"

On my headless Raspberry players I don't have a problem at all.
It might be a similar problem as reported here for MPD

@yannok
Copy link

yannok commented May 10, 2017

I face a very similar problem, if I launch snapclient as a service (sudo service snapclient start), I have no audio output and the service status says :


mai 11 00:45:33 tower-1 snapclient[10148]: daemon started
mai 11 00:45:33 tower-1 pulseaudio[10149]: [pulseaudio] main.c: Échec lors du démarrage du démon.
mai 11 00:45:33 tower-1 pulseaudio[10158]: [pulseaudio] pid.c: Daemon already running.
mai 11 00:45:33 tower-1 snapclient[10148]: Connected to 192.168.2.6
mai 11 00:45:33 tower-1 pulseaudio[10153]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
mai 11 00:45:33 tower-1 pulseaudio[10153]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

Yet, if I launch it manually, not as a service (sudo snapclient -d), it works fine.

When launched as a service (no sound), I find two pulseaudio processes running:

yann      1101  0.3  0.1 521052 12784 ?        Sl   mai10   0:31 /usr/bin/pulseaudio --start --log-target=syslog

yann     10770  0.0  0.0 247516  7828 ?        Ssl  00:53   0:00 /usr/bin/snapclient -d --user yann:audio -d -p 6680
yann     10775  1.0  0.1 515096 11792 ?        Sl   00:53   0:00 /usr/bin/pulseaudio --start --log-target=syslog

while launched manually (sound OK), there's only one pulseaudio process:

yann      1101  0.3  0.1 521124 12784 ?        Sl   mai10   0:31 /usr/bin/pulseaudio --start --log-target=syslog
root     11003  1.0  0.1 456316  8392 ?        S<sl 00:58   0:00 snapclient -d

I tried to change user in USER_OPTS but without success.

@tringler
Copy link

tringler commented Sep 8, 2017

Sorry to revive this issue, but I think I found a solution. (at least on my system)
Open /etc/passwd and change snapclient:x:999:29::/var/lib/snapclient: to snapclient:x:999:29::/var/lib/snapclient:/bin/nologin

I think without any assigned shell the user cannot handle the daemon.

By the way - snapclient:x:999:29::/var/lib/snapclient:/bin/false is also causing the issue.

@deisi
Copy link
Author

deisi commented Sep 30, 2017

So this seems to be more of a problem with pulseaudio and its specifics. I think its fair to close this.

@deisi deisi closed this as completed Sep 30, 2017
scheleaap added a commit to scheleaap/ansible-role-snapcast that referenced this issue Aug 27, 2018
If the user does not have shell set (and a specific one, at that), the client won't play audio properly.

See badaix/snapcast#229 (comment).
scheleaap added a commit to scheleaap/ansible-role-snapcast that referenced this issue Aug 27, 2018
If the user does not have shell set (and a specific one, at that), the client won't play audio properly.

See badaix/snapcast#229 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants