croque
Posts: 7
Joined: Thu Sep 26, 2013 6:52 am

Re: Improved forked-daapd (iTunes server)

Tue Nov 05, 2013 6:11 pm

croque wrote:Yes. I'm running current git and Remote 4.0 on an iPad Air and it works.
I might have been to quick with my response. Some works, some works not. In a quick analysis it seems like flac works but not mp3. Playing from my Macbook Air with iTunes 11.1.2 seems to work just fine with those mp3:s.

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

Re: Improved forked-daapd (iTunes server)

Tue Nov 05, 2013 6:58 pm

I've upgraded to Remote 4.0 on my iPad mini and it seems to be working. It played alac, flac and mp3 just fine. I don't think Remote even knows about the encoding, so your mp3 issue is likely something else.

I only encountered a small issue with album art in the "Album" tab, where the aspect ratio is wrong.

Another issue altogether is that Apple's new UI is crazy: An example is this, where the caption in the bottom left is actually a button.

BTW latest git and release 16 are the same (at commit 862cde3)
Last edited by ejurgensen on Tue Nov 05, 2013 7:40 pm, edited 1 time in total.

croque
Posts: 7
Joined: Thu Sep 26, 2013 6:52 am

Re: Improved forked-daapd (iTunes server)

Tue Nov 05, 2013 7:19 pm

ejurgensen wrote:I've upgraded to Remote 4.0 on my iPad mini and it seems to be working. It played alac, flac and mp3 just fine. I don't think Remote even knows about the encoding, so your mp3 issue is likely something else.
Are you completely sure about this? It seems like I can reproduce the issue with my first 4 random mp3 tests with the same crash each time. Using log-level 'info' shows this:

[2013-11-05 20:11:27] db: End of query results
[2013-11-05 20:11:28] ffmpeg: max_analyze_duration 5000000 reached at 5015510 microseconds
[2013-11-05 20:11:28] raop: Failed to retrieve artwork for 'Chinese Democracy' (33159); no artwork will be sent
[2013-11-05 20:11:28] raop: RECORD reply from Vardagsrum did not have an Audio-Latency header
[2013-11-05 20:11:28] xcode: Custom get_buffer - not allowed by ffmpeg/libav!
[2013-11-05 20:11:28] ffmpeg: Audio sample format conversion failed
[2013-11-05 20:11:28] xcode: Resample returned no samples!
[2013-11-05 20:11:28] ffmpeg: Audio sample format conversion failed
[2013-11-05 20:11:28] xcode: Resample returned no samples!

And then it continues until I have to force killing the process.

There is no problem playing the files from the Macbook Air and iTunes.

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

Re: Improved forked-daapd (iTunes server)

Tue Nov 05, 2013 7:48 pm

Do you have an Android device with a Remote app, or another iOS-device with is still Remote 3? It would be interesting to know if that makes a difference.

I'm not sure what to make from the logfile. This line might mean ffmpeg/libav has trouble detecting the encoding:

[2013-11-05 20:11:28] ffmpeg: max_analyze_duration 5000000 reached at 5015510 microseconds

PM me if you don't mind sharing your mp3, then I'll examine it further.

jmp909
Posts: 56
Joined: Sat Jul 21, 2012 12:32 am

Re: Improved forked-daapd (iTunes server)

Tue Nov 05, 2013 11:29 pm

ok Apple messed up the speaker UI on iPhone(5) there's not even a back button from the dialog :S

but the forked-daapd functionality seems fine
Attachments
1455978_10153446390405402_1977497038_n.jpg
1455978_10153446390405402_1977497038_n.jpg (24.15 KiB) Viewed 5913 times

jmp909
Posts: 56
Joined: Sat Jul 21, 2012 12:32 am

Re: Improved forked-daapd (iTunes server)

Wed Nov 06, 2013 12:00 am

looking into it further when i connect to an actual iTunes library the UI shown is different

something is missing on the forked-daapd version that makes the dialog mess up. essentially the app is expecting to show the "up next" play queue icon top right, but it's showing the AirPlay icon for forked-daapd. clicking the AirPlay icon then shows the screenshot i posted in the previous post

seems they only now show the AirPlay icon for multiple speakers from the "Now playing" screen. This is an issue on forked-daapd if you don't have any speakers selected because Remote will throw you back to the previous page with an error. Whereas with iTunes if you try unchecking all speakers it'll default to "My Computer" (ie the PC iTunes client is on)

So 2 issues to resolve here:

