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

Re: Improved forked-daapd (iTunes server)

Wed Oct 17, 2018 1:24 pm

Can anyone advise - I'm basically looking to use youtube-dl to download BBC Radio 4 PM every day, then stream that downloaded file using the AirPlay protocol to my old school Airport Express plugged into the back of my AudioEngine A5s. Is forked-daapd the missing link that will allow me to do this? Thanks!!

blackbeardrrr
Posts: 1
Joined: Wed Nov 28, 2018 5:43 am

Re: Improved forked-daapd (iTunes server)

Wed Nov 28, 2018 5:56 am

Can forked-daapd stream audio-in?
Details: We have a record player which has a 3.5mm audio jack for output. Would like to plug this into a Raspberry Pi (using the audio-in jack of a usb audio adapter), and have the Raspberry Pi stream the incoming audio via Airplay. Can this be done?

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

Re: Improved forked-daapd (iTunes server)

Wed Nov 28, 2018 11:58 am

Yes, if you can get ALSA to write the audio to a named pipe in the library. You make the pipe with mkfifo. So basically ALSA will read from audio in and write PCM audio to a pipe, and forked-daapd will then read from that and play it like a regular file. I seem to recall someone did this, not sure exactly how. There will be a lag of 4-5 seconds due to buffering various places in the chain.

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

Re: Improved forked-daapd (iTunes server)

Sun Dec 02, 2018 1:05 pm

I have updated the RPi version in my repo to 26.4.75.gitbb1347f.

Main improvements are to the web interface, which now for instance will display artwork. There is also now support for https streams, and there are some new options to help with some hopefully rare error cases, e.g. Airplay devices that disappear for reasons yet unknown. The is also a fix for some pairing issues reported.

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

Re: Improved forked-daapd (iTunes server)

Sun Dec 02, 2018 3:41 pm

Can you provide details on the local audio sync changes. Should it now be automatically synced with airplay?

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

Re: Improved forked-daapd (iTunes server)

Sun Dec 02, 2018 3:47 pm

There should already be sync between local audio and Airplay (but with some setups it is apparently not working). The only change in this regard is the new setting "adjust_period_seconds", which you can try to reduce, so that sync correction happens more often.

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

Re: Improved forked-daapd (iTunes server)

Wed Dec 05, 2018 6:56 pm

blackbeardrrr wrote:
Wed Nov 28, 2018 5:56 am
Can forked-daapd stream audio-in?
Details: We have a record player which has a 3.5mm audio jack for output. Would like to plug this into a Raspberry Pi (using the audio-in jack of a usb audio adapter), and have the Raspberry Pi stream the incoming audio via Airplay. Can this be done?
blackbeardrrr,

I'm doing the same only instead of using a record player connected to the input, I'm using a bluetooth receiver. I've created an issue on the forked-daapd Github (https://github.com/ejurgensen/forked-daapd/issues/632) because I'm hoping to only have FD pick up the pipe when I'm playing audio to it. The whole setup is a little too manual for my liking at the moment, but I'm hoping to clean it up and provide some automation.

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

Re: Improved forked-daapd (iTunes server)

Thu Dec 06, 2018 7:15 pm

There was a potential deadlock issue in release 26.4.75, so I've now updated it to 26.4.76, which should not have the issue

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

Re: Improved forked-daapd (iTunes server)

Fri Dec 21, 2018 7:14 pm

I'd like to create smart playlists that include all music files within a parent directory and its sub-directories. I'm pretty sure I just need to use the path "field-name" and maybe define what types of files to look for.

Here's my directory structure:
  • Main Forked-Daapd Library Folder
    • Dads_CD_Collection
    • zz-Playlists
      • dads-cd-collection.smartpl
And the current contents of my .smartpl file

Code: Select all

"Dads Collection" {
  data_kind is file
  and media_kind is music
  and path is "/Dads_CD_Collection"
}
Edit: added double quotes around path, Smart Playlist now shows up but with zero contents. There is 1 file within the "Dads_CD_Collection" directory, every other music file is in a sub-directory.

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

Re: Improved forked-daapd (iTunes server)

