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

Re: Improved forked-daapd (iTunes server)

Sun Oct 29, 2017 10:19 pm

These Airplay ports are dynamic (meaning they can change over time), so you can't make static firewall rules for them. Not sure why it is like that, but that's how it works.

skecher
Posts: 48
Joined: Sat Dec 19, 2015 9:59 pm

Re: Improved forked-daapd (iTunes server)

Sun Oct 29, 2017 10:21 pm

The one I noticed was on the forked-daapd side (i.e. it was the destination). Not sure why the destination might be dynamic ... but it works for now for me, it doesn't seem to change from restart to restart.
Linux and Raspberry Pi resources: http://caesarsamsi.wordpress.com

skecher
Posts: 48
Joined: Sat Dec 19, 2015 9:59 pm

Re: Improved forked-daapd (iTunes server)

Sun Oct 29, 2017 10:25 pm

You're right it changes between restarts ... bummer ...

The source post is always 6002 though, but I didn't see how I'd create such a rule in ufw.

Basically allow from any ip and port 6002 in.
Linux and Raspberry Pi resources: http://caesarsamsi.wordpress.com

skecher
Posts: 48
Joined: Sat Dec 19, 2015 9:59 pm

Re: Improved forked-daapd (iTunes server)

Mon Oct 30, 2017 3:21 pm

Scenario:
1. I have the pi on my WiFi router on a 192 subnet.
2. My remotes are also on the same 192 subnet
3. I have ufw enabled on the pi

Problem: I can not select speaker from remote.

If I disable ufw, speaker selection works, but I want ufw.

ufw doesn't have a rule that allows what I need to do (allow when source port is 6002).

I found an iptables rule that works.
Oct 29 15:04:44 airplay kernel: [ 2553.289520] [UFW BLOCK] IN=wlan0 SRC=192.168.1.76 DST=192.168.1.4 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=5280 PROTO=UDP SPT=6002 DPT=58750 LEN=40
The source port is always 6002. The following iptables rule allow for that port and restricts inbound to the 192.168.1.0/24 subnet.

Code: Select all

sudo iptables -A INPUT -p udp --sport 6002 --src 192.168.1.0/24 -j ACCEPT
Warning: this rule allows any ip address in 192.168.1.0/24 subnet in so long as it uses port 6002 as the source port.

By changing the src you can restrict it down to 1 ip address (e.g. use 192.168.1.2 ip address)
Linux and Raspberry Pi resources: http://caesarsamsi.wordpress.com

skecher
Posts: 48
Joined: Sat Dec 19, 2015 9:59 pm

Re: Improved forked-daapd (iTunes server)

Sat Nov 04, 2017 8:00 pm

Hi,

OK it's 99% working now with Remote from iTunes.

I copied my music from iTunes /Music folder on to a USB flash drive.

Many of the artworks don't show now. How can I get the artworks from iTunes transferred?

Thank you, Caesar.
Linux and Raspberry Pi resources: http://caesarsamsi.wordpress.com

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

Re: Improved forked-daapd (iTunes server)

Sun Nov 05, 2017 10:05 pm

A bit overdue, but now I've updated my RPi release to version 25.0.64. The improvements in this version are:
- fix problem that forked-daapd did not start after reboot
- fix for Hyperfine Remote for Android
- restore support for updated ATV4/tvOS11
- web interface now supports LastFM login
- significantly faster playlist scanning (+ don't scan if unmodified)

Enjoy!

skecher
Posts: 48
Joined: Sat Dec 19, 2015 9:59 pm

Re: Improved forked-daapd (iTunes server)

Sun Nov 05, 2017 11:37 pm

Awesome, congrats. Artwork is showing up.
Linux and Raspberry Pi resources: http://caesarsamsi.wordpress.com

skecher
Posts: 48
Joined: Sat Dec 19, 2015 9:59 pm

Re: Improved forked-daapd (iTunes server)

Tue Nov 07, 2017 3:57 pm

How are Playlists supposed to work?
  • Does it use the Playlist created in iTunes?
  • Is it imported manually from iTunes playlist export?
  • I'd really rather not create it manually, but if it is so, how would you do it?
The playlist tab of Remote for iTunes currently shows:
- Library
- Movies
- Music

When I tap them, they do contain the items representative of the folders.

P.S. I have forked-daapd music library pointed to a share of iTune's Music folder.
Linux and Raspberry Pi resources: http://caesarsamsi.wordpress.com

skecher
Posts: 48
Joined: Sat Dec 19, 2015 9:59 pm

Re: Improved forked-daapd (iTunes server)

Tue Nov 07, 2017 4:04 pm

Just found this: https://github.com/ejurgensen/forked-da ... SMARTPL.md

Would it be possible to use exported iTunes playlists instead?
Linux and Raspberry Pi resources: http://caesarsamsi.wordpress.com

skecher
Posts: 48
Joined: Sat Dec 19, 2015 9:59 pm

Re: Improved forked-daapd (iTunes server)

Tue Nov 07, 2017 4:13 pm

Where is forked-daapd's pid file located? I didn't find it in /var/run.

If there isn't a pid file, perhaps create the file /var/run/forked-daapd.pid containing the pid of forked-daapd process.
Linux and Raspberry Pi resources: http://caesarsamsi.wordpress.com

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

Re: Improved forked-daapd (iTunes server)

Tue Nov 07, 2017 6:18 pm

If you have made playlists in iTunes it should be as simple as making sure "iTunes Music Library.xml" is available to forked-daapd in the directories that get scanned. No need to export anything. Forked-daapd should also automatically update the playlists when the file is updated (if it is not a network mount).

Forked-daapd does not create a PID file when it is started in foreground mode (the -f flag). The systemd "forked-daapd.service" file starts forked-daapd in foreground mode because I once read somewhere that that is the best thing to do :-) I think you can make a custom service file in /etc/systemd/system if you want to start in background mode.

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

