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

Re: Improved forked-daapd (iTunes server)

Mon Feb 18, 2019 9:00 pm

Certainly,

And thanks for your prompt reply :-) This is an excerpt from /var/log/forked-daapd.log:

[2019-02-17 18:08:53] [ LOG] scan: No file matches iTunes XML entry '/Volumes/Music/iTunes/iTunes Media/Dizzie Tunes/_..I Jul
eselskap Med/14 Så Går VI Rundt Om En Enerbærbusk.m4a'
[2019-02-17 18:08:53] [ LOG] scan: Processed 7200 tracks...
[2019-02-17 18:08:53] [ LOG] scan: No file matches iTunes XML entry '/Volumes/Music/iTunes/iTunes Media/Dronning Mauds Land/T
iden kler seg naken/05 Hva nå_.m4a'
[2019-02-17 18:08:53] [ LOG] scan: No file matches iTunes XML entry '/Volumes/Music/iTunes/iTunes Media/Drömhus/Vill ha dig (
Single)/03 Ja må hon leva.m4a'
[2019-02-17 18:08:53] [ LOG] scan: No file matches iTunes XML entry '/Volumes/Music/iTunes/iTunes Media/Dumdum Boys/1001 Watt
/1-04 Plaster På Såret.m4a'
[2019-02-17 18:08:53] [ LOG] scan: No file matches iTunes XML entry '/Volumes/Music/iTunes/iTunes Media/Dumdum Boys/Splitter
Pine/07 Blod På Tann.m4a'
[2019-02-17 18:08:54] [ LOG] scan: No file matches iTunes XML entry '/Volumes/Music/iTunes/iTunes Media/Elisabeth Norberg-Schulz/Hellige Natt/08 Et Lite Barn Så Lystelig.m4a'
[2019-02-17 18:08:54] [ LOG] scan: Processed 7400 tracks...
[2019-02-17 18:08:54] [ LOG] scan: No file matches iTunes XML entry '/Volumes/Music/iTunes/iTunes Media/Enya/Shepherd Moons/09 Lothlórien.m4a'
[2019-02-17 18:08:54] [ LOG] scan: Processed 7600 tracks...
[2019-02-17 18:08:55] [ LOG] scan: No file matches iTunes XML entry '/Volumes/Music/iTunes/iTunes Media/Eva Dahlgren/En Blekt Blondins Hjärta/01 Jag Är Gud.m4a'

(Several nationalities represented here; all with special characters.) This is an excerpt from /Volumes/Music/iTunes/iTunes Library.xml showing the entry for the topmost file:

<key>19436</key>
<dict>
<key>Track ID</key><integer>19436</integer>
<key>Size</key><integer>22236505</integer>
<key>Total Time</key><integer>195000</integer>
<key>Track Number</key><integer>14</integer>
<key>Track Count</key><integer>16</integer>
<key>Date Modified</key><date>2019-02-02T12:37:25Z</date>
<key>Date Added</key><date>2008-01-24T01:10:07Z</date>
<key>Bit Rate</key><integer>904</integer>
<key>Sample Rate</key><integer>44100</integer>
<key>Play Date</key><integer>4294963696</integer>
<key>Play Date UTC</key><date>2040-02-06T04:28:16Z</date>
<key>Artwork Count</key><integer>1</integer>
<key>Persistent ID</key><string>46DA3EA435394E30</string>
<key>Track Type</key><string>File</string>
<key>File Folder Count</key><integer>-1</integer>
<key>Library Folder Count</key><integer>-1</integer>
<key>Name</key><string>Så Går VI Rundt Om En Enerbærbusk</string>
<key>Artist</key><string>Dizzie Tunes</string>
<key>Album</key><string>...I Juleselskap Med</string>
<key>Genre</key><string>Unclassifiable</string>
<key>Kind</key><string>Apple Lossless-lydfil</string>
<key>Location</key><string>file:///Volumes/Music/iTunes/iTunes%20Media/Dizzie%20Tunes/_..I%20Juleselskap%20Med/14%20Sa%CC%8A%20Ga%CC%8Ar%20VI%20Rundt%20Om%20En%20Enerb%C3%A6rbusk.m4a</string>
</dict>

This output is copied using nano. Hopefully, this can shed light on the issue.

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

Re: Improved forked-daapd (iTunes server)

Mon Feb 18, 2019 10:02 pm

Ok, but what is the filename + path? What the filescanner does is take the filename from the XML and then it tries to match it against the filename in your library. So I would like to know both.

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

Re: Improved forked-daapd (iTunes server)

