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

Re: Improved forked-daapd (iTunes server)

Fri Dec 16, 2016 6:36 pm

Release 58 (version 24.2.58) is out and it has the following improvements:

1. Support for loading saved Spotify tracks/albums into forked-daapd (only Spotify playlists were supported before). To load the tracks, go to http://forked-daapd.local:3689/oauth and click the link to authorize forked-daapd with Spotify.
2. Persistent queue, meaning that forked-daapd will remember your current queue even when restarted (credit @chme)

tjerk2000
Posts: 3
Joined: Mon Dec 26, 2016 10:55 am

Re: Improved forked-daapd (iTunes server)

Mon Dec 26, 2016 11:05 am

Dear eajurgensen,
I am trying to set up forked-daapd on a pi. It connect to my NAS via NFS.
When adding a rather huge library it gives error like this:

Code: Select all

[2016-12-26 11:52:59] [  LOG]       db: Could not step: database is deadlocked
[2016-12-26 11:52:59] [  LOG]       db: Database deadlocked!
[2016-12-26 11:52:59] [  LOG]       db: Query error: step failed: database table is locked
[2016-12-26 11:52:59] [  LOG]       db: Insert or update of directory failed '/file:/mnt/NAS/Library/Parliament'
[2016-12-26 11:52:59] [  LOG]     scan: Insert or update of directory failed '/file:/mnt/NAS/Library/Parliament'
[2016-12-26 11:52:59] [  LOG]       db: Database deadlocked!
[2016-12-26 11:52:59] [  LOG]       db: Error 'step failed: database table is locked' while runnning 'INSERT INTO inotify (wd, cookie, path) VALUES (426, 0, '/mnt/NAS/Library/Parliament');'
Do you have any clue what these mean and how to correct the problem?

Thanks you and compliments for your work!

Best regards
Tjerk

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

Re: Improved forked-daapd (iTunes server)

Mon Dec 26, 2016 6:10 pm

No, not sure what is the cause of that. A few questions for background: Are you using version 24.2.58 (so my latest release here)? What are the log lines before the errors start appearing?

Could you restart forked-daapd with the log level set to debug in the config? This might provide some clues. Make sure to thoroughly kill any running instances of forked-daapd when restarting. Note that if you have a huge library then this will produce a huge log file (well unless the error appears very quickly). Don't post all of it, just the part leading up to the error.

kalle2000
Posts: 43
Joined: Mon Mar 24, 2014 10:13 am

Re: Improved forked-daapd (iTunes server)

Mon Dec 26, 2016 7:22 pm

@tjerk2000: are you trying to access forked-daapd via a client while the scan is still running? I once had this error due to that.

tjerk2000
Posts: 3
Joined: Mon Dec 26, 2016 10:55 am

Re: Improved forked-daapd (iTunes server)

Mon Dec 26, 2016 10:09 pm

Many thanks for your help and assistance. I am using the latest version.
I installed it as per the instructions on this thread. The PI 3B I use is also running moode audio.
The shares are NFS, the spotify connection seems to work, initially but the playlists end up empty in iTunes.
... And I cannot get the remote working.

I copied the lines preceding the first database error message:

Code: Select all