Re: Improved forked-daapd (iTunes server)

Tue Nov 07, 2017 9:12 pm

I've tried reading through some of the prior discussions on this thread, but I'm not able to conclude if it's possible or not (and if so how) to control Forked-Daapd via HTTP requests. I've got an app on my Pebble watch that can send them and it would be great to use it to play/pause/skip in Forked-Daapd. Any input would be much appreciated.

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

Re: Improved forked-daapd (iTunes server)

Tue Nov 07, 2017 9:58 pm

Hats of for going through this thread! Yes, it is possible, the generel principle is outlined here. But before you dive into that, you might want to consider using a Pebble MPD client instead. A Google search says that there is this: https://github.com/Sorunome/pebble-mpd-client

The thing is: Sending simple start/stop commands to forked-daapd might quickly feel a bit too primitive. I believe you will soon also want to get stuff back from the server. What is playing, volume settings, queue etc. And then you need to start parsing daap, which is not trivial.

If you still want to go with commands then a way to find out what they are is to set the log level to debug, connect with Remote and do the actions you want. You can then find the commands in the log, they will start with "DACP request" + the actual GET request. The port to use is 3689.

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

Re: Improved forked-daapd (iTunes server)

Wed Nov 08, 2017 4:25 pm

Thanks for pointing me in the right direction. The MPD client approach definitely seems like the best way to go. Is the MPD functionality on Forked-Daapd enabled by default on installations? I tried connecting to via the Pebble app, but I think I got the port wrong (using the standard http port instead of the mpd port) "By default forked-daapd listens on port 6600 for MPD clients". I'll give it another go when I'm on my local network, but mostly wanted to see if there's a way to confirm that the MPD feature is enabled on my setup.

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

Re: Improved forked-daapd (iTunes server)

Wed Nov 08, 2017 4:38 pm

Yes, mpd support is normally enabled out of the box.

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

Re: Improved forked-daapd (iTunes server)

Thu Nov 09, 2017 3:16 pm

I got it all set up, and it's awesome! So much better than using http requests. Once I got the port correct and realized I didn't need to enter a password, setup was a breeze. Controlling my Pi with my Pebble is super handy. Thanks for the help.

Akshunhiro
Posts: 2
Joined: Sun Nov 12, 2017 12:21 pm

Re: Improved forked-daapd (iTunes server)

Sun Nov 12, 2017 12:23 pm

Sorry in advance for the noob question but how do I get this to start automatically at boot?

I'm using Raspbian Jessie on a Pi3.

Edit: Fixed using update-rc.d
Last edited by Akshunhiro on Mon Jan 08, 2018 9:09 am, edited 1 time in total.

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

Re: Improved forked-daapd (iTunes server)

Sat Jan 06, 2018 7:22 pm

I've released 25.0.65 (git 8d043dd) for Stretch and Jessie. Nothing major in this update, just improvements, some fixing up and under-the-hood changes. There are some new mpd commands supported and also some improvements to the web interface/JSON API.

Akshunhiro
Posts: 2
Joined: Sun Nov 12, 2017 12:21 pm

Re: Improved forked-daapd (iTunes server)

Mon Jan 08, 2018 8:42 am

I've updated but it appears to have broken my playback from Digitally Imported. I have a PLS with my favourites but forked-daapd fails with error;

Code: Select all