1) fix the missing "Up Next" icon top right (forked-daapd doesnt seem to give any option to get to this, but presumably that's because it has no concept of this feature). It may require just avoiding clicking the "Airplay" speaker symbol that's up there and instead selecting speakers from the "Now Playing" screen

2) ensure that forked-daapd defaults to the main speaker (in this case presumably the Pi's speaker), if the last speaker is unselected (this will stop it kicking you off the only screen you can get to the Airplay icon from now, if you take off the last speaker!)

(note on the screen i'm showing for iTunes Genius is On, but if you turn it Off the 2 Genius icons disappear so the menu would be the same as forked-daapd's version, apart from the icon top right still shows "Airplay" on forked and "Up Next" on iTunes .. ie Genius is not a specific issue here)
Attachments
forked-daapd-vs-itunes.jpg
forked-daapd-vs-itunes.jpg (48.73 KiB) Viewed 5907 times

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

Re: Improved forked-daapd (iTunes server)

Wed Nov 06, 2013 7:01 pm

jmp909 wrote:1) fix the missing "Up Next" icon top right (forked-daapd doesnt seem to give any option to get to this, but presumably that's because it has no concept of this feature). It may require just avoiding clicking the "Airplay" speaker symbol that's up there and instead selecting speakers from the "Now Playing" screen
Yes, "Up Next" is a new feature in Remote 4. Apparently Remote detects that forked-daapd has no support for this. I guess this support should be added, hope I can figure that one out. Remote 4 on iPhone and on iPad seem to behave a bit differently. I only have iPad, and I don't get the malfunctioning AirPlay symbol in the upper right corner.
jmp909 wrote:2) ensure that forked-daapd defaults to the main speaker (in this case presumably the Pi's speaker), if the last speaker is unselected (this will stop it kicking you off the only screen you can get to the Airplay icon from now, if you take off the last speaker!)
Actually, I might have removed this feature from the original forked-daapd! It was causing problems with Hyperfine Remote for Android. When I removed it I also thought it would be good for situations where forked-daapd is running on devices without local audio. But of course the current problem should be solved, so something needs to be done about it.

jmp909
Posts: 56
Joined: Sat Jul 21, 2012 12:32 am

Re: Improved forked-daapd (iTunes server)

Wed Nov 06, 2013 7:25 pm

Hmm what's the default speaker setting for in the config file? Wasn't sure about that.

Well anyway the speaker issue I mention would seem like something that could be defined in the config , maybe just a speaker name to search for and default to, if the last one is unselected? I actually found it a bit confusing at first in proper iTunes that it wouldn't let me disable all speakers, when I tried to click, but they've enforced it to default to the computer now so yes a forked-daapd config option to also do this would be useful for iOS users.

Thanks
J

maano
Posts: 4
Joined: Mon Nov 11, 2013 12:52 pm

Re: Improved forked-daapd (iTunes server)

Mon Nov 11, 2013 12:59 pm

Hi,

since I updated to remote 4.0, it doesn't work anymore.
It detects my Pi, but while loading the cover images, remote says it can't find the library/device anymore, then I have to click/push the icon for the library on my Pi multiple times and then it might work for a small amount of time, but it isn't stable anymore at all. What can I do to check and fix this?

thank you in advance.

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

Re: Improved forked-daapd (iTunes server)

Mon Nov 11, 2013 1:48 pm

That sounds bad. What version of forked-daapd, and is it Remote 4 on iPhone or iPad?

Perhaps forked-daapd's log files have some clues as to what the problem is?

maano
Posts: 4
Joined: Mon Nov 11, 2013 12:52 pm

Re: Improved forked-daapd (iTunes server)

Tue Nov 12, 2013 3:48 pm

Hi,
it's remote 4 on iPad, further I use the 0.19.16.git862cde3-1_armhf.deb version.
I guess you mean the log file in /var/log/forked-daapd.log?
the tail shows:

[2013-11-11 13:23:21] main: Forked Media Server Version 0.19 taking off
[2013-11-11 13:23:21] main: mDNS init
[2013-11-11 13:23:21] mdns: Avahi state change: Client running
[2013-11-11 13:27:27] dacp: Could not find requested property 'com.apple.itunes.mediakind'
[2013-11-11 13:27:27] dacp: Could not find requested property 'com.apple.itunes.extended-media-kind'
[2013-11-11 13:27:29] dacp: Could not find requested property 'com.apple.itunes.mediakind'
[2013-11-11 13:27:29] dacp: Could not find requested property 'com.apple.itunes.extended-media-kind'

please advise what I can do to solve this problem.
thank you

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

Re: Improved forked-daapd (iTunes server)

Tue Nov 12, 2013 8:50 pm

I'm afraid the log didn't reveal anything. Those last messages are caused by Remote 4 making some queries where forked-daapd doesn't know all parts of the query. That is not the cause of the instabilty you experience.

You could try setting the log level to debug, which will give you more info. It will give you a lot of log messages, and I suggest you don't post them here, but instead look for patterns matching the instability or suspicious messages.

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

Re: Improved forked-daapd (iTunes server)

Wed Nov 13, 2013 5:25 pm

Just another thought: Have you checked your cpu during the instability? Do you have other stuff running on your Pi?

fabibo
Posts: 12
Joined: Thu Nov 14, 2013 9:26 pm

Importing iTunes lib

Thu Nov 14, 2013 9:42 pm

Hello ejurgensen,
this looks like a really great project!
Installation and connecting worked fine but I have some problems building up the database. I have a lot of music - took two days to built the db and then failed the built. i'm still using the iTunes Library so i would like to use the itunes.xml-file. but i don't really know how to do this.
the db points into the itunes folder (/home/pi/HDD/iTunes/songs3.db) where all the itunes-files are. itunes_overrides is set to true. but i think there is something missing....
could you please help me out with that?

thank you!

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

Re: Importing iTunes lib

Thu Nov 14, 2013 10:33 pm

fabibo wrote:Installation and connecting worked fine but I have some problems building up the database. I have a lot of music - took two days to built the db and then failed the built. i'm still using the iTunes Library so i would like to use the itunes.xml-file. but i don't really know how to do this.
the db points into the itunes folder (/home/pi/HDD/iTunes/songs3.db) where all the itunes-files are. itunes_overrides is set to true. but i think there is something missing....
could you please help me out with that?
It seems like you might be keeping your database in your music library? I wouldn't recommend that, since it would mean that every time the database changes forked-daapd will add it to the list of files that might need to be examined. It won't actually examine the file since it is in the ignore list, but I wouldn't rule out that this may have contributed to the very long scan time you experienced. I think it would be better to have the database somewhere else on your hdd.

How large is your library anyway? I would suggest you make a smaller copy of it and try scanning that, so you can check everything is working ok.

You didn't say so much about how the scan failed, so it's hard to say what might have caused it.

fabibo
Posts: 12
Joined: Thu Nov 14, 2013 9:26 pm

Re: Improved forked-daapd (iTunes server)

Thu Nov 14, 2013 11:00 pm

actually the itunes-library, the music folder and the songs3.db are all in the same folder. the itunes-library and the music folder have to stay there, but i could move the songs3.db back to /var/.... .
the music is about 75gb; how long do you expect should building the db take with this amount of songs? is there any way to get a log from the scan, to see what he's actually scanning?
building the songs3.db with just a few songs worked perfect! at the moment my problem isn't the fact that the built with all my songs failed. i would like forked-daapd to use my "iTunes Library.xml" to build his db instead of scanning all folders. but i don't know how to tell forked-daapd not to scan the music folder but to use the xml-file? is there a way? according to the README the should one...

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

Re: Improved forked-daapd (iTunes server)

Fri Nov 15, 2013 9:18 am

Here are my scan times for comparison. My library is about 24GB (2500 songs and 20 internet streams):

- RPi (library on flash, database in ram): 7 minutes
- WNDR3700 router (library and database on hard drive): 45 minutes

Personally, I don't like having files on my sd card which get many writes, so I would say you shouldn't put your database in /var, but instead on the hdd - just not in the library. So you could have:

db_path = "/home/pi/HDD/forked-daapd/songs3.db"
directories = { "/home/pi/HDD/iTunes" }

The iTunes XML stuff won't help your scan times, forked-daapd will scan the library anyway. If you enable itunes_override what happens is that when the scan is finished, the XML file will be read and any meta data in it will be preferred to the meta data from the scan. I suppose it would be clever if it didn't do the scan and just read the XML. On the other hand I don't think scan times are bad when it works.

If you want to follow scan progress you can set log level to "debug", but reading the logs can be confusing. So I recommend keeping it on "log" and instead use some SQL:
sqlite3 [your db-file]
select count(*) from files; (gives you total files scanned so far)
select db_timestamp,path from files order by db_timestamp; (see last files that where scanned)

jmp909
Posts: 56
Joined: Sat Jul 21, 2012 12:32 am

Re: Improved forked-daapd (iTunes server)

Fri Nov 15, 2013 10:03 am

I modified the sh script to copy the db file to /run (that's RAM right?) on startup of forked, and copy it back to /var/cache on stop.

I do risk losing my most recent data tho if i pulled the power on the Pi before stopping forked.

I think it sped up the scanning a bit having it in ram but not much. Now most of my library is in though I'll probably move the db to HDD

One thing to note: the .epub and .ipa files within the iTunes media folder were taking ages to scan, but ejurgensen has implemented the ability to exclude those now

fabibo
Posts: 12
Joined: Thu Nov 14, 2013 9:26 pm

Re: Improved forked-daapd (iTunes server)

Sun Nov 17, 2013 4:35 pm

it works perfect!
I moved the db to "/home/pi/HDD/forked-daapd/songs3.db" like you said and the music to "/home/pi/HDD/iTunes/iTunes Media". i suppose the problem was my too slow sd-card and thats why building the db took so long.

now the system is running, i would like to make some improvements on my own. was thinking about an ir-remote, some pushbuttons, volume control and a lcd display. so my plan is to run a script in the background, checking the I/Os and the send a corresponding command to forked-daapd (start/stop, volumeUp/Down, next song, title of the playing song,...).

i already had this setup for a xbmc, but i think forked-daapd is more suitable in this case. unfortunately i have no idea how such a client-server conversation works, how the commands are sent and which commands i can use.
could you please give me some hints, how to set up the code for such a project?

I would be grateful for some help!

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

Re: Improved forked-daapd (iTunes server)

Sun Nov 17, 2013 6:23 pm

That's good to hear. Forked-daapd is in many ways essentially a specialised web server, so you would control it by making requests. You can check httpd_dacp.c to see what kind of requests it will accept.

maano
Posts: 4
Joined: Mon Nov 11, 2013 12:52 pm

Re: Improved forked-daapd (iTunes server)

Fri Nov 22, 2013 4:18 pm

Hi, I'm sorry, it took me some days to test some things.
Unfortunately it's still not working good :-(
It seems like something's wrong with the cover images, but I haven't got a clue where to search.
This is a part of my (debug) log file:

[2013-11-13 20:39:08] artwork: Original image '/media/goflex/public/Muziek/Bob Marley/A Rebel's Dream/cover.jpg': w 300 h 300
[2013-11-13 20:39:08] artwork: Raw destination width 256 height 320
[2013-11-13 20:39:08] artwork: Destination width 256 height 320
[2013-11-13 20:39:08] ffmpeg: err{or,}_recognition separate: 1; 1
[2013-11-13 20:39:08] ffmpeg: err{or,}_recognition combined: 1; 1
[2013-11-13 20:39:08] ffmpeg: Unsupported bit depth: 0
[2013-11-13 20:39:08] artwork: Selected pixel format: 13
[2013-11-13 20:39:08] ffmpeg: err{or,}_recognition separate: 1; 1
[2013-11-13 20:39:08] ffmpeg: err{or,}_recognition combined: 1; 1
[2013-11-13 20:39:08] ffmpeg: Unsupported bit depth: 0
[2013-11-13 20:39:08] artwork: Artwork buffer size: 180000
[2013-11-13 20:39:08] ffmpeg: buffer too small, expanding to 8064 bytes
[2013-11-13 20:39:08] ffmpeg: marker=d8 avail_size_in_buf=8064
[2013-11-13 20:39:08] ffmpeg: marker parser used 0 bytes (0 bits)
[2013-11-13 20:39:08] ffmpeg: marker=e0 avail_size_in_buf=8062
[2013-11-13 20:39:08] ffmpeg: marker parser used 16 bytes (128 bits)
[2013-11-13 20:39:08] ffmpeg: marker=e1 avail_size_in_buf=8044
[2013-11-13 20:39:08] ffmpeg: marker parser used 227 bytes (1816 bits)
[2013-11-13 20:39:08] ffmpeg: marker=c0 avail_size_in_buf=7814
[2013-11-13 20:39:08] ffmpeg: sof0: picture: 300x300
[2013-11-13 20:39:08] ffmpeg: component 0 2:1 id: 0 quant:0
[2013-11-13 20:39:08] ffmpeg: component 1 1:1 id: 1 quant:1
[2013-11-13 20:39:08] ffmpeg: component 2 1:1 id: 2 quant:1
[2013-11-13 20:39:08] ffmpeg: pix fmt id 21111100
[2013-11-13 20:39:08] ffmpeg: marker parser used 17 bytes (136 bits)
[2013-11-13 20:39:08] ffmpeg: marker=db avail_size_in_buf=7795
[2013-11-13 20:39:08] ffmpeg: index=0
[2013-11-13 20:39:08] ffmpeg: qscale[0]: 4
[2013-11-13 20:39:08] ffmpeg: index=1
[2013-11-13 20:39:08] ffmpeg: qscale[1]: 12
[2013-11-13 20:39:08] ffmpeg: marker parser used 132 bytes (1056 bits)
[2013-11-13 20:39:08] ffmpeg: marker=c4 avail_size_in_buf=7661
[2013-11-13 20:39:08] ffmpeg: class=0 index=0 nb_codes=9
[2013-11-13 20:39:08] ffmpeg: class=1 index=0 nb_codes=242
[2013-11-13 20:39:08] ffmpeg: class=0 index=1 nb_codes=6
[2013-11-13 20:39:08] ffmpeg: class=1 index=1 nb_codes=98
[2013-11-13 20:39:08] ffmpeg: marker parser used 148 bytes (1184 bits)
[2013-11-13 20:39:08] ffmpeg: escaping removed 19 bytes
[2013-11-13 20:39:08] ffmpeg: marker=da avail_size_in_buf=7511
[2013-11-13 20:39:08] ffmpeg: component: 0
[2013-11-13 20:39:08] ffmpeg: component: 1
[2013-11-13 20:39:08] ffmpeg: component: 2
[2013-11-13 20:39:08] ffmpeg: marker parser used 7491 bytes (59921 bits)
[2013-11-13 20:39:08] ffmpeg: marker=d9 avail_size_in_buf=0
[2013-11-13 20:39:08] ffmpeg: mjpeg decode frame unused 0 bytes

After this, it doesn't do anything anymore.
I deleted this specific image to see if this might be the problem, but now it's crashing on some other image.
Any idea where to search for solutions for this? as I said, it worked flawless untill I updated to the new Remote (iPad)

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

Re: Improved forked-daapd (iTunes server)

Fri Nov 22, 2013 11:12 pm

I made another attempt at recreating your problem, and I even scaled my artwork to the same dimensions as yours. However, everything worked as it should. I got pretty much the same log output that you posted, so that didn't provide any clues either. I can tell you that when it is working, the next line in the log (after you get your crash) is not ffmpeg/artwork, but the http daemon saying something about getting a request. Perhaps this request for some reason kills your forked-daapd? Then the problem might be related to libevent. You might be able to catch the request with tcpdump, wireshark or something like that - it will be an ordinary http request on port 3689.

Other than that I don't really have any idea what to do.

I'll soon be releasing a new forked-daapd with some Remote 4 improvements, but I can't say if those changes will help you. I'm inclined to think they won't.

maano
Posts: 4
Joined: Mon Nov 11, 2013 12:52 pm

Re: Improved forked-daapd (iTunes server)

Mon Nov 25, 2013 6:18 pm

Problem solved with help of ejurgensen.
I had 2 versions of libevent installed, these seemed to be in conflict with eachother.

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

Re: Improved forked-daapd (iTunes server)

Tue Nov 26, 2013 3:56 pm

I've uploaded a new version, this is number 17. It has the following modifications, mainly for Remote 4:

- will show the Up Next (playqueue) icon and list the queue
- when you select tracks in the songs/album/artist tabs it should now behave like itunes
- support for adding tracks/albums to the queue
- support for shuffle
- no squeezed artwork
- show metadata on vfd on some (non-apple) airplay devices

I does not support showing history (Previously played) and editing the queue won't work either.

As maano mentioned, forked-daapd will not work if you have libevent2 installed. I'll add a notice about that to the install instructions.

Thomas101
Posts: 1
Joined: Thu Nov 28, 2013 5:52 pm

Re: Improved forked-daapd (iTunes server)

Thu Nov 28, 2013 5:59 pm

Hey,

I'm hoping someone can help me. I'm having a few issues accessing my library using iOS devices. I've got forked-daapd up and running on my pi and I've just added a few test songs to get it to work.

On iTunes 11.1.3 on my mac I can see the library fine and stream from it. Happy days :). I also downloaded an app for my android phone and that works too.

However I can't seem to access it on any of my iOS devices. They can however all see the library on my mac. I've tried it with iOS 5 and 7. Tried in the music app and with the remote app. Turned everything off and on again. Checked the wifi network. Just can't seem to get it to work though!

Has anyone got any suggestions?

Return to “Raspbian”