duncanthrax / scream

Virtual network sound card for Microsoft Windows
Microsoft Public License
1.69k stars 142 forks source link

Service file? #196

Open Mazvy opened 1 year ago

Mazvy commented 1 year ago

I followed the #155 issue and the service file is not working at all.

Has there been any changes to scream that broke it? Does anyone have a working service file?

Thanks!

* scream.service - Scream Receiver
   Loaded: loaded (/etc/systemd/system/scream.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2023-02-06 19:30:27 EET; 742ms ago
  Process: 22969 ExecStart=/usr/bin/scream (code=exited, status=1/FAILURE)
 Main PID: 22969 (code=exited, status=1/FAILURE)

Feb 06 19:30:27 trinity systemd[1]: scream.service: Service RestartSec=1s expired, scheduling restart.
Feb 06 19:30:27 trinity systemd[1]: scream.service: Scheduled restart job, restart counter is at 5.
Feb 06 19:30:27 trinity systemd[1]: Stopped Scream Receiver.
Feb 06 19:30:27 trinity systemd[1]: scream.service: Start request repeated too quickly.
Feb 06 19:30:27 trinity systemd[1]: scream.service: Failed with result 'exit-code'.
Feb 06 19:30:27 trinity systemd[1]: Failed to start Scream Receiver.
ProfessionalismIsMyMiddleName commented 1 year ago

I was having issues too. Using journalctl to look at the logs of the scream service, I saw that pulseaudio (or more accurately libpulse-dev) was throwing a "connection refused" error. In my case, this was because pulseaudio was starting with a different user than scream when scream was run through systemd I think. The solution I found is to create a pulseaudio service (as is implied by the "Wants" line in the scream service file), that starts pulseaudio with the same user as the scream service. I also kept the delay at 30 seconds instead of 3, but that's because pulse takes ~20s to start on my raspi 3, so it had time to try and fail to start 5 times (the max before it stops trying) when pulse was not yet done starting. You can play with the sleep time and RestartSec value to find a conf that works for you.

In any case, if you have an issue, you can start by looking at the scream service logs by doing journalctl -u scream.service -f