ejurgensen
Posts: 575
Joined: Thu Jul 04, 2013 8:11 pm
Location: Denmark

Re: Improved forked-daapd (iTunes server)

Wed Jan 23, 2019 9:45 pm

I think it might take a month or two, more testing is required. However, you can always get the latest from github if clone the repo (or, if you already did, then run "git pull") and then build following the instructions in the INSTALL file. Just remember to backup your config file before running "sudo make install", since it will be overwritten.

cdlenfert
Posts: 49
Joined: Mon May 01, 2017 8:30 pm

Re: Improved forked-daapd (iTunes server)

Thu Jan 24, 2019 4:58 pm

Ahh, thanks! It didn't occur to me that it would pull the latest updates rather than the latest "release". All set on one of my boxes. On my box at work however I'm getting 500 errors trying to access the new "files" section. Trying some updates and rebooting to resolve.

Update: No luck. still getting

Code: Select all

Request failed (status: 500 Internal Server Error, url: http://10.1.10.123:3689/api/library/files?directory=%2Fhome%2Fshare%2F)
I have the forked-daapd user set to root and other areas of the web interface like "playlists" and "music" work normally. I've done a standard library rescan as well.

cdlenfert
Posts: 49
Joined: Mon May 01, 2017 8:30 pm

Re: Improved forked-daapd (iTunes server)

Fri Jan 25, 2019 5:12 pm

I get output in the browser if I go directly to http://forked-daapd.local:3689/api/libr ... home/share
Maybe the %2F is being output in the file path instead of /, but I don't know why it would be on one device and not the other.

Update/Fix: I figured out the issue was that in one of my forked-daapd.conf files I have the library directory as /home/share (no trailing slash) and in the one where the issue occurs it's /home/share/ (with a trailing slash). All other things within Forked-Daapd have been working fine with that config, but removing the slash fixed the issue with the new "files" section.

ejurgensen
Posts: 575
Joined: Thu Jul 04, 2013 8:11 pm
Location: Denmark

Re: Improved forked-daapd (iTunes server)

Sat Jan 26, 2019 10:51 pm

There was a bug in version 26.4.77 that would cause segfaults, so I have uploaded a new version 26.4.78 where it should be fixed.

bennor3814
Posts: 19
Joined: Fri Jan 25, 2019 4:11 pm

Re: Improved forked-daapd (iTunes server)

Mon Jan 28, 2019 4:06 pm

Forgive me if this has been asked/answered in the past been looking around and haven't seen anything specific on it yet.

Have installed to a Pi 3 B+ running Rasabian Lite but have run into a problem where the service stops all by itself and needs to be restarted. And the service isn't loaded (or loading) when the Pi is rebooted.

Is there a log file one can review to see what errors Forked Daapd is generating to track down issues?

What commands are used to add the service so it starts when the Pi is rebooted or powered on?

Can one point the media directory to a network NAS in addition to a location on a USB hard drive attached to the Pi?

ejurgensen
Posts: 575
Joined: Thu Jul 04, 2013 8:11 pm
Location: Denmark

Re: Improved forked-daapd (iTunes server)

Mon Jan 28, 2019 4:37 pm

bennor3814 wrote:
Mon Jan 28, 2019 4:06 pm
Is there a log file one can review to see what errors Forked Daapd is generating to track down issues?
Yes, see /var/log/forked-daapd.log. The command "service forked-daapd status" might also give you some info.
bennor3814 wrote:
Mon Jan 28, 2019 4:06 pm
What commands are used to add the service so it starts when the Pi is rebooted or powered on?
If you followed the instructions in the original post a .service file should have been installed that enables this. So check the former to see why it isn't working.
bennor3814 wrote:
Mon Jan 28, 2019 4:06 pm
Can one point the media directory to a network NAS in addition to a location on a USB hard drive attached to the Pi?
Yes, see https://github.com/ejurgensen/forked-da ... ork-mounts

bennor3814
Posts: 19
Joined: Fri Jan 25, 2019 4:11 pm

Re: Improved forked-daapd (iTunes server)

Mon Jan 28, 2019 7:07 pm

ejurgensen wrote:
Mon Jan 28, 2019 4:37 pm
Yes, see /var/log/forked-daapd.log. The command "service forked-daapd status" might also give you some info.

If you followed the instructions in the original post a .service file should have been installed that enables this. So check the former to see why it isn't working.

Yes, see https://github.com/ejurgensen/forked-da ... ork-mounts
Thanks for the replies. I did follow the directions in the original post and for some reason forked-daapd.service is disabled on my end. <shrugs> :lol:

Edit to add: Forked-daapd.service was missing (on my end) in the /etc/systemd/system/ folder. Running the following commands fixed the issue for me and forked-daapd now starts on boot (for me). :)