[2016-12-26 22:47:09] [DEBUG]       db: Running query 'INSERT INTO playlistitems (playlistid, filepath) VALUES (293, 'spotify:track:5igFtOClXsWX0MOBPySNWH');'
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'SELECT d.id FROM directories d WHERE d.virtual_path = '/spotify:/Terry Callier';'
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'UPDATE directories SET virtual_path = TRIM('/spotify:/Terry Callier'), db_timestamp = 1482788829, disabled = 0, parent_id = 4 WHERE id = 5725;'
[2016-12-26 22:47:09] [DEBUG]       db: Updated directory /spotify:/Terry Callier with id 5725
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'SELECT d.id FROM directories d WHERE d.virtual_path = '/spotify:/Terry Callier/The Collected';'
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'UPDATE directories SET virtual_path = TRIM('/spotify:/Terry Callier/The Collected'), db_timestamp = 1482788829, disabled = 0, parent_id = 5725 WHERE id = 5728;'
[2016-12-26 22:47:09] [DEBUG]       db: Updated directory /spotify:/Terry Callier/The Collected with id 5728
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'SELECT f.id, f.db_timestamp FROM files f WHERE f.path = 'spotify:track:5igFtOClXsWX0MOBPySNWH';'
[2016-12-26 22:47:09] [DEBUG]       db: No results
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'INSERT INTO files (id, path, fname, title, artist, album, genre, comment, type, composer, orchestra, conductor, grouping, url, bitrate, samplerate, song_length, file_size, year, track, total_tracks, disc, total_discs, bpm, compilation, artwork, rating, play_count, seek, data_kind, item_kind, description, time_added, time_modified, time_played, db_timestamp, disabled, sample_count, codectype, idx, has_video, contentrating, bits_per_sample, album_artist, media_kind, tv_series_name, tv_episode_num_str, tv_network_name, tv_episode_sort, tv_season_num,  songartistid, songalbumid,  title_sort, artist_sort, album_sort, composer_sort, album_artist_sort, virtual_path, directory_id, date_released)  VALUES (NULL, 'spotify:track:5igFtOClXsWX0MOBPySNWH', 'spotify:track:5igFtOClXsWX0MOBPySNWH', TRIM('Love Can Do'), TRIM('Terry Callier'), TRIM('The Collected'), TRIM('Unknown genre'), TRIM(NULL), 'spotify', TRIM(NULL), TRIM(NULL), TRIM(NULL), TRIM(NULL), NULL, 0, 0, 209000, 0, 2007, 14, 0, 0, 0, 0, 0, 6, 0, 0, 0, 2, 2, 'Spotify audio', 1467959305, 1482788829, 0, 1482788829, 0, 0, 'wav', 0, 0, 0, 0, TRIM('Terry Callier'), 1, TRIM(NULL), TRIM(NULL), TRIM(NULL), 0, 0, daap_songalbumid(LOWER(TRIM('Terry Callier')), ''), daap_songalbumid(LOWER(TRIM('Terry Callier')), LOWER(TRIM('The Collected'))),  TRIM('Love Can Do'), TRIM('Terry Callier'), TRIM('Collected'), TRIM(NULL), TRIM('Terry Callier'), TRIM('/spotify:/Terry Callier/The Collected/Love Can Do'), 5728, 0);'
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'SELECT COUNT(DISTINCT f.path) FROM files f WHERE f.disabled = 0 AND f.path != '' AND f.path LIKE 'spotify:%%' AND NOT f.path IN (SELECT filepath FROM playlistitems);'
[2016-12-26 22:47:09] [DEBUG]       db: Starting query 'SELECT f.path, f.path FROM files f WHERE f.disabled = 0 AND f.path != '' AND f.path LIKE 'spotify:%%' AND NOT f.path IN (SELECT filepath FROM playlistitems) GROUP BY f.path ;'
[2016-12-26 22:47:09] [DEBUG]       db: End of query results
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'DELETE FROM files WHERE path LIKE 'spotify:%' AND NOT path IN (SELECT filepath FROM playlistitems);'
[2016-12-26 22:47:09] [DEBUG]       db: Deleted 0 rows
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'END TRANSACTION;'
[2016-12-26 22:47:09] [DEBUG]       db: No results
[2016-12-26 22:47:09] [DEBUG]  spotify: Playlist update (status 1): Reggae
[2016-12-26 22:47:09] [  LOG]  spotify: Saving playlist (67 tracks): 'Reggae'
[2016-12-26 22:47:09] [DEBUG]  spotify: Playlist 'Reggae' owner: 'tjerk2016' (canonical) / 'tjerk2016' (display)
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'SELECT p.* FROM playlists p WHERE p.path = 'spotify:user:tjerk2016:playlist:6rQT0FVcxEQrXWcQD6cD4n';'
[2016-12-26 22:47:09] [DEBUG]       db: No results
[2016-12-26 22:47:09] [DEBUG]  spotify: Adding playlist ('Reggae', link spotify:user:tjerk2016:playlist:6rQT0FVcxEQrXWcQD6cD4n)
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'SELECT COUNT(*) FROM playlists p WHERE p.title = TRIM('Reggae') AND p.path = 'spotify:user:tjerk2016:playlist:6rQT0FVcxEQrXWcQD6cD4n';'
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'INSERT INTO playlists (title, type, query, db_timestamp, disabled, path, idx, special_id, parent_id, virtual_path, directory_id) VALUES (TRIM('Reggae'), 3, '(NULL)', 1482788829, 0, 'spotify:user:tjerk2016:playlist:6rQT0FVcxEQrXWcQD6cD4n', 0, 0, 291, '/spotify:/Reggae (tjerk2016)', 4);'
[2016-12-26 22:47:09] [DEBUG]   ffmpeg: Probed with size=2048 and score=50
[2016-12-26 22:47:09] [DEBUG]       db: Added playlist Reggae (path spotify:user:tjerk2016:playlist:6rQT0FVcxEQrXWcQD6cD4n) with id 294
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'BEGIN TRANSACTION;'
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'INSERT INTO playlistitems (playlistid, filepath) VALUES (294, 'spotify:track:0fF0HtZGSXZgGrC6b7Pq4I');'
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'SELECT d.id FROM directories d WHERE d.virtual_path = '/spotify:/Bob Marley & The Wailers';'
[2016-12-26 22:47:09] [DEBUG]       db: No results
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'INSERT INTO directories (virtual_path, db_timestamp, disabled, parent_id) VALUES (TRIM('/spotify:/Bob Marley & The Wailers'), 1482788829, 0, 4);'
[2016-12-26 22:47:09] [DEBUG]       db: Added directory /spotify:/Bob Marley & The Wailers with id 5729
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'SELECT d.id FROM directories d WHERE d.virtual_path = '/spotify:/Bob Marley & The Wailers/Gold';'
[2016-12-26 22:47:09] [DEBUG]       db: No results
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'INSERT INTO directories (virtual_path, db_timestamp, disabled, parent_id) VALUES (TRIM('/spotify:/Bob Marley & The Wailers/Gold'), 1482788829, 0, 5729);'
[2016-12-26 22:47:09] [DEBUG]       db: Added directory /spotify:/Bob Marley & The Wailers/Gold with id 5730
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'SELECT f.id, f.db_timestamp FROM files f WHERE f.path = 'spotify:track:0fF0HtZGSXZgGrC6b7Pq4I';'
[2016-12-26 22:47:09] [DEBUG]       db: No results
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'INSERT INTO files (id, path, fname, title, artist, album, genre, comment, type, composer, orchestra, conductor, grouping, url, bitrate, samplerate, song_length, file_size, year, track, total_tracks, disc, total_discs, bpm, compilation, artwork, rating, play_count, seek, data_kind, item_kind, description, time_added, time_modified, time_played, db_timestamp, disabled, sample_count, codectype, idx, has_video, contentrating, bits_per_sample, album_artist, media_kind, tv_series_name, tv_episode_num_str, tv_network_name, tv_episode_sort, tv_season_num,  songartistid, songalbumid,  title_sort, artist_sort, album_sort, composer_sort, album_artist_sort, virtual_path, directory_id, date_released)  VALUES (NULL, 'spotify:track:0fF0HtZGSXZgGrC6b7Pq4I', 'spotify:track:0fF0HtZGSXZgGrC6b7Pq4I', TRIM('Jamming'), TRIM('Bob Marley & The Wailers'), TRIM('Gold'), TRIM('Unknown genre'), TRIM(NULL), 'spotify', TRIM(NULL), TRIM(NULL), TRIM(NULL), TRIM(NULL), NULL, 0, 0, 215000, 0, 2004, 17, 0, 0, 0, 0, 0, 6, 0, 0, 0, 2, 2, 'Spotify audio', 1466950077, 1482788829, 0, 1482788829, 0, 0, 'wav', 0, 0, 0, 0, TRIM('Bob Marley & The Wailers'), 1, TRIM(NULL), TRIM(NULL), TRIM(NULL), 0, 0, daap_songalbumid(LOWER(TRIM('Bob Marley & The Wailers')), ''), daap_songalbumid(LOWER(TRIM('Bob Marley & The Wailers')), LOWER(TRIM('Gold'))),  TRIM('Jamming'), TRIM('Bob Marley & The Wailers'), TRIM('Gold'), TRIM(NULL), TRIM('Bob Marley & The Wailers'), TRIM('/spotify:/Bob Marley & The Wailers/Gold/Jamming'), 5730, 0);'
[2016-12-26 22:47:09] [ INFO]       db: Waiting for database unlock
[2016-12-26 22:47:09] [ WARN]   ffmpeg: max_analyze_duration 5000000 reached
[2016-12-26 22:47:09] [DEBUG]     scan: File has 1 streams
[2016-12-26 22:47:09] [DEBUG]     scan: Duration 115213 ms, bitrate 655 kbps
[2016-12-26 22:47:09] [DEBUG]     scan: samplerate 44100, bps 16
[2016-12-26 22:47:09] [DEBUG]     scan: FLAC
[2016-12-26 22:47:09] [DEBUG]     scan: Picked up 0 tags from file metadata
[2016-12-26 22:47:09] [DEBUG]     scan: Picked up 0 tags with extra md_map
[2016-12-26 22:47:09] [DEBUG]     scan: Picked up 8 tags from file metadata
[2016-12-26 22:47:09] [DEBUG]     scan: Picked up 8 tags with generic md_map, 8 tags total
[2016-12-26 22:47:09] [DEBUG]       db: Running query 'INSERT INTO files (id, path, fname, title, artist, album, genre, comment, type, composer, orchestra, conductor, grouping, url, bitrate, samplerate, song_length, file_size, year, track, total_tracks, disc, total_discs, bpm, compilation, artwork, rating, play_count, seek, data_kind, item_kind, description, time_added, time_modified, time_played, db_timestamp, disabled, sample_count, codectype, idx, has_video, contentrating, bits_per_sample, album_artist, media_kind, tv_series_name, tv_episode_num_str, tv_network_name, tv_episode_sort, tv_season_num,  songartistid, songalbumid,  title_sort, artist_sort, album_sort, composer_sort, album_artist_sort, virtual_path, directory_id, date_released)  VALUES (NULL, '/mnt/NAS/Library/Dalida/Dalida - 2011 - Greatest Hits/CD2/10 Ne Joue Pas.flac', '10 Ne Joue Pas.flac', TRIM('Ne Joue Pas'), TRIM('Dalida'), TRIM('Greatest Hits CD2'), TRIM('Chanson'), TRIM('EAC1.0b2 FLAC -8'), 'flac', TRIM(NULL), TRIM(NULL), TRIM(NULL), TRIM(NULL), NULL, 655, 44100, 115213, 9442067, 2011, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 'FLAC audio file', 1482788829, 1477952535, 0, 1482788829, 0, 0, 'flac', 0, 0, 0, 16, TRIM('Dalida'), 1, TRIM(NULL), TRIM(NULL), TRIM(NULL), 0, 0, daap_songalbumid(LOWER(TRIM('Dalida')), ''), daap_songalbumid(LOWER(TRIM('Dalida')), LOWER(TRIM('Greatest Hits CD2'))),  TRIM('Ne Joue Pas'), TRIM('Dalida'), TRIM('Greatest Hits CD00002'), TRIM(NULL), TRIM('Dalida'), TRIM('/file:/mnt/NAS/Library/Dalida/Dalida - 2011 - Greatest Hits/CD2/10 Ne Joue Pas.flac'), 65, 1293879600);'
[2016-12-26 22:47:09] [  LOG]       db: Database deadlocked!
[2016-12-26 22:47:09] [  LOG]       db: Query error: step failed: database table is locked

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