Mon Dec 24, 2018 6:07 am

@cdlenfert with "path is" you only get the tracks with an exact match. I think you are looking for "path starts with" plus the absolute path to the directory that you want to match.

Code: Select all

"Dads Collection" {
  data_kind is file
  and media_kind is music
  and path starts with "<absolute path to Main Forked-Daapd Library Folder>/Dads_CD_Collection"
}

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

Re: Improved forked-daapd (iTunes server)

Wed Dec 26, 2018 4:16 pm

@chme - Thank you! That worked after changing to "path starts with" and putting in the full path to the folder.

rainerstandke
Posts: 15
Joined: Sun Apr 27, 2014 1:09 am

Re: Improved forked-daapd (iTunes server)

Wed Jan 02, 2019 2:35 am

Hello, I am trying to get internet radio playlists going, and having not much luck with it. So far, I can get playlists scanned, but the log tells me:

Playlist URL 'http://stream.liquidcompass.net/KBEMFMAAC.pls' is unavailable for probe/metadata, assuming MP3 encoding

The content of the playlist file is:

#EXTM3U
http://stream.liquidcompass.net/KBEMFMAAC.pls

In iTunes remote the item (as well as the entire list) do not show up.

Any thing I could try?

Thanks,

Rainer

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

Re: Improved forked-daapd (iTunes server)

Wed Jan 02, 2019 8:18 am

It looks like the url

Code: Select all

http://stream.liquidcompass.net/KBEMFMAAC.pls
is not correct. Following the link in the browser returns an error that the server is not reachable.

rainerstandke
Posts: 15
Joined: Sun Apr 27, 2014 1:09 am

Re: Improved forked-daapd (iTunes server)

Thu Jan 03, 2019 11:21 pm

