quiniouben / vban

VBAN protocol open-source implementation
GNU General Public License v3.0
450 stars 63 forks source link

VBAN receptor works fine, unless executed as root as a service #88

Open darmach opened 4 months ago

darmach commented 4 months ago

Hi! I installed vban receptor on raspbian on rpi3. When ran as user everything works fine, plays the stream.

Added a service:

root@piban:~# cat /etc/systemd/system/vban-receiver.service
[Unit]
Description=VBAN Receiver

[Service]
Type=simple
ExecStart=/usr/local/bin/vban_receptor -i 192.168.1.2 -p 6980 -s StereoPi -q 0

[Install]
WantedBy=multi-user.target

When I run the service above or even manually run /usr/local/bin/vban_receptor -i 192.168.1.2 -p 6980 -s StereoPi -q 0 as root, the output is totally garbled, almost unrecognizable, and I do receive a lot of:

ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
Error: alsa_write: short write (expected 103, wrote 68)
Error: alsa_write: snd_pcm_writei failed: Broken pipe

Would you help me sort it out?

darmach commented 4 months ago

It looks like when ran as user I can use --quality 0, but on root I have to use 3 - otherwise I get the behaviour above (cabled connection)

darmach commented 4 months ago

Looks like both nice and scheduling priority is same whether executed in root session or user. Noticed that user session forks, while vban_receptor executed in root session does not fork.