Re: Improved forked-daapd (iTunes server)

Mon Dec 26, 2016 11:18 pm

The reason the playlists are empty in iTunes (apart from the db error) is that you cannot play your Spotify tracks in iTunes. As mentioned in the README in the Spotify section: "You also can only listen to your music by letting forked-daapd do the playback - so that means you can't stream from forked-daapd to iTunes."

It looks like the deadlock happens because forked-daapd tries to load your local library and Spotify at the same time. That is not supposed to happen. I will have to look into that.

Until I can get it fixed, here is a possible work-around: First get your local library scanned, and then get Spotify loaded. So remove Spotify now (an empty .spotify file should do that), and then restart. Wait until your library is loaded. Now remove the empty .spotify file and add the real one. Now wait until that is loaded and connect a client (Remote or iTunes).

Edit: Did you have the .spotify file in the library when you started forked-daapd? Try not having that.

tjerk2000
Posts: 3
Joined: Mon Dec 26, 2016 10:55 am

Re: Improved forked-daapd (iTunes server)

Tue Dec 27, 2016 1:01 am

dear eajurgensen,

First of all thanks again. I did as you told me and emptied the .spotify file.
it was sitting in an empty directory. i will remove it afterwards.

the database is is indexing now. This is running fine, nor errors. Thanks!