Oddly, it is what iTunes spits out, and before it comes out it does work in iTunes (on a Mac). But that certainly give me an avenue to pursue. Thanks for the hint! (I'll report back on how it goes.)

rainerstandke
Posts: 15
Joined: Sun Apr 27, 2014 1:09 am

Re: Improved forked-daapd (iTunes server)

Sun Jan 06, 2019 1:25 am

So, my recipe to make things work - at least somewhat - is this:

Export radio playlist from iTunes on Mac, use BBEdit to change the line endings from CR (Mac legacy) to LF (Unix), copy into library on rpi.

The result is:
- the radio playlist does not show up in iOS Remote - though a playlist of songs does. Same on MacOS/iTunes
- the web interface shows the radio playlist, but in depending on web browser Safari, Chrome and platform (MacOS 10.14/MacOS 10.11) some stations do not show up in the list.

This is way better than anything I had for before, so that is great. Is there anything that I am still missing regarding Remote on iOS?

Thanks!

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

Re: Improved forked-daapd (iTunes server)

Sun Jan 06, 2019 2:44 pm

The radio streams should show up in the "Internet Radio" view in Apple Remote (and only there). If you can't see that view, then press "More" and find it there. They will not show up as playlists unless you enable this option: https://github.com/ejurgensen/forked-da ... nf.in#L112

rainerstandke
Posts: 15
Joined: Sun Apr 27, 2014 1:09 am

Re: Improved forked-daapd (iTunes server)

Mon Jan 07, 2019 2:55 am

Affirmative, sir. I had re-read the conf file, and there it is! Thanks for pointing this out though, and the playlist does indeed show up where you describe.

rainerstandke
Posts: 15
Joined: Sun Apr 27, 2014 1:09 am

playback status

Mon Jan 07, 2019 3:04 am

I have a setup where I poll forked-daapd on a regular basis, using this Python code:

Code: Select all

# login
		conn = httplib.HTTPConnection('localhost', 3689)
		conn.request('GET', '/login?pairing-guid=0x1&request-session-id=41')
		response = conn.getresponse()
		#print 'login: '+ str(response.status), response.reason

		# get playback status
		connM = httplib.HTTPConnection('localhost', 3689)
		headers = {'Viewer-Only-Client': '1'}
		connM.request('GET', '/ctrl-int/1/playstatusupdate?session-id=41&revision-number=1', None, headers)
		respM = connM.getresponse()
		#print 'playstatusupdate: '+ str(respM.status), respM.reason
		pbStatus = str(decodeDaap.decodeDaap(respM.read()))
		
		#logout
		conn2 = httplib.HTTPConnection('localhost', 3689)
		conn2.request('GET', '/logout?session-id=41')
		response2 = conn2.getresponse()
		#print 'logout: '+ str(response2.status), response2.reason
This does work OK, put it disrupts any connection with any other web browser, and prevents me from using the web interface. This is a big shame, because of all the convenience the web UI provides. I have looked for other ways to poll the playback status (only interested in on or off and I found that alsa lets me do this:

Code: Select all

cat /proc/asound/card1/pcm0p/sub0/status
This yields (in the command line):
state: RUNNING
owner_pid : 518
trigger_time: 140195.820839612
tstamp : 143973.973175836
delay : -181351776
avail : 181368352
avail_max : 181368352
-----
hw_ptr : 181351968
appl_ptr : 0

However, once playback has stopped, this keeps reporting audio as RUNNING. Is there anything that could theoretically be done on forked-daapd's side about this? Like possibly give up 'ownership' of the audio device when playback stops?

Also, is there anything else I should look into to glean the playback status?

As always, thanks a lot for everyone's efforts!

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

Re: Improved forked-daapd (iTunes server)

Tue Jan 08, 2019 9:04 am

The polling shouldn't disturb the web interface, so @chme or I will have to take a look at that.

Have you looked at getting the status with "mpc status" from the command line? I would think that we be the easiest way to do it.

I don't remember the ALSA procedures around opening/closing devices, so can't answer that right now.

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

Re: Improved forked-daapd (iTunes server)

Wed Jan 09, 2019 7:39 am

As an alternative to mpc or the dacp/daap requests, you can also use the JSON API to get the playback status: https://github.com/ejurgensen/forked-da ... yer-status.

I will try to reproduce the connection problem to the web interface.

rainerstandke
Posts: 15
Joined: Sun Apr 27, 2014 1:09 am

Re: Improved forked-daapd (iTunes server)

Mon Jan 14, 2019 3:47 am

For what it's worth, I might have a workaround: I can install ShairPlay on the pi, and drive the playback out of that. And for that setup the alsa mechanism works well. Thanks for everyone's help.

Turns out there is another problem. It looks like the newest version of Remote on iOS does not want to play with forked-daapd. When I first launched in on my iPhone, it said something about updating the version of iTunes that the library supposedly comes from. In the Libraries tab the existing library on forked-daapd was greyed out, but still functional.

After having some trouble with the phone I deleted the library in Remote, and tried to re-add. Forked-daapd takes the 4 digit code and report pairing success in the log. However, the resulting'iTunes' icon in Remote is greyed out, has no name, and does not connect.

Is this a know thing?

Thanks again!

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

Re: Improved forked-daapd (iTunes server)

Tue Jan 15, 2019 5:31 pm

What version of Remote is that? I tried with 4.4.3 and worked ok, also with a new library. But maybe there is a newer version I haven't received yet?

rainerstandke
Posts: 15
Joined: Sun Apr 27, 2014 1:09 am

Re: Improved forked-daapd (iTunes server)

Thu Jan 17, 2019 4:57 am

That is the version that I had the problem with - but it has gone away, and now it works fine. I do not know what changed. Thanks for your time!

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

Re: Improved forked-daapd (iTunes server)

Tue Jan 22, 2019 9:36 pm

I have uploaded a new version of forked-daapd, it is 26.4.77. Improvements (with lots of credit to @chme):

- new files page for the web UI
- a lot of web UI improvements, e.g. cover artwork, dedicated genre tracks and update when speaker added
- support for track and disc in smart playlists
- JSON API additions, e.g. endpoint for player/toggle, volume steps, adding items to the queue by query and new parameters to start playback after adding items
- internal refactoring of database stuff

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

Re: Improved forked-daapd (iTunes server)

Wed Jan 23, 2019 5:16 pm

Any idea when there will be a new release on Github so people doing the manual install can get these new goodies?

Return to “Raspbian”