Code Monkey home page Code Monkey logo

Comments (11)

STUKguy avatar STUKguy commented on June 11, 2024 2

@tmiland Thank you again. i got it to work using what you said and a few modifications i dont know why i was trying to use Mopidy when all i needed was Snapserv & Snapclient but all picked up by Home Assistant

Also tried the Windows complier...i say tried i gave up after 5 hours and the instruction arent really helpfull, which is to bad as i have a Windows machine which is runing 24/7. Maybe one day someone will be something for Windows.

anyway thank you again.

from snapcast.

STUKguy avatar STUKguy commented on June 11, 2024 1

@tmiland Unfrotunatly i never did resolve this, an support appears to be lacking. I think it is to with the codec but this is beyond my understanding. I ended up for whole house audio going with the Windows version of LMS & Squeezelite (Support for the Debian version is also lacking)

from snapcast.

kingosticks avatar kingosticks commented on June 11, 2024 1

Based on a comment on another simular issue, i installed pulse. Mopidy which i use with SnapServer stopped working. Had to rebuild

"Rebuild" what? Exactly what operating system is this? Pi OS? Desktop? Lite? Is pulseaudio installed or not? Pi OS Lite does not come with Pulseaudio installed since it makes no sense on a headless system. Installed Pulseaudio system on such a system makes more problems than it solves.

If you are using Pulseaudio, then the issue will be that by default, pulse only provides audio to programs running as the logged on user. A program, such as snapclient, running under a different user account, cannot access audio devices. One way to workaround this is described at https://docs.mopidy.com/en/latest/running/service/#system-service-and-pulseaudio

I believe Pipewire has pretty much the same issue but I don't know how to workaround that.

from snapcast.

kingosticks avatar kingosticks commented on June 11, 2024 1

It's hard to guess the problem because the provided log is useless. That's probably not your fault.

It's very likely to be the issue I already explained when running the snapclient service and connecting to the audio server. Pulseaudio and Pipewire work very similarly in this respect. Most guides/instructions haven't been updated to handle Pipewire in Debian 12, it's relatively new. The Pipewire solution is very similar to the pulseaudio one I already posted.

Nothing to do with codecs. Using totally different software probably isn't going to help anyone else. But whatever works. Good luck.

from snapcast.

STUKguy avatar STUKguy commented on June 11, 2024 1

Found a solution

Run: sudo systemctl edit --full snapclient

Add: Environment="XDG_RUNTIME_DIR=/run/user/1000"

Change User to User=1000

[Service]
Environment="XDG_RUNTIME_DIR=/run/user/1000"
EnvironmentFile=-/etc/default/snapclient
ExecStart=/usr/bin/snapclient --logsink=system $SNAPCLIENT_OPTS
#User=snapclient
User=1000
Group=snapclient
Restart=always

Hey, Thank you for this. unfortunatly i have tried this with no luck. Its the starangest thing i managed to install snapclient, snaoserver & Mopidy on a VM and it appeared to work (kind of couldnt access Mopidy using the webui) but snap client had no errors.

Im going to try and do a fresh install of Debian 12 but with just snapserver & snapclient, if that doesnt work i will try and find a copy of Debian 11. Its too bad the Windows instructions dont make any sense to me as that would have been alot easier also you cant install Mopidy on Windows either.

from snapcast.

dustin-richards-was-here avatar dustin-richards-was-here commented on June 11, 2024

Looks like snapclient is perfectly happy when you're running it directly, and we can't see much with the systemctl status snapclient output since you only get the last few lines of the log. What's the result of this set of steps?

  1. journalctl -u snapclient --follow > snapclient.log
  2. systemctl restart snapclient (in a separate terminal)
  3. Kill the journalctl and post snapclient.log

This will let us see logs from start to end when snapcast attempts to start as a system service.

from snapcast.

STUKguy avatar STUKguy commented on June 11, 2024

Looks like snapclient is perfectly happy when you're running it directly, and we can't see much with the systemctl status snapclient output since you only get the last few lines of the log. What's the result of this set of steps?

  1. journalctl -u snapclient --follow > snapclient.log
  2. systemctl restart snapclient (in a separate terminal)
  3. Kill the journalctl and post snapclient.log

This will let us see logs from start to end when snapcast attempts to start as a system service.

Hey, Thank you for your reply.

I have ran the commands and this is the out put from the log