Mon Feb 18, 2019 10:04 pm

Oh wait, forgot your first post - "'/Volumes/Music/iTunes/iTunes Media/Dizzie Tunes/_..I Juleselskap Med/14 Så Går VI Rundt Om En Enerbærbusk.m4a" is the actual file name, right? Can you confirm that with ls?

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

Re: Improved forked-daapd (iTunes server)

Tue Feb 19, 2019 6:26 am

I am not sure whether you are of the byte representation problem: <https://en.wikipedia.org/wiki/Filename# ... perability>. MacOS uses one byte representation of Umlaute for filenames and normalizes everything to it. Linux is agnostic. Hence, when looked at in an editor everything looks identical, but at a byte level it differs.

I hope I am not carrying owles to Athens, and hopefully I got it at least partly right.

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

Re: Improved forked-daapd (iTunes server)

Tue Feb 19, 2019 12:49 pm

Yes, I can confirm the file name.

[email protected]:/Volumes/Music/iTunes/iTunes Media/Dizzie Tunes/_..I Juleselskap Med $ ls -l
totalt 209920
-rwxrwxrwx 1 root root 5917297 feb. 2 13:37 01 Julen Den Er Her.m4a
-rwxrwxrwx 1 root root 14619463 feb. 2 13:37 02 Nå Er Det Jul Igjen.m4a
-rwxrwxrwx 1 root root 10469238 feb. 2 13:37 03 På Låven Sitter Nissen.m4a
-rwxrwxrwx 1 root root 23712109 feb. 2 13:37 04 Den Gamle Nissen Satt Så Trist.m4a
-rwxrwxrwx 1 root root 8615837 feb. 2 13:37 05 Bjelleklang.m4a
-rwxrwxrwx 1 root root 18338967 feb. 2 13:37 06 Jeg Er Så Glad Hver Julekveld.m4a
-rwxrwxrwx 1 root root 13820842 feb. 2 13:37 07 Snømannen Kalle.m4a
-rwxrwxrwx 1 root root 12747749 feb. 2 13:37 08 Glade Jul.m4a
-rwxrwxrwx 1 root root 8187602 feb. 2 13:37 09 I Eventyrland.m4a
-rwxrwxrwx 1 root root 7941900 feb. 2 13:37 10 Julenissen Kommer I Kveld.m4a
-rwxrwxrwx 1 root root 16310562 feb. 2 13:37 11 O Jul Med Din Glede.m4a
-rwxrwxrwx 1 root root 8004227 feb. 2 13:37 12 Jeg Synger Julekvad.m4a
-rwxrwxrwx 1 root root 14195934 feb. 2 13:37 13 Du Grønne Glitrende Tre Goddag.m4a
-rwxrwxrwx 1 root root 22236505 feb. 2 13:37 14 Så Går VI Rundt Om En Enerbærbusk.m4a
-rwxrwxrwx 1 root root 15718358 feb. 2 13:37 15 Jeg Gikk Meg Over Sjø Og Land.m4a
-rwxrwxrwx 1 root root 13129961 feb. 2 13:37 16 Bjelleklang.m4a

[email protected]:/Volumes/Music/iTunes/iTunes Media/Dizzie Tunes/_..I Juleselskap Med $ ls -l '14 Så Går VI Rundt Om En Enerbærbusk.m4a'
-rwxrwxrwx 1 root root 22236505 feb. 2 13:37 14 Så Går VI Rundt Om En Enerbærbusk.m4a
[email protected]:/Volumes/Music/iTunes/iTunes Media/Dizzie Tunes/_..I Juleselskap Med $

(Seems to me; it would have been convenient with an additional test using the byte representation of the file name – the way it is in the .xml-file – before the error is thrown – but I suspect you're already considering such options.)
Last edited by tenbagger on Tue Feb 19, 2019 1:12 pm, edited 1 time in total.

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

Re: Improved forked-daapd (iTunes server)

Tue Feb 19, 2019 1:11 pm

@EckartH

Many thanks for that creative solution -- I'm pretty sure that would solve my problem (though there may still be issues if the drive gets unmounted while forked-daapd is running; I'm not sure). However, I decided that the network drive approach is fundamentally fragile. So for better robustness, I decided to synchronise the music library between machines so that the forked-daapd machine has its own local copy.

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

Re: Improved forked-daapd (iTunes server)

Tue Feb 19, 2019 7:01 pm