[2018-01-08 08:28:10] [  LOG]     daap: Invalid query '###MY PREMIUM LISTEN KEY###' in request: 'http://prem3.di.fm:80/progressive_hi?###MY PREMIUM LISTEN KEY###'
[2018-01-08 08:28:10] [  LOG]     http: Couldn't parse internet playlist: 'http://prem3.di.fm:80/progressive_hi?###MY PREMIUM LISTEN KEY###'
[2018-01-08 08:28:10] [  LOG]   player: Failed to open 'http://prem3.di.fm:80/progressive_hi?###MY PREMIUM LISTEN KEY###' (id=373, item-id=803)
[2018-01-08 08:28:10] [  LOG]     dacp: Could not start playback
The link has my unique number after the ? so doesn't know how to handle it.

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

Re: Improved forked-daapd (iTunes server)

Mon Jan 08, 2018 7:17 pm

Sorry about that, but thanks for notifying me. I have made a fix (available from Github) and it will be included in the next release, which I will try to make soon.

jddj
Posts: 5
Joined: Fri Jul 15, 2016 7:08 pm

Re: Improved forked-daapd (iTunes server)

Tue Jan 09, 2018 9:48 pm

I'm running forked-daapd on Debian Buster with a QNAP TS-119+ NAS - thanks so much ejurgensen for making it work SO much better!

Lately I've been getting timeouts on my Roku Soundbridge M500 when browsing by Album or by Artist. Seems like the Roku times out after 10 seconds waiting for data.

Testing RSP with a browser appears to return well-formed XML in around 10 seconds - a little over, I'd wager.

I have a big library: 18,000 songs.

The house is wired Gb Ethernet throughout (IIRC, Soundbridge uses 100Mb) - it's not the network.

In looking at an old firefly forum post ( https://www.fireflymediaserver.net/foru ... e-problem/ ) it's suggested that users could add indices to the sqlite db to improve performance against Album or Artist queries.

Last time I looked at the source code and fiddled with sqlite for mt-daapd, it had custom collations (in the code, if I understand correctly) which made working with sqlite3 a little fraught.

Questions:

1. Is it possible to index the queries for Artist and Album to maybe help the Soundbridge get the XML in < 10sec?
2. Is forked-daapd already doing indices?
3. Failing the above, are my only options a. get a faster NAS, b. have a smaller library, or c. get an(other) fast-ish RPi and serve off the NAS storage from the RPi?

Thanks in advance for any ideas!

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

Re: Improved forked-daapd (iTunes server)

Wed Jan 10, 2018 10:23 pm

Good to hear from a Roku user, doesn't happen too often :-)

I don't have a Roku myself, so it is difficult to test with it.

Yes, it should be possible to add some indices to speed it up. In fact, I think there was a similar request a year or two ago, and @chme and I looked into it, but didn't get the change done. As I remember it was because the requester "disappeared".

To get it done, it would be good if you could add an issue here https://github.com/ejurgensen/forked-daapd and also try to grab the Artist and Album queries that the Roku is making from the log (/var/log/forked-daapd.log).

boaty
Posts: 3
Joined: Thu Jan 11, 2018 11:40 pm

Re: Improved forked-daapd (iTunes server)

Thu Jan 11, 2018 11:51 pm

Huge fan of forked-daapd here... puts my home music collection to good use.

A question which may have been answered but not one I could see...

I'm sending music from forked-daapd to airplay speakers via iOS remote. However controls on the speakers (play / pause / skip track / volume) don't seem to be working. Music from other airplay sources (iTunes) etc. can be controlled from the speakers.

Does anyone know whether control of forked-daapd from Airplay speakers is possible.

Thanks in advance!

jddj
Posts: 5
Joined: Fri Jul 15, 2016 7:08 pm

Re: Improved forked-daapd (iTunes server)

Fri Jan 12, 2018 1:05 am

Issue posted.

https://github.com/ejurgensen/forked-daapd/issues/478

Thanks for listening! I'll try not to disappear!

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

Re: Improved forked-daapd (iTunes server)

Fri Jan 12, 2018 9:55 pm

boaty wrote:
Thu Jan 11, 2018 11:51 pm
I'm sending music from forked-daapd to airplay speakers via iOS remote. However controls on the speakers (play / pause / skip track / volume) don't seem to be working. Music from other airplay sources (iTunes) etc. can be controlled from the speakers.

Does anyone know whether control of forked-daapd from Airplay speakers is possible.
This isn't supported in forked-daapd, one of the issues being that I don't have an Airplay device with such controls. So I'm not sure how the commands are sent, and also can't test it. If you can help either find documentation, or are willing to do the testing, you are also welcome to add an issue here https://github.com/ejurgensen/forked-daapd/issues

Return to “Raspbian”