Dec 15 14:29:29 snap snapclient[11447]: Exception: Can't open default, error: Host is down, code: -112 Dec 15 14:29:29 snap snapclient[11447]: Exception: Can't open default, error: Host is down Dec 15 14:29:29 snap snapclient[11447]: Snapclient terminated. Dec 15 14:29:29 snap systemd[1]: snapclient.service: Main process exited, code=exited, status=1/FAILURE Dec 15 14:29:29 snap systemd[1]: snapclient.service: Failed with result 'exit-code'. Dec 15 14:29:29 snap systemd[1]: snapclient.service: Scheduled restart job, restart counter is at 5. Dec 15 14:29:29 snap systemd[1]: Stopped snapclient.service - Snapcast client. Dec 15 14:29:29 snap systemd[1]: snapclient.service: Start request repeated too quickly. Dec 15 14:29:29 snap systemd[1]: snapclient.service: Failed with result 'exit-code'. Dec 15 14:29:29 snap systemd[1]: Failed to start snapclient.service - Snapcast client. Dec 15 14:30:02 snap systemd[1]: Started snapclient.service - Snapcast client. Dec 15 14:30:02 snap snapclient[11497]: Version 0.27.0, revision 54a3d862 Dec 15 14:30:02 snap snapclient[11497]: Resolving host IP for: 192.168.68.47 Dec 15 14:30:02 snap snapclient[11497]: Connecting Dec 15 14:30:02 snap snapclient[11497]: Connected to 192.168.68.47 Dec 15 14:30:02 snap snapclient[11497]: My MAC: "d4:3b:04:d1:ad:fd", socket: 9 Dec 15 14:30:02 snap snapclient[11497]: ServerSettings - buffer: 1000, latency: 0, volume: 100, muted: 0 Dec 15 14:30:02 snap snapclient[11497]: Codec: flac, sampleformat: 48000:16:2 Dec 15 14:30:02 snap snapclient[11497]: Player name: alsa, device: default, description: Default ALSA Output (currently PipeWire Media Server), idx: 2, sharing mode: unspecified, parameters: <none> Dec 15 14:30:02 snap snapclient[11497]: Mixer mode: software, parameters: <none> Dec 15 14:30:02 snap snapclient[11497]: Sampleformat: 48000:16:2, stream: 48000:16:2 Dec 15 14:30:02 snap snapclient[11497]: Using default buffer_time: 80 ms, default fragments: 4 Dec 15 14:30:02 snap snapclient[11497]: Exception: Can't open default, error: Host is down, code: -112 Dec 15 14:30:02 snap snapclient[11497]: Exception: Can't open default, error: Host is down Dec 15 14:30:02 snap snapclient[11497]: Snapclient terminated. Dec 15 14:30:02 snap systemd[1]: snapclient.service: Main process exited, code=exited, status=1/FAILURE Dec 15 14:30:02 snap systemd[1]: snapclient.service: Failed with result 'exit-code'. Dec 15 14:30:02 snap systemd[1]: snapclient.service: Scheduled restart job, restart counter is at 1. Dec 15 14:30:02 snap systemd[1]: Stopped snapclient.service - Snapcast client. Dec 15 14:30:02 snap systemd[1]: Started snapclient.service - Snapcast client. Dec 15 14:30:02 snap snapclient[11521]: Version 0.27.0, revision 54a3d862 Dec 15 14:30:02 snap snapclient[11521]: Resolving host IP for: 192.168.68.47 Dec 15 14:30:02 snap snapclient[11521]: Connecting Dec 15 14:30:02 snap snapclient[11521]: Connected to 192.168.68.47 Dec 15 14:30:02 snap snapclient[11521]: My MAC: "d4:3b:04:d1:ad:fd", socket: 9 Dec 15 14:30:02 snap snapclient[11521]: ServerSettings - buffer: 1000, latency: 0, volume: 100, muted: 0 Dec 15 14:30:02 snap snapclient[11521]: Codec: flac, sampleformat: 48000:16:2 Dec 15 14:30:02 snap snapclient[11521]: Player name: alsa, device: default, description: Default ALSA Output (currently PipeWire Media Server), idx: 2, sharing mode: unspecified, parameters: <none> Dec 15 14:30:02 snap snapclient[11521]: Mixer mode: software, parameters: <none> Dec 15 14:30:02 snap snapclient[11521]: Sampleformat: 48000:16:2, stream: 48000:16:2 Dec 15 14:30:02 snap snapclient[11521]: Using default buffer_time: 80 ms, default fragments: 4 Dec 15 14:30:02 snap snapclient[11521]: Exception: Can't open default, error: Host is down, code: -112 Dec 15 14:30:02 snap snapclient[11521]: Exception: Can't open default, error: Host is down Dec 15 14:30:02 snap snapclient[11521]: Snapclient terminated. Dec 15 14:30:02 snap systemd[1]: snapclient.service: Main process exited, code=exited, status=1/FAILURE Dec 15 14:30:02 snap systemd[1]: snapclient.service: Failed with result 'exit-code'. Dec 15 14:30:02 snap systemd[1]: snapclient.service: Scheduled restart job, restart counter is at 2. Dec 15 14:30:02 snap systemd[1]: Stopped snapclient.service - Snapcast client. Dec 15 14:30:02 snap systemd[1]: Started snapclient.service - Snapcast client. Dec 15 14:30:02 snap snapclient[11545]: Version 0.27.0, revision 54a3d862 Dec 15 14:30:02 snap snapclient[11545]: Resolving host IP for: 192.168.68.47 Dec 15 14:30:02 snap snapclient[11545]: Connecting Dec 15 14:30:02 snap snapclient[11545]: Connected to 192.168.68.47 Dec 15 14:30:02 snap snapclient[11545]: My MAC: "d4:3b:04:d1:ad:fd", socket: 9 Dec 15 14:30:02 snap snapclient[11545]: ServerSettings - buffer: 1000, latency: 0, volume: 100, muted: 0 Dec 15 14:30:02 snap snapclient[11545]: Codec: flac, sampleformat: 48000:16:2 Dec 15 14:30:02 snap snapclient[11545]: Player name: alsa, device: default, description: Default ALSA Output (currently PipeWire Media Server), idx: 2, sharing mode: unspecified, parameters: <none> Dec 15 14:30:02 snap snapclient[11545]: Mixer mode: software, parameters: <none> Dec 15 14:30:02 snap snapclient[11545]: Sampleformat: 48000:16:2, stream: 48000:16:2 Dec 15 14:30:02 snap snapclient[11545]: Using default buffer_time: 80 ms, default fragments: 4 Dec 15 14:30:02 snap snapclient[11545]: Exception: Can't open default, error: Host is down, code: -112 Dec 15 14:30:02 snap snapclient[11545]: Exception: Can't open default, error: Host is down Dec 15 14:30:02 snap snapclient[11545]: Snapclient terminated. Dec 15 14:30:02 snap systemd[1]: snapclient.service: Main process exited, code=exited, status=1/FAILURE Dec 15 14:30:02 snap systemd[1]: snapclient.service: Failed with result 'exit-code'. Dec 15 14:30:02 snap systemd[1]: snapclient.service: Scheduled restart job, restart counter is at 3. Dec 15 14:30:02 snap systemd[1]: Stopped snapclient.service - Snapcast client. Dec 15 14:30:02 snap systemd[1]: Started snapclient.service - Snapcast client. Dec 15 14:30:02 snap snapclient[11569]: Version 0.27.0, revision 54a3d862 Dec 15 14:30:02 snap snapclient[11569]: Resolving host IP for: 192.168.68.47 Dec 15 14:30:02 snap snapclient[11569]: Connecting Dec 15 14:30:02 snap snapclient[11569]: Connected to 192.168.68.47 Dec 15 14:30:02 snap snapclient[11569]: My MAC: "d4:3b:04:d1:ad:fd", socket: 9 Dec 15 14:30:02 snap snapclient[11569]: ServerSettings - buffer: 1000, latency: 0, volume: 100, muted: 0 Dec 15 14:30:02 snap snapclient[11569]: Codec: flac, sampleformat: 48000:16:2 Dec 15 14:30:02 snap snapclient[11569]: Player name: alsa, device: default, description: Default ALSA Output (currently PipeWire Media Server), idx: 2, sharing mode: unspecified, parameters: <none> Dec 15 14:30:02 snap snapclient[11569]: Mixer mode: software, parameters: <none> Dec 15 14:30:02 snap snapclient[11569]: Sampleformat: 48000:16:2, stream: 48000:16:2 Dec 15 14:30:02 snap snapclient[11569]: Using default buffer_time: 80 ms, default fragments: 4 Dec 15 14:30:02 snap snapclient[11569]: Exception: Can't open default, error: Host is down, code: -112 Dec 15 14:30:02 snap snapclient[11569]: Exception: Can't open default, error: Host is down Dec 15 14:30:02 snap snapclient[11569]: Snapclient terminated. Dec 15 14:30:02 snap systemd[1]: snapclient.service: Main process exited, code=exited, status=1/FAILURE Dec 15 14:30:02 snap systemd[1]: snapclient.service: Failed with result 'exit-code'. Dec 15 14:30:02 snap systemd[1]: snapclient.service: Scheduled restart job, restart counter is at 4. Dec 15 14:30:02 snap systemd[1]: Stopped snapclient.service - Snapcast client. Dec 15 14:30:02 snap systemd[1]: Started snapclient.service - Snapcast client. Dec 15 14:30:02 snap snapclient[11593]: Version 0.27.0, revision 54a3d862 Dec 15 14:30:02 snap snapclient[11593]: Resolving host IP for: 192.168.68.47 Dec 15 14:30:02 snap snapclient[11593]: Connecting Dec 15 14:30:02 snap snapclient[11593]: Connected to 192.168.68.47 Dec 15 14:30:02 snap snapclient[11593]: My MAC: "d4:3b:04:d1:ad:fd", socket: 9 Dec 15 14:30:02 snap snapclient[11593]: ServerSettings - buffer: 1000, latency: 0, volume: 100, muted: 0 Dec 15 14:30:02 snap snapclient[11593]: Codec: flac, sampleformat: 48000:16:2 Dec 15 14:30:02 snap snapclient[11593]: Player name: alsa, device: default, description: Default ALSA Output (currently PipeWire Media Server), idx: 2, sharing mode: unspecified, parameters: <none> Dec 15 14:30:02 snap snapclient[11593]: Mixer mode: software, parameters: <none> Dec 15 14:30:02 snap snapclient[11593]: Sampleformat: 48000:16:2, stream: 48000:16:2 Dec 15 14:30:02 snap snapclient[11593]: Using default buffer_time: 80 ms, default fragments: 4 Dec 15 14:30:02 snap snapclient[11593]: Exception: Can't open default, error: Host is down, code: -112 Dec 15 14:30:02 snap snapclient[11593]: Exception: Can't open default, error: Host is down Dec 15 14:30:02 snap snapclient[11593]: Snapclient terminated. Dec 15 14:30:02 snap systemd[1]: snapclient.service: Main process exited, code=exited, status=1/FAILURE Dec 15 14:30:02 snap systemd[1]: snapclient.service: Failed with result 'exit-code'. Dec 15 14:30:03 snap systemd[1]: snapclient.service: Scheduled restart job, restart counter is at 5. Dec 15 14:30:03 snap systemd[1]: Stopped snapclient.service - Snapcast client. Dec 15 14:30:03 snap systemd[1]: snapclient.service: Start request repeated too quickly. Dec 15 14:30:03 snap systemd[1]: snapclient.service: Failed with result 'exit-code'. Dec 15 14:30:03 snap systemd[1]: Failed to start snapclient.service - Snapcast client.