Code: Select all

[2016-12-27 01:36:19] [  LOG]   laudio: Error initializing Pulseaudio: Connection refused
[2016-12-27 01:38:48] [  LOG]  spotify: Empty Spotify credentials file /home/pi/forked-daapd/tjerk.spotify
[2016-12-27 01:39:18] [  LOG]     scan: Scanned 200 files...
[2016-12-27 01:39:42] [  LOG]     scan: Scanned 400 files...
[2016-12-27 01:40:21] [  LOG]     scan: Scanned 600 files...
[2016-12-27 01:40:40] [  LOG]     scan: Scanned 800 files...
[2016-12-27 01:40:59] [  LOG]     scan: Scanned 1000 files...
[2016-12-27 01:41:17] [  LOG]     scan: Scanned 1200 files...
[2016-12-27 01:41:38] [  LOG]     scan: Scanned 1400 files...
[2016-12-27 01:41:59] [  LOG]     scan: Scanned 1600 files...
[2016-12-27 01:42:30] [  LOG]     scan: Scanned 1800 files...
[2016-12-27 01:42:55] [  LOG]     scan: Scanned 2000 files...
[2016-12-27 01:43:12] [  LOG]     scan: Scanned 2200 files...
[2016-12-27 01:43:38] [  LOG]     scan: Scanned 2400 files...
I am afraid that I do not understand how to use the spotify feature in forked-daapd.
iTunes, for instance, cannot play these songs/playlists directly right? I start a song from iTunes and will start output on the Pi right?