I think @EckartH is on to something. Could you install the utility uni2ascii and then run "ls 14 Så Går VI Rundt Om En Enerbærbusk.m4a | uni2ascii" and then cut and paste the string from forked-daapd's log file and then run "echo "[the string]" | uni2ascii". I expect the results will be different.

I'm not sure what the proper way to solve this is. Perhaps running the string from the xml through Unicode normalization, but I'm not that well-acquainted with Unicode and filesystems.

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

Re: Improved forked-daapd (iTunes server)

Tue Feb 19, 2019 9:49 pm

This is what I'm getting by just copying what you wrote, when it is displayed in Safari and then pasted in a terminal window to Raspberry Pi using VNC:

[email protected]:/Volumes/Music/iTunes/iTunes Media/Dizzie Tunes/_..I Juleselskap Med $ ls '14 Så Går VI Rundt Om En Enerbærbusk.m4a' | uni2ascii
14 S0x00E5 G0x00E5r VI Rundt Om En Enerb0x00E6rbusk.m4a
Total input characters 41
Characters converted to escapes 3
Characters replaced with ASCII 0
Characters deleted 0

[email protected]:/Volumes/Music/iTunes/iTunes Media/Dizzie Tunes/_..I Juleselskap Med $

This is what I'm getting copying the result of grep on /var/log/forked-daapd.log in a terminal window on Raspberry Pi using VNC and pasting back to the command line:

[email protected]:/Volumes/Music/iTunes/iTunes Media/Dizzie Tunes/_..I Juleselskap Med $ echo "14 Så Går VI Rundt Om En Enerbærbusk.m4a" | uni2ascii
14 Sa0x030A Ga0x030Ar VI Rundt Om En Enerb0x00E6rbusk.m4a
Total input characters 43
Characters converted to escapes 3
Characters replaced with ASCII 0
Characters deleted 0

[email protected]:/Volumes/Music/iTunes/iTunes Media/Dizzie Tunes/_..I Juleselskap Med $

Yes; same characters are escaped, but they are escaped differently...

Since iTunes Library.xml is copied (using rsync); my hunch is that the method used to read and compare file names does normalization on the Linux end.

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

Re: Improved forked-daapd (iTunes server)

Tue Feb 19, 2019 11:53 pm