from snapcast.

STUKguy avatar STUKguy commented on June 11, 2024

Looks like snapclient is perfectly happy when you're running it directly, and we can't see much with the systemctl status snapclient output since you only get the last few lines of the log. What's the result of this set of steps?

  1. journalctl -u snapclient --follow > snapclient.log
  2. systemctl restart snapclient (in a separate terminal)
  3. Kill the journalctl and post snapclient.log

This will let us see logs from start to end when snapcast attempts to start as a system service.

Still trying to resolve this issue, and i think it might be a dependancy issue, when i install Snapclient i get an error where it says libflac8 is not installed, Deb 12 uses libflac12. Where should i be getting libflac8 from? i think the version i am using is causing the problem.

from snapcast.

tmiland avatar tmiland commented on June 11, 2024

Hello,
I'm having the same issues.

sudo -u snapclient -g audio snapclient -h 192.168.1.200
2023-12-24 13-40-52.513 [Info] (Snapclient) Version 0.27.0, revision 54a3d862
2023-12-24 13-40-52.513 [Info] (Connection) Resolving host IP for: 192.168.1.200
2023-12-24 13-40-52.513 [Info] (Connection) Connecting
2023-12-24 13-40-52.513 [Notice] (Connection) Connected to 192.168.1.200
2023-12-24 13-40-52.532 [Info] (Controller) ServerSettings - buffer: 1000, latency: 0, volume: 100, muted: 0
2023-12-24 13-40-52.532 [Info] (Controller) Codec: flac, sampleformat: 44100:16:2
2023-12-24 13-40-52.532 [Info] (Player) Player name: alsa, device: default, description: Default ALSA Output (currently PipeWire Media Server), idx: 11, sharing mode: unspecified, parameters: <none>
2023-12-24 13-40-52.532 [Info] (Player) Mixer mode: software, parameters: <none>
2023-12-24 13-40-52.532 [Info] (Player) Sampleformat: 44100:16:2, stream: 44100:16:2
2023-12-24 13-40-52.532 [Info] (Alsa) Using default buffer_time: 80 ms, default fragments: 4
2023-12-24 13-40-52.558 [Error] (Alsa) Exception: Can't open default, error: Host is down, code: -112
2023-12-24 13-40-52.558 [Fatal] (Snapclient) Exception: Can't open default, error: Host is down
2023-12-24 13-40-52.558 [Notice] (Snapclient) Snapclient terminated.