I hope I can get the remote running again. Will report back.

Thanks!

Tjerk

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

Re: Improved forked-daapd (iTunes server)

Tue Dec 27, 2016 6:10 pm

Good that there was progress. To play Spotify tracks, you will need to use a Remote type client:
http://ejurgensen.github.io/forked-daap ... ed-clients

You can also use an mpd client. You cannot use iTunes or any other daap client.

jdfraser
Posts: 13
Joined: Sat May 23, 2015 5:37 am

Re: Improved forked-daapd (iTunes server)

Thu Dec 29, 2016 6:14 am

Hello,

I have a GGMM E3 http://www.ggmm.com/en/product/speaker/6603.html speaker that I've just purchased that I'm having some problems with using forked-daapd. This is a wifi speaker that has airplay, I am able to stream to it using IOS, Itunes and airfoil.

When I used a daap client to select the speaker, it stays selected for several seconds but then disconnects, no audio ever comes out. I have used the [mpc enable "Ensuite"] command to select it from the command line and logged with DEBUG to help provide some more info which may give you some insight into what is (not) happening.

I would be grateful for any help you can give. I appreciate all the time you have spent improving forked-daapd, it really is a fantastic piece of software.

Code: Select all

[2016-12-25 11:26:55] [DEBUG]     mdns: Avahi Resolver: resolved service '00226C36545C@Ensuite' type '_raop._tcp' proto 0, host GGMM_E3_545C.local
[2016-12-25 11:26:55] [DEBUG]     mdns: Avahi Record Browser (GGMM_E3_545C.local, proto 0): NEW record 192.168.1.82 for service type '_raop._tcp'
[2016-12-25 11:26:55] [DEBUG]     raop: Event for AirPlay device Ensuite (port 4515, id 226c36545c)
[2016-12-25 11:26:55] [ INFO]     raop: Adding AirPlay device 00226C36545C@Ensuite: password: 0, encrypt: 1, metadata: 1, type AirPort Express 1 - 802.11g, address 192.168.1.82:4515
and then after some time

Code: Select all