Code: Select all

sudo cp /lib/systemd/system/forked-daapd.service /etc/systemd/system/
sudo systemctl enable forked-daapd.service

bennor3814
Posts: 19
Joined: Fri Jan 25, 2019 4:11 pm

Re: Improved forked-daapd (iTunes server)

Wed Jan 30, 2019 5:12 pm

This may be a rather noob question but has anyone successfully gotten Bluetooth output to a Bluetooth speaker working Forked-Daapd installed on the current version of Raspbian Stretch Lite (November 2018) on a Pi board that has embedded Bluetooth?

Followed the 2017 directions (https://github.com/ejurgensen/forked-da ... E_PULSE.md) to try and enable the forked-daapd to output audio to a Bluetooth speaker on a Pi 3 B+, but am running into a number of errors, particularly with PluseAudio, and ultimately the Bluetooth connection fails work. 3.5 plug speaker output for forked-daapd audo works fine.

notlbishop
Posts: 7
Joined: Fri Nov 02, 2018 7:47 pm

Re: Improved forked-daapd (iTunes server)

Thu Jan 31, 2019 3:03 pm

Have been searching for a solution to a particular scenario for some time without luck but i think this might give me what i need!

I have two apple homepods one upstairs one down. My use case is quite simple, in the mornings i would like my pi to use a radio stream url (bbc2) as an alarm and automatically airplay to the homepods.

It seems like it’s possible using forked-daapd and some scripting. Can anyone confirm?

Thanks

Leigh

EckartH
Posts: 10
Joined: Sun Feb 03, 2019 12:35 pm

Re: Improved forked-daapd (iTunes server)

Sun Feb 03, 2019 12:49 pm

I am new here. I installed a week ago. And everything ran fine for days. Apart from the problem that system.d started forked-daapd before my network volume with the media was made available. I tried to fix that by launching forked-daapd with a script.

But now I am stuck with: kernel:

Code: Select all

Out of memory: Kill process 2411 (forked-daapd) score 788 or sacrifice child
It is still the ordinary system.d launch process. It starts to fill the data base which is empty as the network volume was not available in time when the system booted. But after a minute it crashes.

The system had build the data base a couple of times before without problem.

I am running a raspPi 1 with rasbian stretch.
Attachments
forked-daapd.log.zip
(4.79 KiB) Downloaded 25 times

EckartH
Posts: 10
Joined: Sun Feb 03, 2019 12:35 pm

Re: Improved forked-daapd (iTunes server)

Sun Feb 03, 2019 1:12 pm

Ok, I spoke too fast. I had done one more thing: added the definition of 2 smart playlists. That seems to trigger the problem. May be I am asking for too much from this little system.

I deleted the two .smartpl files. And the data base builds again.

Now back to my problem that I need to delay the launch until after the network volume is mounted. I added "media-music.mount" to the list of "After" units and tried "RequiresMountsFor=/media/music" in forked-daapd.service to no avail. Any hint?
Last edited by EckartH on Mon Feb 04, 2019 11:56 am, edited 1 time in total.

ejurgensen
Posts: 575
Joined: Thu Jul 04, 2013 8:11 pm
Location: Denmark

Re: Improved forked-daapd (iTunes server)

Sun Feb 03, 2019 6:29 pm

Interesting that smart playlists can cause out of memory. I can't think of any particular reason for that.

The deb file from my repo installs a service file with After=remote-fs.target, I would think that should do it. Is it possible you aren't mounting via systemd?

EckartH
Posts: 10
Joined: Sun Feb 03, 2019 12:35 pm

Re: Improved forked-daapd (iTunes server)

Sun Feb 03, 2019 9:03 pm

"After=remote-fs.target" is in the service file.

The mount is defined in /etc/fstab which then will be handled by systemd as far as I understand. The options are x-systemd.automount,auto.

But is it an afp mount, which I think is not a that well tested piece of code.

ejurgensen
Posts: 575
Joined: Thu Jul 04, 2013 8:11 pm
Location: Denmark

Re: Improved forked-daapd (iTunes server)

Sat Feb 09, 2019 8:02 pm

I have uploaded forked-daapd version 26.4.79 with these fixes/improvements (again with lots of credit to chme):

1. Use Spotify's new web api for artwork, since previous method seems discontinued by Spotify
2. New JSON api endpoints (see doc on github)
3. Fix for the "permanent" setting not working
4. Fix parsing of iTunes "Play Date"
5. Support for mpd version 0.20
6. Fix parsing of "before" in smart playlists

chme
Posts: 37
Joined: Tue May 06, 2014 7:53 pm

Re: Improved forked-daapd (iTunes server)

Sun Feb 10, 2019 8:17 am

notlbishop wrote:
Thu Jan 31, 2019 3:03 pm
Have been searching for a solution to a particular scenario for some time without luck but i think this might give me what i need!

I have two apple homepods one upstairs one down. My use case is quite simple, in the mornings i would like my pi to use a radio stream url (bbc2) as an alarm and automatically airplay to the homepods.

It seems like it’s possible using forked-daapd and some scripting. Can anyone confirm?

Thanks

Leigh
That should be possible. You can e. g. create a shell script that uses curl to tell forked-daapd to start playing the radio stream to the two airplay speakers (take a look at the forked-daapd JSON API to see what is possible: https://github.com/ejurgensen/forked-da ... SON_API.md). You can then setup a cron job to execute this shell script in the morning (see https://www.raspberrypi.org/documentati ... ge/cron.md)

beniamino
Posts: 4
Joined: Mon Feb 11, 2019 4:50 pm

Re: Improved forked-daapd (iTunes server)

Mon Feb 11, 2019 5:08 pm

I've been having some trouble with forked-daapd using a music collection on a remote raspberry pi. The remote machine servers the library over NFS, and the local machine mounts it using an entry in /etc/fstab:

Code: Select all

pi-sitting:/ext   /remote   nfs    defaults,_netdev,nofail,x-systemd.automount,x-systemd.mount-timeout=15,ro  0  0
Everything works fine so long as the remote machine is permanently available. But if I use forked-daapd on the local machine while the NFS share is not available, it seems that forked-daapd detects the music directory as being empty, and deletes all the entries from its database. I would expect forked-daapd to detect that the music directory doesn't exist, and to do nothing to the database, so that the DB is intact when the network mount is available again. This is a problem because reconstructing the database takes several hours.

Is there any way to stop forked-daapd from deleting its database under these circumstances?

Thanks!

ejurgensen
Posts: 575
Joined: Thu Jul 04, 2013 8:11 pm
Location: Denmark

Re: Improved forked-daapd (iTunes server)

Mon Feb 11, 2019 9:37 pm

Well would should happen is that everything gets disabled, not deleted, so maybe there is a bug. If you could add an issue on github with exact steps to reproduce it would be very helpful.

beniamino
Posts: 4
Joined: Mon Feb 11, 2019 4:50 pm

Re: Improved forked-daapd (iTunes server)

Mon Feb 11, 2019 11:04 pm

Thanks for your reply! I have filed https://github.com/ejurgensen/forked-daapd/issues/690. In the process, I realised that I mischaracterised the problem. The database is not emptied -- the database file stays the same size. But music is not available, even after the NFS share reconnects, after an init-rescan and after forked-daapd is restarted. Only a full rescan is enough to make the music available again.

bennor3814
Posts: 19
Joined: Fri Jan 25, 2019 4:11 pm

Re: Improved forked-daapd (iTunes server)

Wed Feb 13, 2019 5:38 pm

Question. Any particular reason why I'm seeing "web: LWS Ran out of header data space" entries in the log file when I cannot reach the web interface? Getting "Connection lost. Reconnecting ... (6)" when attempting to access the web interface.

Edit to add: After some further investigation the underlying forked daapd program appears to still work it's just the web server side of the program is not working. Retune on Android can connect and initiate playing music. It appears the web sever side of the application appears to have stopped working properly after installing the COPS ebook server program (https://github.com/seblucas/cops/) on the same Pi. This Pi is running Pi-Hole and Plex on Stretch Lite. The web server appears to be Lighttpd installed by Pi-Hole.

When installing COPS I install the following packages: php7.0-gd php7.0-sqlite3 php7.0-json php7.0-intl php7.0-xml php7.0-mbstring php7.0-zip. The COPS program is extracted to a folder under the web server directory.

EckartH
Posts: 10
Joined: Sun Feb 03, 2019 12:35 pm

Re: Improved forked-daapd (iTunes server)

Thu Feb 14, 2019 8:33 pm

@beniamino
Everything works fine so long as the remote machine is permanently available. But if I use forked-daapd on the local machine while the NFS share is not available, it seems that forked-daapd detects the music directory as being empty, and deletes all the entries from its database. I would expect forked-daapd to detect that the music directory doesn't exist, and to do nothing to the database, so that the DB is intact when the network mount is available again. This is a problem because reconstructing the database takes several hours.

Is there any way to stop forked-daapd from deleting its database under these circumstances?
I think I understand your problem, as I make the same observation.

I get around this problem by adding the line

Code: Select all

ExecStartPre=/usr/local/lib/forked-daapd-starter.sh > /dev/null
to /lib/systemd/system/forked-daapd.service in the Service section. And the script /usr/local/lib/forked-daapd-starter.sh has the content

Code: Select all

#!/bin/sh
#

if df -h | grep -i -q bananaPi:music ; then
	exit 0
fi

sleep 30s
ls -d /media/music/Yes > /dev/null

exit $?
bananaPi:music is my remote share. That way the daemon does not get started if your data is not available after you let the automounter try again. The latter is the sole purpose of the ls ... statement.

EckartH
Posts: 10
Joined: Sun Feb 03, 2019 12:35 pm

Re: Improved forked-daapd (iTunes server)

Sun Feb 17, 2019 1:42 pm

Since a few days I encounter the strange situation that iOS "remote" on my iPad and my iPhone both claim that I have no songs in the library when I look in the "Artists" or "Albums" pane. However, when I go to "Search," it will find whatever I am looking for; moreover playlists are shown and work fine.

The web interface works flawlessly.

This situation withstand several reboots of the server and killing the iOS app.

Remedy?

ejurgensen
Posts: 575
Joined: Thu Jul 04, 2013 8:11 pm
Location: Denmark

Re: Improved forked-daapd (iTunes server)

Sun Feb 17, 2019 2:25 pm

You could try deleting the cache. Just stop forked-daapd, delete cache.db (probably in /var/cache/forked-daapd/) and restart.

EckartH
Posts: 10
Joined: Sun Feb 03, 2019 12:35 pm

Re: Improved forked-daapd (iTunes server)

Sun Feb 17, 2019 9:03 pm

That seems to have solved the problem.

tenbagger
Posts: 5
Joined: Sun Feb 17, 2019 8:53 pm

Re: Improved forked-daapd (iTunes server)

Sun Feb 17, 2019 9:50 pm

Thank you so much for your continued effort with this software gem. If the problem I'm describing is due to my lack of understanding or my lack of reading, I apologise.

I have 25.000+ songs on an ExFat disk shared between iTunes and forked-daapd. The library is maintained using iTunes, and I have an automated process for copying (my playlists from) the current iTunes Library.xml file from ~/Music to /Volumes/Music/iTunes which contains all the music files.

After introducing iTunes Library.xml, I see many, many lines in /var/log/forked-daapd.log starting with "scan: No file matches iTunes XML entry". All the files in question are present in the library, including the ones listed in the log file – I can even play them in forked-daapd! But the songs are missing from their respective play lists.

From what I can see, songs with non-english letters in their title are affected by this. Am I missing some setup parameter, perhaps?

ejurgensen
Posts: 575
Joined: Thu Jul 04, 2013 8:11 pm
Location: Denmark

Re: Improved forked-daapd (iTunes server)

Mon Feb 18, 2019 2:19 pm

Maybe there is a bug in the string comparisons if the filename has international characters. Could you give an example of a file that is not matched? I would like to know the filename + path in your library, and also how the item is listed in the xml (so try to find it there and post the info).

Return to “Raspbian”