From sudo journalctl -u snapclient --follow > snapclient.log

Dec 24 13:26:35 debian systemd[1]: Started snapclient.service - Snapcast client.
Dec 24 13:26:35 debian snapclient[41627]: Version 0.27.0, revision 54a3d862
Dec 24 13:26:35 debian snapclient[41627]: Resolving host IP for: 192.168.1.200
Dec 24 13:26:35 debian snapclient[41627]: Connecting
Dec 24 13:26:35 debian snapclient[41627]: Connected to 192.168.1.200
Dec 24 13:26:35 debian snapclient[41627]: ServerSettings - buffer: 1000, latency: 0, volume: 100, muted: 0
Dec 24 13:26:35 debian snapclient[41627]: Codec: flac, sampleformat: 44100:16:2
Dec 24 13:26:35 debian snapclient[41627]: Player name: alsa, device: default, description: Default ALSA Output (currently PipeWire Media Server), idx: 11, sharing mode: unspecified, parameters: <none>
Dec 24 13:26:35 debian snapclient[41627]: Mixer mode: software, parameters: <none>
Dec 24 13:26:35 debian snapclient[41627]: Sampleformat: 44100:16:2, stream: 44100:16:2
Dec 24 13:26:35 debian snapclient[41627]: Using default buffer_time: 80 ms, default fragments: 4
Dec 24 13:26:35 debian snapclient[41627]: Exception: Can't open default, error: Host is down, code: -112
Dec 24 13:26:35 debian snapclient[41627]: Exception: Can't open default, error: Host is down
Dec 24 13:26:35 debian snapclient[41627]: Snapclient terminated.
Dec 24 13:26:35 debian systemd[1]: snapclient.service: Main process exited, code=exited, status=1/FAILURE
Dec 24 13:26:35 debian systemd[1]: snapclient.service: Failed with result 'exit-code'.
Dec 24 13:26:35 debian systemd[1]: snapclient.service: Scheduled restart job, restart counter is at 5.
Dec 24 13:26:35 debian systemd[1]: Stopped snapclient.service - Snapcast client.
Dec 24 13:26:35 debian systemd[1]: snapclient.service: Start request repeated too quickly.
Dec 24 13:26:35 debian systemd[1]: snapclient.service: Failed with result 'exit-code'.
Dec 24 13:26:35 debian systemd[1]: Failed to start snapclient.service - Snapcast client.