[2016-12-25 11:54:01] [DEBUG]     raop: Local address: 192.168.1.103 (LL: no) port 43948
[2016-12-25 11:54:01] [DEBUG]     raop: Building ANNOUNCE for 'Ensuite'
[2016-12-25 11:54:01] [DEBUG]     raop: Building SETUP for 'Ensuite'
[2016-12-25 11:54:01] [DEBUG]     raop: token: unicast
[2016-12-25 11:54:01] [DEBUG]     raop: token: interleaved
[2016-12-25 11:54:01] [DEBUG]     raop: token: 0-1
[2016-12-25 11:54:01] [DEBUG]     raop: token: mode
[2016-12-25 11:54:01] [DEBUG]     raop: token: record
[2016-12-25 11:54:01] [DEBUG]     raop: token: control_port
[2016-12-25 11:54:01] [DEBUG]     raop: token: timing_port
[2016-12-25 11:54:01] [DEBUG]     raop: token: server_port
[2016-12-25 11:54:01] [DEBUG]     raop: Negotiated AirTunes v2 UDP streaming session DEADBEEF; ports s=40513 c=40513 t=54520
[2016-12-25 11:54:01] [DEBUG]     raop: Building RECORD for 'Ensuite'
[2016-12-25 11:54:01] [DEBUG]     raop: Building TEARDOWN for 'Ensuite'
[2016-12-25 11:54:01] [DEBUG]   player: Callback from AirPlay to device_activate_cb
[2016-12-25 11:54:01] [DEBUG]     main: Command has 0 pending events
[2016-12-25 11:54:01] [  LOG]     dacp: Speakers de/activation failed!
[2016-12-25 11:54:01] [ SPAM]    httpd: Found query string
[2016-12-25 11:54:01] [DEBUG]     dacp: DACP request: /ctrl-int/1/getspeakers?session-id=208108775
[2016-12-25 11:54:01] [ SPAM]    httpd: Found query string
[2016-12-25 11:54:01] [DEBUG]     dacp: DACP request: /ctrl-int/1/getproperty?properties=dmcp.volume&session-id=208108775
[2016-12-25 11:54:01] [DEBUG]   player: Player status: playing
[2016-12-25 11:54:01] [DEBUG]       db: Running query 'BEGIN TRANSACTION;'
[2016-12-25 11:54:01] [DEBUG]       db: Starting enum 'SELECT * FROM queue WHERE id = 4 ORDER BY pos ASC;'
[2016-12-25 11:54:01] [DEBUG]       db: Running query 'END TRANSACTION;'
[2016-12-25 11:54:12] [ SPAM]    httpd: Found query string
[2016-12-25 11:54:12] [DEBUG]     dacp: DACP request: /ctrl-int/1/getproperty?properties=dacp.playerstate,dacp.nowplaying,dacp.playingtime,dmcp.volume,dacp.volumecontrollable,dacp.availableshufflestates,dacp.availablerepeatstates,dacp.shufflestate,dacp.repeatstate,dacp.fullscreenenabled,dacp.fullscreen,dacp.visualizerenabled,dacp.visualizer,com.apple.itunes.itms-songid,com.apple.itunes.has-chapter-data,com.apple.itunes.mediakind,com.apple.itunes.extended-media-kind&session-id=208108775
[2016-12-25 11:54:12] [DEBUG]   player: Player status: playing
[2016-12-25 11:54:12] [DEBUG]       db: Running query 'BEGIN TRANSACTION;'
[2016-12-25 11:54:12] [DEBUG]       db: Starting enum 'SELECT * FROM queue WHERE id = 4 ORDER BY pos ASC;'
[2016-12-25 11:54:12] [DEBUG]       db: Running query 'END TRANSACTION;'
[2016-12-25 11:54:12] [DEBUG]       db: Running query 'SELECT pos FROM queue WHERE id = 4;'
[2016-12-25 11:54:12] [ SPAM]    httpd: Found query string
[2016-12-25 11:54:12] [DEBUG]     dacp: DACP request: /ctrl-int/1/getspeakers?session-id=208108775
[2016-12-25 11:54:13] [ WARN]   player: Behind the playback timer with 5 ticks
[2016-12-25 11:54:25] [ SPAM]    httpd: Found query string
[2016-12-25 11:54:25] [DEBUG]     dacp: DACP request: /ctrl-int/1/setspeakers?speaker-id=0x25d14924ae&session-id=208108775
[2016-12-25 11:54:25] [DEBUG]     dacp: Speaker id converted with ret 0, param 0x25d14924ae, dec val 162425021614.
[2016-12-25 11:54:25] [DEBUG]   player: Speaker set: 1 speakers
[2016-12-25 11:54:25] [DEBUG]   player: Set 162425021614 device 147844387932
[2016-12-25 11:54:25] [DEBUG]   player: The AirPlay device 'Ensuite' is NOT selected
[2016-12-25 11:54:25] [DEBUG]   player: Set 162425021614 device 202481595157498
[2016-12-25 11:54:25] [DEBUG]   player: The AirPlay device 'Kodi (KODI-DS)' is NOT selected
[2016-12-25 11:54:25] [DEBUG]   player: Set 162425021614 device 162425021614
[2016-12-25 11:54:25] [DEBUG]   player: The AirPlay device 'Livingroom' is selected
[2016-12-25 11:54:25] [DEBUG]   player: Activating AirPlay device 'Livingroom'


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

Re: Improved forked-daapd (iTunes server)

Thu Dec 29, 2016 7:21 am

Hi,

the command "mpc enable" expects the speaker id as parameter. You can get the speaker ids by running "mpc outputs". This prints a list of the available speakers with their name, id and state. After this run "mpc enable" with the id of the "Ensuite" speaker. Running once again "mpc outputs" you can make sure that it is enabled.

I will have to check why "mpc enable" does not print out an error message or if it is possible to use the speaker name instead.

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

Re: Improved forked-daapd (iTunes server)

Thu Dec 29, 2016 10:31 am

This log part indicates that forked-daapd tries to setup the session with the device, but then gives up and cancels the session:

[2016-12-25 11:54:01] [DEBUG] raop: Building RECORD for 'Ensuite'
[2016-12-25 11:54:01] [DEBUG] raop: Building TEARDOWN for 'Ensuite'