Update to the issues with the web portion not working properly I posted about earlier (https://www.raspberrypi.org/forums/view ... 5#p1429469). Ran a apt-get dist-upgrade earlier today and 13 items were upgraded (didn't think to note which ones at the time). Post dist-upgrade the web portion is working properly again.

Edit to add: If I read the /var/log/apt/history.log file right the following upgrades were implimented.
Upgrade: libraspberrypi-bin:armhf (1.20181112-1, 1.20190215-1), libraspberrypi-dev:armhf (1.20181112-1, 1.20190215-1), libraspberrypi-doc:armhf (1.20181112-1, 1.20190215-1), libsystemd0:armhf (232-25+deb9u8, 232-25+deb9u9), raspi-config:armhf (20181118, 20190219), udev:armhf (232-25+deb9u8, 232-25+deb9u9), libudev1:armhf (232-25+deb9u8, 232-25+deb9u9), raspberrypi-kernel:armhf (1.20181112-1, 1.20190215-1), raspberrypi-bootloader:armhf (1.20181112-1, 1.20190215-1), systemd-sysv:armhf (232-25+deb9u8, 232-25+deb9u9), libpam-systemd:armhf (232-25+deb9u8, 232-25+deb9u9), systemd:armhf (232-25+deb9u8, 232-25+deb9u9), libraspberrypi0:armhf (1.20181112-1, 1.20190215-1)

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

Re: Improved forked-daapd (iTunes server)

Sun Feb 24, 2019 8:59 am

I have a problem with the Apple Remote app on my iPad. I can only add one of my two forked-daapd servers. It doesn’t matter which one. When I try to add a second by tapping ‘Add an iTunes Library’, the button goes gray but nothing happens, instead of the usual passcode entry page. This all works fine on two iPhone, but not on two iPads. Has anyone else had this problem and found a workaround? Or is there maybe a alternative to the Apple Remote app?

hodgsonio
Posts: 1
Joined: Sun Feb 24, 2019 11:30 am

Re: Improved forked-daapd (iTunes server)

Sun Feb 24, 2019 11:38 am

Hi,

I'm using forked-daapd with Home Assistant to enable Airplay devices as audio endpoints for notifications ('there is somebody at the door'etc). MPD server is alive and well but any text-to-speech I send to Airplay speakers via forked-daapd/MPD causes the audio to be in a continuous loop. I've checked with MPC and repeat is off. Any ideas please? I've tried a fresh install via apt-get remove and purge but issue reoccurs. The itunes server functions normally with no repeating/looping.

Many thanks!

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

Re: Improved forked-daapd (iTunes server)

Mon Feb 25, 2019 9:47 pm

Update on problem: "scan: No file matches iTunes XML entry"

Quick recap: I have 25 000+ songs in iTunes and almost 2 000 gave this error when iTunes Library.xml was read by forked-daapd. Titles having extended characters caused the problem.

I solved the problem by writing a small command line utility in C# for copying and transforming the iTunes Library.xml to the forked-daapd directory (instead of cp or rsync).

iTunes uses (some version of) NFD when writing file location in the xml, and this lead to inconsistencies between xml and disk (ExFat) when read by forked-daapd. The utility basically cleans file locations in the xml that are not already NFKC. I there is any interest, I can put the source code on GitHub. Cheers!

dan_ce
Posts: 13
Joined: Fri Mar 30, 2018 1:59 pm

Re: Improved forked-daapd (iTunes server)

Sat Mar 09, 2019 7:53 pm

hodgsonio wrote: I'm using forked-daapd with Home Assistant to enable Airplay devices as audio endpoints for notifications ('there is somebody at the door'etc).
How are you doing this? When I try it, Forked-Daapd just sort of quits in my Home Assistant Lovelace front end. It doesn't work at all. Any tips most welcome!

dan_ce
Posts: 13
Joined: Fri Mar 30, 2018 1:59 pm

Re: Improved forked-daapd (iTunes server)

Sun Mar 10, 2019 12:08 pm

Am I right in thinking forked-daapd doesn't support scrubbing/move to location? Or is it simply that the Pi Zero W I'm running it on doesn't have the CPU power to allow it to work?

vishnumrao
Posts: 6
Joined: Fri Mar 15, 2019 4:51 pm

Re: Improved forked-daapd (iTunes server)

Fri Mar 15, 2019 4:57 pm

@ejurgensen

I registered on the forum today, just to post this comment. Thank you for your efforts to maintain forked-daapd.

I installed on my r pi 1 model B. After a few initial hiccups, I have it working now.

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

Re: Improved forked-daapd (iTunes server)

Fri Mar 15, 2019 8:28 pm

Very happy to hear that, thanks! Many people have contributed to the development, so credit also goes to them, not in the least @chme who has made a ton of improvements.

vishnumrao
Posts: 6
Joined: Fri Mar 15, 2019 4:51 pm

Re: Improved forked-daapd (iTunes server)

Sat Mar 16, 2019 5:10 am

I was not aware that there were more developers! Good to know. Thank you to all the developers.

The daapd server is accessible to Rhythmbox on my Ubuntu machine, itunes on my windows 10 desktop, Diapente app on android. Only place where I can't see is on my iphone! I used the instructions and shell script https://www.instructables.com/id/Easy-R ... th-Forked/.

I still can't see the home sharing music in the music app on the iphone. Any tips? I am new to ios. Been a windows phone user all this while! Maybe wrong question to ask here!

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

Re: Improved forked-daapd (iTunes server)

Mon Mar 18, 2019 7:10 pm

I have released version 26.5.80 of forked-daapd to my repository. The improvements from the last build are the following:

- A number of improvements to the web ui, eg podcast views, mp3 browser streaming and mute button
- Smart playlist improvements
- Fix mp3 streaming disconnects

All these changes are thanks to @chme.

@vishnumrao showing the music via Home Sharing on the iPhone is not supported, I think the way Home Sharing works makes it impossible for anyone but Apple to share music through it. So on iPhone you either have to use a mpd client app, a browser (the web ui) or use Apple Remote if you don't need playback on the phone itself.

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

Re: Improved forked-daapd (iTunes server)

Wed Mar 20, 2019 4:25 am

When I add a new playlist to my Spotify library (from a web browser), it does not show up in Forked-Daapd until I manually update FD. It's my understanding this is supposed to happen automagically ;) . Am I missing something? BTW, pretty new to using FD with Spotify, so I very well could be. I love it though!

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

Re: Improved forked-daapd (iTunes server)

Wed Mar 20, 2019 6:43 am

Unfortunately Spotify has broken this feature, and as far as I know they do not currrently provide a way to support this. My own workaround has been to set up a nightly cron job that triggers an update.

tinbert
Posts: 2
Joined: Tue Mar 19, 2019 9:03 pm

Re: Improved forked-daapd (iTunes server)

Wed Mar 20, 2019 7:36 am

Great job, ejurgensen! Thank you so much :D

Is it possible to stream from rtsp sources? Nobody seems to have asked this before.

The background: my cable router (AVM Fritzbox 6490) is able to extract radio (and video) signals from the cable and stream it into my home net. So my idea is to stream radio channels to my Airport Express installation.

With forked-daapd streaming of mp3 already works, but rtsp seems not to work.

The cable router gives my nice m3u files with all radio stations contained, but these rtsp-uris are ignored by forked-daapd.

Do I need to install nicecast/gstreamer to re/trans/code this rtsp-stream?

Thx!

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

Re: Improved forked-daapd (iTunes server)

Thu Mar 21, 2019 6:16 am

Yes, I think you are the first to ask this question :-)