Regards.

from snapcast.

STUKguy avatar STUKguy commented on June 11, 2024

Based on a comment on another simular issue, i installed pulse. Mopidy which i use with SnapServer stopped working. Had to rebuild

"Rebuild" what? Exactly what operating system is this? Pi OS? Desktop? Lite? Is pulseaudio installed or not? Pi OS Lite does not come with Pulseaudio installed since it makes no sense on a headless system. Installed Pulseaudio system on such a system makes more problems than it solves.

If you are using Pulseaudio, then the issue will be that by default, pulse only provides audio to programs running as the logged on user. A program, such as snapclient, running under a different user account, cannot access audio devices. One way to workaround this is described at https://docs.mopidy.com/en/latest/running/service/#system-service-and-pulseaudio

I believe Pipewire has pretty much the same issue but I don't know how to workaround that.

If you read my orignal post you will see this is built on a Debian 12 Operating System, a Debian 12 Laptop with the full OS no headless install. When you do a fresh install of Deb 12 Pulseaudio is not installed. Installing Pulseaudio just made things worse. So i tried solve my Snapclient issue with out Pulseaudio.

Snapclient was installed under the main user who has Sudoer rights. As i said previsouly i found an alternate solution.

from snapcast.

tmiland avatar tmiland commented on June 11, 2024

Found a solution

Run: sudo systemctl edit --full snapclient

Add: Environment="XDG_RUNTIME_DIR=/run/user/1000"

Change User to User=1000

[Service]
Environment="XDG_RUNTIME_DIR=/run/user/1000"
EnvironmentFile=-/etc/default/snapclient
ExecStart=/usr/bin/snapclient --logsink=system $SNAPCLIENT_OPTS
#User=snapclient
User=1000
Group=snapclient
Restart=always

from snapcast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.