What is strange is that there is no log message in between the two lines. In the code, I only see one "give up" exit without a log message, and this is if the response from the device is null (which again can probably happen for a number of reasons). If you would like to help with debugging, I can make you a special RPi build of forked-daapd with extra logging?

jdfraser
Posts: 13
Joined: Sat May 23, 2015 5:37 am

Re: Improved forked-daapd (iTunes server)

Thu Dec 29, 2016 11:55 pm

Hi again,

Thanks both of you for your quick response.

@chme I have used both the speaker name and the speaker ID to enable speaker output with mpc, both seem to work except on this GGMM E3 speaker which doesn't work with either method.

@ejergensen I am happy to help debug, it's certainly the least I can do. I am here for a couple days but then away for a week with the family and won't have any network / internet access while I'm gone. If you would like to create at super-verbose logging version of forked-daapd I'll give it a shot. I can do as much as I'm able before I go away, but will be able to continue when I return as well.

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

Re: Improved forked-daapd (iTunes server)

Fri Dec 30, 2016 9:08 am

Here is an edition with a little more logging: http://www.gyfgafguf.dk/temp/forked-daa ... _armhf.deb

I hope there will be messages between the two log lines I mentioned that can provide clues. Next step might be to use Wireshark for sniffing the traffic. Would you be up to that?

jdfraser
Posts: 13
Joined: Sat May 23, 2015 5:37 am

Re: Improved forked-daapd (iTunes server)

Fri Dec 30, 2016 4:31 pm

I've downloaded the .deb, but just to clarify. Can I just replace forked-daapd in the /usr/sbin directory with the one in the deb? Or do I need to install the whole .deb? Is debug log level ok in the config file, or would you like spam?

I am open to using wireshark... I'm a little rusty with it, but I'm sure we can figure it out.

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

Re: Improved forked-daapd (iTunes server)

Fri Dec 30, 2016 6:07 pm

Just install it with dpkg -i. Your config will be preserved.

Yes, debug should be fine.

mswhalley
Posts: 14
Joined: Tue Jan 05, 2016 4:40 pm

Radio station artwork

Sat Dec 31, 2016 9:22 pm

For radio streams that I listen to the station name, artist, and song name display correctly but there is no artwork.

Example: http://stream.srg-ssr.ch/rsj/aacp_96.m3u

If the radio stream does not provide artwork is there a way to supply an image locally? I'm thinking of just a single image to represent the stream not individual albums.

Thanks, Matt.

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

Re: Improved forked-daapd (iTunes server)

Sun Jan 01, 2017 1:45 pm

There is no way to do that right now. I think support for that would be relatively straightforward to add, so I will try to include it in the next release.

kalle2000
Posts: 43
Joined: Mon Mar 24, 2014 10:13 am

Re: Improved forked-daapd (iTunes server)

Mon Jan 02, 2017 10:00 am

ejurgensen wrote:There is no way to do that right now. I think support for that would be relatively straightforward to add, so I will try to include it in the next release.
Are you refering to this request?

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

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

Re: Improved forked-daapd (iTunes server)

Mon Jan 02, 2017 10:12 am

Not quite, adding an external artwork source is a bit more complex. For the next release I would just add support for getting the artwork locally. So if your stream link is /foo/bar.m3u then forked-daapd would look for /foo/bar.jpg and png and use that.

mswhalley
Posts: 14
Joined: Tue Jan 05, 2016 4:40 pm

Re: Improved forked-daapd (iTunes server)

Sat Jan 07, 2017 5:21 pm

ejurgensen wrote:Not quite, adding an external artwork source is a bit more complex. For the next release I would just add support for getting the artwork locally. So if your stream link is /foo/bar.m3u then forked-daapd would look for /foo/bar.jpg and png and use that.
That's exactly what I had in mind. It might be nice to also have a default-default/image of last resort. You could bundle something in the distro with a subtle forked-daapd logo in the corner (take some credit for all your hard work). The user could substitute something else if desired.

jdfraser
Posts: 13
Joined: Sat May 23, 2015 5:37 am

Re: Improved forked-daapd (iTunes server)

Mon Jan 09, 2017 10:11 pm

Hi again, sorry for the long delay in getting back to you.

Here is the snippet of my log file that think you'll want to see, there isn't much more information in it than the previous one, but hopefully the two extra lines will give you a hint where the issue may lay.

Code: Select all

