owntone / owntone-server

Linux/FreeBSD DAAP (iTunes) and MPD audio server with support for AirPlay 1 and 2 speakers (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio.
https://owntone.github.io/owntone-server
GNU General Public License v2.0
2.05k stars 235 forks source link

Forken-daapd crashes when user daapd is not in group audio #301

Closed LordMyschkin closed 7 years ago

LordMyschkin commented 7 years ago

I just tried to re-install forked-daapd by transfering my config-files into a frech installation and had very strange crashes before adding the user daapd (my forked-daapd user) to group audio; it was each time I tried to activate local out. Maybe there should be a check to prevent the service from crashing and instead provide a meaningful error message when a user selects local out which is somehow not accessible.

ejurgensen commented 7 years ago

I wasn't immediately able to reproduce this. Can you provide a bit more info to help with that? Like:

LordMyschkin commented 7 years ago

Of course: running latest debian jessie/raspian on my Raspberry Pi 2B with latest forked-daapd (24.1, a special branch of CHME with a persistent MPD queue), Local out is a usb soundcard set as default in ALSA. Thats the log output (I could reproduce the issue instantly); please note that the line concerning the inaccessible .asoundrc is normal and does not affect the working for forked-daapd: [2016-11-06 22:07:59] [ LOG] laudio: cannot stat file/directory /root/.asoundrc[2016-11-06 22:07:59] [ LOG] laudio: Could not open playback device: Keine Berechtigung [2016-11-06 22:07:59] [ LOG] player: Could not probe ALSA device 'Local_Out' [2016-11-06 22:07:59] [ LOG] player: Could not activate ALSA device 'Local_Out' [2016-11-06 22:07:59] [ LOG] mpd: Error executing command 'enableoutput': Speakers activation failed: 0

ejurgensen commented 7 years ago

So it crashes right after that? I'm still not having any luck reproducing this. Since I don't have usb soundcard, I just tried with the regular one, and it didn't produce any error, despite the user not being in the audio group. Then I faked an error from alsa like you got, but still no crash. Maybe if you could set the log level to DEBUG some clue will emerge?

LordMyschkin commented 7 years ago

Yes, crashed after that - I will try to reproduce the error as soon as I am home again.

LordMyschkin commented 7 years ago

Today, I am not able to reproduce the crash; the error persists, of course (cannot activate local out unless daapd is in group audio) , but no crash. Maybe a library update fixed the bug? I recommend to close the issue for now, If I am ever able to reproduce it, it still can be reopened. Sorry for wasting your resources...

ejurgensen commented 7 years ago

No problem, just let me know if you find a good way to reproduce.