RTSP is not a specific encoding, and forked-daapd doesn't as such support talking to rtsp servers. But what happens if you edit the m3u and change rtsp:// to http:// or https://? Can forked-daapd then play the stream? Maybe it is as simple as that.

tinbert
Posts: 2
Joined: Tue Mar 19, 2019 9:03 pm

Re: Improved forked-daapd (iTunes server)

Thu Mar 21, 2019 7:15 am

ejurgensen wrote:
Thu Mar 21, 2019 6:16 am
Yes, I think you are the first to ask this question :-)

RTSP is not a specific encoding, and forked-daapd doesn't as such support talking to rtsp servers. But what happens if you edit the m3u and change rtsp:// to http:// or https://? Can forked-daapd then play the stream? Maybe it is as simple as that.
Thank you for your reply!
I've already tried http, but checked again, https too. Unfortunately with no success.
Here's the log for the library rescan:

Code: Select all

[2019-03-21 07:54:44] [  LOG]      lib: Library rescan completed in 61 sec (6 changes)
[2019-03-21 07:54:54] [  LOG]    cache: Beginning DAAP cache update
[2019-03-21 07:54:54] [  LOG]    cache: DAAP cache updated
[2019-03-21 07:55:22] [  LOG]     scan: Modified playlist found, processing '/home/pi/srv/music/Radio/DVB-C.m3u'
[2019-03-21 07:55:22] [  LOG]     scan: No file in the library matches playlist entry 'rtsp://10.0.1.1:554/?avm=1&freq=450&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=1&pids=0,16,17,18,20,700,710'
[2019-03-21 07:55:52] [  LOG]     scan: Playlist URL 'https://10.0.1.1:554/?avm=1&freq=450&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=1&pids=0,16,17,18,20,700,710' is unavailable for probe/metadata, assuming MP3 encoding
[2019-03-21 07:56:22] [  LOG]     scan: Playlist URL 'http://10.0.1.1:554/?avm=1&freq=450&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=1&pids=0,16,17,18,20,700,710' is unavailable for probe/metadata, assuming MP3 encoding
[2019-03-21 07:56:23] [  LOG]     scan: Done processing playlist, added/modified 3 items
VLC (on Mac) has no problems playing this rtsp-uri.

Anyway, AirPlay is what I'm looking for and as an alternative to rtsp I'll go with Internet streams on forked-daapd for my favourite radio stations. Works great, but needs some (minor) bandwidth and is not as reliable as digital cable DVB-C signal.

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

Re: Improved forked-daapd (iTunes server)

Sat Apr 06, 2019 12:15 am

For some reason my audiobooks are no longer being separated from music even though the music and audiobooks are in separate NFS network shares. Is this tied to using NFS rather than CIFS for a network share? Or is there some other cause for this issue? Using version 26.5.

I've tried several different entries (/wdmc_audiobooks, /home/pi/wdmc_audiobooks) for the audiobook line none seem to work.
Image

The music folder showing audiobooks mixed in.
Image

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

Re: Improved forked-daapd (iTunes server)

Sat Apr 06, 2019 3:27 pm

The type of share should not make a difference. You can narrow the cause like this:

Run "sqlite3 /var/cache/forked-daapd/songs3.db" and then "select media_kind,path from files where path like '%wdmc_audiobooks%';" (then quit with ".quit"). If this shows media_kind as 8 then forked-daapd has identified the files as audiobook, and the issue is probably caching. It could be
a simple Ctrl+F5 in the browser solves the problem.

If the value is not 8 then you need to make forked-daapd rescan the library. You can try with "Update library" from the admin interface, but I'm not sure that is enough. If it doesn't suffice, try to stop forked-daapd, move /var/cache/forked-daapd/songs3.db to a backup location, and restart forked-daapd. Then the database will be recreated and everything gets rescanned.

Return to “Raspbian”