[2017-01-09 13:57:07] [DEBUG]     raop: Building ANNOUNCE for 'Ensuite'
[2017-01-09 13:57:07] [DEBUG]     raop: Building SETUP for 'Ensuite'
[2017-01-09 13:57:07] [DEBUG]     raop: token: unicast
[2017-01-09 13:57:07] [DEBUG]     raop: token: interleaved
[2017-01-09 13:57:07] [DEBUG]     raop: token: 0-1
[2017-01-09 13:57:07] [DEBUG]     raop: token: mode
[2017-01-09 13:57:07] [DEBUG]     raop: token: record
[2017-01-09 13:57:07] [DEBUG]     raop: token: control_port
[2017-01-09 13:57:07] [DEBUG]     raop: token: timing_port
[2017-01-09 13:57:07] [DEBUG]     raop: token: server_port
[2017-01-09 13:57:07] [DEBUG]     raop: Negotiated AirTunes v2 UDP streaming session DEADBEEF; ports s=54238 c=54238 t=48341
[2017-01-09 13:57:07] [DEBUG]     raop: Building RECORD for 'Ensuite'
[2017-01-09 13:57:07] [ WARN]    event: evrtsp_get_body_length: illegal content length: 21 
[2017-01-09 13:57:07] [ WARN]    event: evrtsp_get_body: invalid body: Success
[2017-01-09 13:57:07] [DEBUG]     raop: Building TEARDOWN for 'Ensuite'
[2017-01-09 13:57:07] [DEBUG]   player: Callback from AirPlay to device_activate_cb
[2017-01-09 13:57:07] [DEBUG]     main: Command has 0 pending events
[2017-01-09 13:57:07] [  LOG]     dacp: Speakers de/activation failed!
If you'd like more log information please let me know, thanks again for your time and trouble.

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

Re: Improved forked-daapd (iTunes server)

Tue Jan 10, 2017 8:29 pm

Ok I think I have located the problem, it looks like it is the whitespace after the content length:
"evrtsp_get_body_length: illegal content length: 21 "

Some developer clearly should be spanked for putting that there.

I've made a fix so that the whitespace gets ignored. Please try this package: http://www.gyfgafguf.dk/temp/forked-daa ... _armhf.deb

jdfraser
Posts: 13
Joined: Sat May 23, 2015 5:37 am

Re: Improved forked-daapd (iTunes server)

Wed Jan 11, 2017 9:17 pm

That was the hot ticket !

It works great now, thanks to you I'll now be able to use this nice looking speaker as intended.

If you're ever out my way I'd be happy to buy you a beer / coffee. Or I would be happy do donate to the cause if you ever decide to take donation via Pay Pal or some other method, I realize how many hours must have gone in to improving forked daapd into what is has matured to now and want you to know that I appreciate it.

As a side note, I thought the ability to pipe the output of forked-daapd was cool, so I poked around with that a bit and the PiFM radio transmitter project and now not only have multiple airplay speakers in and outside my house, but also my own Airplay radio station broadcasting @ 87.5FM ( illeaglly perhaps?).

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

Re: Improved forked-daapd (iTunes server)

Sat Jan 14, 2017 3:53 pm

Glad to hear it is now working. Thanks for the offer, but knowing that fd is used out there, and the occasional brain twisting with it, is all the reward I need.

The fix will be included in the next release.

Your project sounds pretty cool - I never would have thought of that use.

dony71
Posts: 21
Joined: Wed Feb 05, 2014 8:39 pm

Re: Improved forked-daapd (iTunes server)

Tue Jan 17, 2017 10:36 pm

Hi everybody,
I'm looking for help on how to configure forked-daapd.conf for alsa dmixer plugin.
I use I2S interface with alsa dmixer plugin and setting CARD="default" in forked-daapd.conf
However I get error cannot open mixer ....
amixer --card 1 shows
Simple mixer control 'I2s Or Pcm Audio Mode Select format',0
so I set mixer="I2s Or Pcm Audio Mode Select format"
but still getting error cannot open mixer
How to get correct mixer parameter value?
.asoundrc looks like below

Code: Select all

pcm.!default {
        type plug
        slave.pcm "dmixer"
}

ctl.dmixer {
        type hw
        card 1
}

pcm.dmixer {
    type dmix
    ipc_key 1024
    ipc_perm 0666
    slave {
        pcm "hw:1,0"
        period_time 0
        period_size 1024
        buffer_size 4096
        rate 44100
        format S32_LE
        channels 2
    }
    bindings {
        0 0
        1 1
    }
}

Return to “Raspberry Pi OS”