Commit Graph

4372 Commits

Author SHA1 Message Date
whatdoineed2do/Ray
07a9ed6654 [jsonapi] composer review 2021-12-30 10:49:45 +00:00
whatdoineed2do/Ray
69d32eb691 [jsonapi] support composers
- enable search for composer (albums/tracks)
- expose new rest endpoint for retreiving all known composers
2021-12-29 14:14:56 +00:00
chme
8dfbb460c2 [db/readme] Add comment to browse_info object; update docs for genre
endpoint
2021-12-29 12:01:42 +01:00
chme
8becdee8f1 [db] Refactor db_query_fetch_* functions to take the output parameter
first and the input parameter as last parameter
2021-12-28 07:23:56 +01:00
chme
a65ee4462e [db] Refactor fetching query result into generic function
Additionally changes the return value in case the end of the result set
is reached.
2021-12-28 06:55:35 +01:00
chme
d7086cab00 [db,jsonapi] Additional meta data for browse queries 2021-12-28 06:29:07 +01:00
chme
f3fa343b9b [spotify] Add missing listener notification on librespot logout 2021-12-26 20:22:06 +01:00
whatdoineed2do/Ray
8f9356ff11 [http,conf] allow user to request no ssl peer verification
This solves for the case where hosted RSS podcasts have self signed or
expired certs:  using default (verify peer) in these instances results
in 'SSL peer certificate or SSH remote key was not OK'
2021-12-18 17:00:05 +00:00
ejurgensen
5efe0eeb0f [pipe] Fix regression in commit 6646802
Don't try to apply pipe metadata if parsing failed. Resolves #1366.
2021-12-12 10:32:42 +01:00
ejurgensen
d6cc0e453d [airplay] Update pair_ap to 0.12
Better input validation of public keys
2021-12-06 22:49:34 +01:00
ejurgensen
088e26c1f0 [airplay] Fix rare pairing bug due to incorrect SRP padding (ref #1280)
Update pair_ap to version 0.11, which it fixes an issue where some randomized
values of SRP "a" are short enough that they require padding.
2021-12-04 23:05:33 +01:00
ejurgensen
1418bfb245 [scan] Don't iTunes playlist scan timestamp on failed scan
Also some refactoring.

Closes #1359
2021-12-01 20:11:54 +01:00
ejurgensen
b71c353fc9 [spotify] Update librespot-c for better connection handling
- New attempt at fixing #1317: Don't prevent reconnection if a request is queued
- Protection against flooding Spotify with reconnection attempts
- Don't reconnect when getting a stop request during blocked download
2021-11-27 15:10:56 +01:00
ejurgensen
ce5634e372 [spotify] Fix log message typo 2021-11-20 14:55:27 +01:00
ejurgensen
6646802832 [pipe] Fix deadlock coming from metadata pipe (issue #1343)
Cause of deadlock:
  new volume pipe metadata -> lock pipe mutex -> set player volume waiting for
  player -> player waiting for input write -> input write waiting for get
  metadata -> get metadata waiting for mutex

Change implementation so lock is only held while parsing/storing metadata,
where it is required, and not when calling the player.
2021-11-15 23:13:13 +01:00
ejurgensen
0d67f26662 [artwork] Fix memleak on pipe artwork error 2021-11-15 22:57:43 +01:00
ejurgensen
6d54886030 [librespot-c] Close connection if peer disconnects
Attempt to fix possible bad state where librespot-c keeps try to using a
connection even after the access point has disconnected.
2021-11-04 17:20:55 +01:00
ejurgensen
5e66dbd8c9 [spotify] Fix Spotify initialization issues
* loading library even though library playback login failed
2021-11-01 10:37:17 +01:00
ejurgensen
65d578f8c8 [scan] Ignore 0-byte files in library so ffmpeg 3.2 doesn't crash 2021-10-29 23:08:37 +02:00
whatdoineed2do
a5f75dab36
[jsonapi] /api/library/*/{id} returns 404 (instead of 500) on not finding item (#1326)
Co-authored-by: whatdoineed2do/Ray <whatdoineed2do@nospam.gmail.com>
2021-10-25 17:36:51 +02:00
ejurgensen
d2ee9f20fb [jsonapi] Add PUT /api/library/tracks endpoint (update multiple tracks)
Also fix error in json doc (track->id type)
2021-10-10 23:31:34 +02:00
ejurgensen
41e3733ccc [misc] Make safe_xxx integer conversions safer by checking for NULL input
Also don't touch output on error + fix missing check for return in db.c
2021-10-09 23:39:00 +02:00
ejurgensen
c4d57aa5d1 [spotify] Clear spotify_status on logout (clears logged_in and username) 2021-10-05 20:46:44 +02:00
ejurgensen
ae7280b770 [library] Fix macos format warning
library.c:233:123: warning: format specifies type 'long' but the argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat]
2021-10-01 19:01:32 +02:00
ejurgensen
679c142212 [db] Remove unused strdup_if() 2021-10-01 18:58:13 +02:00
ejurgensen
5e93080aa2 [airplay] Fix warning about int type seqnum 2021-10-01 16:52:47 +02:00
ejurgensen
aff8ac6a6b [raop] Fix warning about int type seqnum 2021-10-01 16:52:02 +02:00
ejurgensen
7572560bf2 [chromecast] Fix format and type errors 2021-10-01 16:44:30 +02:00
ejurgensen
63c3d59d2f [spotify] Preserve fine-grained errors from request_make() 2021-09-24 19:17:47 +02:00
ejurgensen
6692411040 [-] Fixup PR 1309 (usermark) 2021-09-17 22:58:21 +02:00
whatdoineed2do/Ray
4d5c256327 [db,jsonapi] revert usermark from queue item table 2021-09-16 10:43:55 +01:00
whatdoineed2do/Ray
16cf3cb44b [jsonapi] use u32 types for parsing param: rating 2021-09-16 09:11:31 +01:00
whatdoineed2do/Ray
52d1ba7dd4 [db,jsonapi] remove DB_FILES_USERMARK_MAX 2021-09-15 08:40:07 +01:00
whatdoineed2do/Ray
d43ce017f5 [db,jsonapi,smartpl] db usermark flag review 2021-09-08 14:51:55 +01:00
whatdoineed2do/Ray
e65203e1e2 [db] expand file tbl's flag values 2021-09-07 11:49:24 +01:00
whatdoineed2do/Ray
ad573b8bc7 [db,jsonapi]] update api/library/tracks and db to accept 'flag' param 2021-09-06 20:15:35 +01:00
whatdoineed2do/Ray
5cbb5f061d [smartpl] add review 'flag' 2021-09-06 20:15:35 +01:00
whatdoineed2do/Ray
4dcc9b602e [db] add review 'flag' column to files/queue tbls 2021-09-06 20:15:35 +01:00
Christian Meffert
29cd5a7a19
Merge pull request #1286 from chme/spotify_podcasts
[spotify] Scan spotify podcast subscriptions into library
2021-09-04 12:06:26 +02:00
chme
d8a344d87c Fix wrong check for NULL after creating smartpl parser 2021-09-04 09:55:11 +02:00
chme
ce3e79d804 [spotify] Move "has_podcast_support" to spotify_status and expose this
flag in the web API
2021-09-04 09:46:29 +02:00
chme
c58e792ff4 [spotify] Code format change 2021-09-04 09:46:28 +02:00
chme
f700935b57 [spotify] Add artwork support for episodes (podcasts) 2021-09-04 09:46:28 +02:00
chme
24450bc90a [spotify] Scan spotify podcast subscriptions into library 2021-09-04 09:46:28 +02:00
ejurgensen
3f13ab1026 [pipe] Use fstat instead of lstat to fix time-of-check time-of-use warning
Fixes warning from CodeQL. Wasn't really a security issue since the check was
just a service to the user.
2021-09-02 00:17:22 +02:00
ejurgensen
de7ab1547f [library] Remove needless stat() in scan_playlist()
Fixes time-of-check time-of-use warning from CodeQL
2021-09-02 00:12:18 +02:00
ejurgensen
54faa11ce5 [spotify] Update librespot-c so ./configure works with FreeBSD 2021-09-01 17:11:45 +02:00
ejurgensen
7584e6377f [misc] Fix forgotten return in net_evhttp_bind()
Makes it impossible to use the bind_address config setting properly
2021-08-30 23:46:36 +02:00
ejurgensen
e1375f6ad6 [streaming] Clean up streaming_player_status_update()
Fixes compiler warning from newer versions of gcc + reduces malloc's
2021-08-27 16:46:08 +02:00
ejurgensen
774d7c36fd [input] Logging changes 2021-08-18 01:00:17 +02:00
ejurgensen
f4983b8a11 [airplay] Add missing include of errno.h in the new events handling
Closes #1294
2021-08-14 21:13:50 +02:00
ejurgensen
b6835fac29
[airplay] Support for airplay events (eg Homepod controls)
Ref. issue #1181
2021-07-31 01:16:23 +02:00
ejurgensen
246d8ae0ce [misc] Fix use-after-free in net_bind()
Thanks to Ba Jinsheng for reporting this bug
2021-07-31 00:55:48 +02:00
Christian Meffert
dc8e66109e
Merge pull request #1284 from chme/web-update
Web interface v1.1.0
2021-07-09 10:03:38 +02:00
Christian Meffert
81dafab4ac
Merge pull request #1283 from chme/smartpl-comment-field
[smartpl] Add "comment" field to smartpl expression language
2021-07-09 10:02:51 +02:00
Christian Meffert
3a9589c25b
Merge pull request #1282 from chme/httpd_webroot
[httpd] Dereference web root directory to allow symlinks
2021-07-09 09:56:06 +02:00
ejurgensen
d2f4efa1bf [misc] Centralize thread naming plus name websocket thread 2021-07-05 21:40:31 +02:00
ejurgensen
eae09039d5 [spotify] Add missing include of config.h 2021-07-05 21:09:02 +02:00
chme
1e4728f6b1 [jsonapi] Expose "use_libspotify" config 2021-07-04 14:40:08 +02:00
chme
44c24cee0f [jsonapi] Add "comment" field to track object 2021-07-04 12:03:05 +02:00
chme
467b169210 [smartpl] Add "comment" string field 2021-07-04 11:48:51 +02:00
chme
93b9740233 [httpd] Dereference web root directory to allow symlinks 2021-07-04 11:41:39 +02:00
ejurgensen
e18969ef75 [rsp] Interpret artist in queries as album_artist (fixes #1263) 2021-06-07 20:22:36 +02:00
ejurgensen
5d2d2ea227 [spotify] Add missing include of errno.h (fixes #1267) 2021-06-05 21:10:22 +02:00
ejurgensen
9fbbf9836c [spotify] Submit actual system info to Spotify 2021-06-05 21:09:44 +02:00
ejurgensen
4463d4e7d8 [-] Fix build with old libgcrypt versions (eg Buster's) with no pkg-config 2021-06-01 20:29:16 +02:00
ejurgensen
6f0fef6179 [spotify] Reintroduce libspotify support, change spotifyc to librespot-c
Select use of either libspotify or librespot-c as streaming backend via config
option.

librespot-c (renamed/improved spotifyc) impl has the following:
- sync interface
- seek support
- honor bitrate config, set client and thread name
- use web access token with "streaming" scope for login
- fix issue with podcast playback

Also say goodbye to file-based Spotify login.
2021-05-31 23:24:58 +02:00
ejurgensen
2bbc5f16c5 [xcode] Add support for seekable custom I/O (evbuffer input to transcode) 2021-05-31 11:55:32 +02:00
ejurgensen
57449a126a [xcode] Merge avio_evbuffer into transcode
Only used by transcode anyway. Makes it easier to add custom seek for evbuffer.
2021-05-31 11:55:32 +02:00
ejurgensen
b058f47ffb [input] Also log input buffer threshold in debug mode 2021-05-31 11:55:32 +02:00
ejurgensen
a67c74ba6c [spotify] Introduce own spotifyc as replacement for libspotify 2021-05-31 11:54:30 +02:00
ejurgensen
d3cc8a52f8 [mpd] Minor fixup 2021-05-28 16:57:57 +02:00
ejurgensen
c96dc1fcff [dacp] Fix support for device-volume (speaker volume buttons)
Closes #613
2021-05-26 23:20:40 +02:00
ejurgensen
d2187d0ace [db] Partially revert commit aaffa4a so that source sort tags are used again
Fix for issue #1257
2021-05-25 23:44:53 +02:00
ejurgensen
684c23a044 [db] Fix error where adding Spotify track to queue returns "0 tracks added"
Caused by queue_item_add returning >0 as success, but caller is expecting ==0.
Try to avoid other occurancess of this issue by generally checking for error
("ret < 0") instead.
2021-05-24 21:55:09 +02:00
ejurgensen
5fdace5195 [web] Remove verbose listener_cb() logging added in commit f939215 2021-05-21 23:43:00 +02:00
ejurgensen
28f8ff5253 [web] Fix libwebsocket 2.0 (Debian Buster) incompability added in commit 1a56255 2021-05-21 19:59:12 +02:00
ejurgensen
5de0533232 [airplay] Add mdns txt for Sonos Symfonisk 2021-05-21 18:50:28 +02:00
ejurgensen
1a56255c54 [web] Fix for websocket server only listening on ipv6 on FreeBSD
Credit @luusl
2021-05-21 16:13:44 +02:00
ejurgensen
5128d9478a [misc] Fix for evhttp_bind_socket not supporting dual stack ipv4/6 on BSD 2021-05-20 21:01:00 +02:00
ejurgensen
c1db4d914f [http] Also allow remote playlists to have https streams (fixes #1251)
Fix it by adding net_is_http_or_https() utility function in misc.h and make
sure it used whenever a http protocol check is made.
2021-05-19 22:53:25 +02:00
Christian Meffert
f93921554e
Merge pull request #1243 from luusl/enhance_websocket
Improve the websocket to send events to clients immediately.
2021-05-19 20:32:08 +02:00
taku0220
4d22cb05b3 [scan]Add sort tags for ALAC 2021-05-19 03:02:08 +09:00
martin
f3e5400caf Libwebsockets 2.x compatibility 2021-05-17 12:47:57 +02:00
martin
a15edfcae9 Improve the websocket to send events to clients immediately. 2021-05-13 22:54:11 +02:00
ejurgensen
520a1251ec [-] Change forked-daapd -> owntone in src/.gitignore 2021-05-06 20:48:52 +02:00
ejurgensen
a93455b5a9 [cfg] Rename configure macros FORK -> OWNTONE 2021-04-24 23:54:20 +02:00
ejurgensen
5f1686695a [-] Name update forked-daapd -> owntone throughout the code 2021-04-24 23:54:20 +02:00
ejurgensen
f61665b81d [-] Rename source and target names from forked-daapd to owntone 2021-04-24 23:54:20 +02:00
ejurgensen
89807b61ed [input] Fix possible segfault-on-exit
Could occur if killed during playback (because input_stop() is async, thus
referencing cmdbase after it is destroyed)
2021-04-22 17:00:36 +02:00
luusl
8a1f85a14e Fixed potential crash on pulseaudio sink info callback, when an error
occurs.
2021-04-12 13:11:47 +02:00
ejurgensen
f77161b5c2 [jsonapi] Get currently playing queue item details (closes #1206)
Add now_playing shorthand, so that /api/queue?id=now_playing returns the
currently playing queue item info.
2021-04-05 08:49:27 -07:00
ejurgensen
1fafab12e3 [xcode] Fix for "Invalid return value 0 for stream protocol" log msg
Custom avio must not return 0, see https://patchwork.ffmpeg.org/project/ffmpeg/patch/20171025082258.32530-2-george@nsup.org/
2021-04-05 09:57:50 +02:00
ejurgensen
c7faefe1f8 [docs] Change git links: owntone/forked-daapd -> owntone/owntone-server 2021-04-01 22:09:26 +02:00
ejurgensen
790c9dcca9 [misc] Define SOCK_NONBLOCK and SOCK_CLOEXEC if platform doesn't 2021-04-01 01:45:09 +02:00
ejurgensen
64d6b0d4c3 [raop] Fix scan-build make warning after removing switch in commit 98dad07 2021-04-01 01:21:11 +02:00
ejurgensen
ba8b752a9b [misc] Fix macOS build (doesn't have SOCK_CLOEXEC) 2021-04-01 00:01:12 +02:00
ejurgensen
ed6176062a [airplay] Logging adjustments 2021-03-31 23:55:25 +02:00
ejurgensen
d2a5f939f5 [mpd] Bind via misc.c's net_xxx methods 2021-03-31 23:55:25 +02:00
ejurgensen
d4711decdc [httpd] Bind via misc.c's net_xxx methods 2021-03-31 23:55:25 +02:00
ejurgensen
11151affbd [misc] Add net_evhttp_bind() for centralizing libevent based binding 2021-03-31 23:55:25 +02:00
ejurgensen
c423f3af91 [cfg] Add websocket_interface option 2021-03-31 23:55:25 +02:00
ejurgensen
e5fcfc6574 [cast] Use net_connect() instead of own cast_connect() 2021-03-31 23:55:25 +02:00
ejurgensen
98dad07b7f [airplay] Convert services to dual stack, plus use net_connect() and net_bind() 2021-03-31 23:55:25 +02:00
ejurgensen
f3febb63d9 [raop] Convert services to dual stack, plus use net_bind() and net_connect() 2021-03-31 23:55:25 +02:00
ejurgensen
dfc1580f13 [misc] Add logging of net_connect() service 2021-03-31 23:55:25 +02:00
ejurgensen
dd0f0ece78 [mdns] Remove ipv4/ipv6 argument to mdns_browse
Make sure mdns_browse() always works the same, and follows user config.
2021-03-31 23:55:25 +02:00
ejurgensen
7871d71a9c [misc] Add utility network functions, incl configurable addr binding
Also make misc.c/h a bit less messy.
2021-03-31 23:55:25 +02:00
ejurgensen
3673aa7215 [player] Protect against crash if very first input_write() is FLAG_ERROR 2021-03-31 22:20:56 +02:00
ejurgensen
daa0652e7b [docs] Rename repo: ejurgensen -> owntone 2021-03-30 23:39:07 +02:00
ejurgensen
75f6c72003 [misc] Correct comment 2021-03-27 22:44:16 +01:00
ejurgensen
9c3887a80f [commands] Add missing include 2021-03-27 22:44:02 +01:00
ejurgensen
19635e61ec [httpd] Fix scan-build make warning from commit 3a03c74
Potential buffer overflow
2021-03-15 21:59:40 +01:00
chme
3a03c74f91 Deny access to files outside the web root directory 2021-03-14 09:08:16 +01:00
ejurgensen
363bd5644b [pipe] Support for Shairport sync metadata flush event 2021-03-12 19:48:01 +01:00
ejurgensen
bbe7526414 [airplay] Update pairing modules (pair_ap 0.2) 2021-03-07 23:02:14 +01:00
Peter Salas
8ba35dfa19 [scan] Remove leftover iTunes #ifdefs 2021-02-28 08:31:16 -08:00
ejurgensen
036100eecd [cast] Length check of protobuf messages just to be safe 2021-02-17 22:45:45 +01:00
ejurgensen
13be7999cb [db] Add some headers in db_upgrade.c for easier navigation 2021-02-10 20:05:56 +01:00
ejurgensen
bd91a238ec [db] Upgrade schema to 21.06, change default of query_limit to 0 2021-02-10 20:04:56 +01:00
ejurgensen
79b4a070b0 [db] Change type of "disabled" to int64
Before the value in the db was not read straight into mfi->disabled and
pli->disabled, instead it was evaluated as != 0, so the ->disabled field
would just be true or false. This was also necessary when INOTIFY_FAKE_COOKIE
(1 << 32) was written to the DB, because it could not fit in the uint32 of
mfi->disabled/pli->disabled.

I consider this juggling poor practice, so with this change it is read straight
in and out, always as a int64.
2021-02-09 15:16:06 +01:00
ejurgensen
b6163c9d34 [db] Fix bug in bind_generic, input to sqlite3_bind_int64 should be int64_t 2021-02-09 15:16:06 +01:00
ejurgensen
1fa1d9091b [db] Consolidate setting struct fields from database queries 2021-02-09 15:16:06 +01:00
ejurgensen
689d1ce3dd [db] Refactor queue_item functions
- Use prepared statements
- Add qi_mfi_map that defines mapping between mfi, dbmfi and qi
- Use qi_cols_map/qi_mfi_map for iteration (avoid duplicating field references)
- Stick to "qi" as name for a queue_item in db.c (more similar to mfi/pli/gri)
- Some renaming and other minor stuff in db.c's queue code
2021-02-09 15:16:06 +01:00
ejurgensen
76c52bba3b [rsp] Add ALAC as a codec Roku supports (ref issue #1182) 2021-01-29 20:31:53 +01:00
ejurgensen
ac6d87656a [airplay] Change recommended airplay2-receiver repo 2021-01-29 20:30:22 +01:00
chme
f75947f29a [db] Remove break after v2103 update and directly run update for v2104
The break results in the ugrade stopping at v2103 and only after another
restart of forked-daapd the update to v2104 happens. Removing it will
directly update to the latest DB version.
2021-01-23 16:32:41 +01:00
ejurgensen
728d253e1f [jsonapi] Make updating of currently playing track metadata easier
Update to commit #aaffa4a that makes it easier to update currently playing
track, user can use "now_playing" instead of getting the queue item id.
2021-01-21 22:46:19 +01:00
ejurgensen
aaffa4a83f [jsonapi] Add support for updating queue_item metadata (closes #1153)
This commit also changes db.c's sort_tag_create to always recreate sort tags,
so that they match source tags, should they have changed. Unclear to me why
the previous solution didn't do that, so will probably regret this change when
it dawns on me.
2021-01-21 20:56:05 +01:00
ejurgensen
275d66b6ad [airplay] Use compressed ALAC to save bandwidth
Uses ffmpeg to compress ALAC. Before each audio packet was always 1411 bytes,
now they are half or even much less if it is just silence.
2021-01-18 00:19:34 +01:00
ejurgensen
1977db0319 [xcode] Add profile for ALAC encoding 2021-01-18 00:19:34 +01:00
ejurgensen
f105958a64 [airplay] Fix so that AirPlay 2 devices are removed 2021-01-18 00:19:34 +01:00
chme
0334269989 [mpd] Support search/find/count with modified-since filter criteria 2021-01-16 10:45:15 +01:00
chme
9ff06f094d [htdocs] Rebuild web interface v0.8.5 2021-01-16 08:23:50 +01:00
ejurgensen
60b096c707 [airplay] Make auth-setup easier to test via a define switch 2021-01-14 22:53:09 +01:00
ejurgensen
8b9e064af9 [raop] Lower log level 2021-01-14 22:46:20 +01:00
ejurgensen
b2b91998d9 [airplay] Fix decryption of large responses
If the response is large evrtsp will not read the entire message from the
socket. This change allows for decryption and parsing of partial messages.
2021-01-14 21:36:47 +01:00
ejurgensen
73c5dcec5a [airplay] Update pairing, change ciphering function return values 2021-01-14 21:29:22 +01:00
ejurgensen
754f69bb10 [airplay] Change logging for devices that don't have AirPlay 2 features field
Closes #1167 re announcement from Kodi
2021-01-12 17:59:43 +01:00
ejurgensen
74f4b2c8b2 [airplay] Fixup 2021-01-12 17:56:47 +01:00
whatdoineed2do/Ray
5eeadd3f1b [settings] add webinterface.recently_added_limit 2021-01-11 19:40:04 +01:00
ejurgensen
8f48179365 [airplay] Small update to pairing modules 2021-01-10 23:33:19 +01:00
ejurgensen
1546a43585 [airplay] Disable extended logging 2021-01-10 23:32:34 +01:00
ejurgensen
4e122303a1 [conf] Add speaker level option to disable AirPlay 1 2021-01-10 16:42:08 +01:00
ejurgensen
9805f03d10 [airplay] Update pairing, fix compiler complain about const initialization 2021-01-10 15:29:28 +01:00
ejurgensen
6b91c92bca [airplay] Remove rs->session, not used any more 2021-01-10 15:05:21 +01:00
ejurgensen
ef0f41dc46 [airplay] Separate naming of AirPlay 1 and 2, incl log domains 2021-01-10 15:05:21 +01:00
ejurgensen
f16dc204b2 [player] Logging fixup 2021-01-10 15:05:21 +01:00
ejurgensen
ffadc399af [cfg] Add option for prefering AirPlay 2 (useful for testing) 2021-01-10 15:05:21 +01:00
ejurgensen
a5bd8b011e [cfg] libplist+libsodium now required, remove configure options
Need the two libraries for AirPlay 2, which can't be optional.

Means iTunes XML and device verification configure options are no longer
useful.
2021-01-10 15:05:21 +01:00
ejurgensen
01360fff99 [airplay] Delete auth_key on probe failure 2021-01-10 15:05:21 +01:00
ejurgensen
9cdd2a9f8b [db] Upgrade schema to 21.05 (change auth_keys in speaker table) 2021-01-10 15:05:21 +01:00
ejurgensen
3ea480d1e7 [player] Use output priority to select between raop/Airplay 1 and Airplay 2 2021-01-10 15:05:21 +01:00
ejurgensen
fac97eed9c [raop] Drop handling of old auth_keys, not necessary with db schema update 2021-01-10 15:05:21 +01:00
ejurgensen
8368ca7686 [airplay] Add support for AirPlay 2
Includes
- Implementation in src/outputs/airplays2, type OUTPUT_TYPE_AIRPLAY
- Homekit pairing, both normal (with PIN) and transient
- New session startup sequence, incl GET /info, SETPEERS and 2 x SETUP
- No more OPTIONS and ANNOUNCE
- Use POST /feedback for keepalive instead of SET_PARAMETERS
- Sequence dispatching instead of callback chains
- Continue despite "Bad request" to SET_PARAMETER (volume)
- Opening of event connection to receiver (reverse rtsp connection)

Still to be done
- Password authentication
- Handling of events
2021-01-10 14:58:06 +01:00
ejurgensen
86f762bb1f [plist_wrap] Add libplist convenience wrapper 2021-01-10 14:52:31 +01:00
ejurgensen
3b00900572 [player] Add pkt->header_len in rtp_common 2021-01-10 14:51:16 +01:00
ejurgensen
8b842be17f [evrtsp] Add support for SETPEERS and GET 2021-01-10 14:45:39 +01:00
ejurgensen
4621d25aaa [logger] Add DHEXDUMP() for logging raw data
Substitute for Wireshark when the data exchange is encrypted
2021-01-10 14:45:39 +01:00
Christian Meffert
724cfa0093
Merge pull request #1134 from chme/podcast-updates
[library] Directly notify listeners of db changes after adding new items
2021-01-09 11:21:42 +01:00
ejurgensen
506959985b [xcode] Treat Apple Music like iTunes (closes #1152) 2020-12-26 12:57:43 +01:00
ejurgensen
14756c0d59 [outputs] Add nickname option for Airplay/Chromecast speakers (issue #1145) 2020-12-15 21:45:58 +01:00
ejurgensen
76cd982201 [rtsp] Shorten evrtsp timeouts, 45-50 sec is too long 2020-12-11 17:12:31 +01:00
ejurgensen
1d5691be2f [artwork] Refactor artwork_get() and fix issue #1139
artwork_get() would return error for non-file images that shouldn't be
rescaled, which was a bit weird. This makes artwork_get() more straight-
forward.

Also fix issue #1139 simply by not calling artwork_get() in cases were
queue_item->artwork_url is an old temp file (in source_item_pipe_get).
2020-11-28 21:27:58 +01:00
ejurgensen
d1a1f6c59c [pipe] Log when artwork is written to temp file 2020-11-28 21:27:58 +01:00
whatdoineed2do/Ray
4082f9e215 [library] Add function to delete playlist by id that directly
invalidates the REST API client caches
2020-11-28 08:27:52 +01:00
Justin Wong
0f5393633a Check utf-8 in metadata_packet_get 2020-11-23 23:31:00 +08:00
chme
59bac6b068 [mpd] Add missing OK response line, if multiple commands are sent
without beeing wrapped in a command list
2020-11-22 11:33:40 +01:00
chme
ccaa7967bf [mpd] Fix nextsong/nextsongid in status cmd response 2020-11-22 11:33:40 +01:00
chme
3fbe16ac1b [library] Directly notify listeners of db changes after adding new items 2020-11-22 11:09:31 +01:00
chme
13e8103962 [httpd/spotify] Remove redirect to legacy admin.html page 2020-11-22 10:27:10 +01:00
ejurgensen
b6a686866a [xcode] Retry with default probe size if quick probe fails (issue #1126) 2020-11-21 20:40:30 +01:00
ejurgensen
04fa902b01 [xcode] Change open_input() to return ffmpeg error 2020-11-21 20:40:30 +01:00
ejurgensen
eea3a3bd27 [xcode] Fix memleak on open input error 2020-11-21 20:40:30 +01:00
whatdoineed2do/Ray
2e69f5dac6 [rss] defer playlistitems purge til ready to update with new rss
Current impl fetches pl, purge pl items, fetch RSS, inserts entries.  If the RSS
fetch fails (remote server is temporary unreachable) the playlistitems for that
RSS are all dropped.

This has a side effect that RSS playlists cannot be determined from tracks (see
issue #1126) and thus cannot be deleted.

Simple fix to defer playlist item purge to the point that the RSS fetch is ok
and before the inserts
2020-11-21 14:01:39 +00:00
ejurgensen
695927de2a [artwork] Remove old artwork_get_xxx in favor of new which has a format arg 2020-11-18 23:23:05 +01:00
ejurgensen
a9e6497be2 [cast] Increase packet buffer 2020-11-18 23:13:00 +01:00
ejurgensen
572c15a04d [cast] Remove some unused MEDIA_xxx commands 2020-11-18 23:13:00 +01:00
ejurgensen
bb8719718a [cast] Rename state enums, don't use MEDIA any more 2020-11-18 23:13:00 +01:00
ejurgensen
d5f5e312ab [cast] Add config option for max_volume, like for Airplay 2020-11-18 23:13:00 +01:00
ejurgensen
c21266d26f [cast] Use RTCP ACKs/nACKs from device to control how packets are sent
Previously we just sent packets when ready, which especially during startup
meant a largish number of packets got sent rapidly. This seemed to cause audio
glitches. With this change the rate is adapted to follow ACKs from the device,
which is more in line with Chromium's way, though still far from the same.

Also added capability to resend packets when a nACK is received.

Also some wip attempts at sending coverart as VP8 video.
2020-11-18 23:13:00 +01:00
ejurgensen
dff64e3dd0 [raop] Remove endian includes, now included via rtp_common.h 2020-11-18 23:13:00 +01:00
ejurgensen
06d1d7273d [player] Add a basic RTCP parser for Chromecast packets
Also put the endian includes in the header, both raop.c and cast.c will need
them.
2020-11-18 23:13:00 +01:00
ejurgensen
cd9fa019dd [misc] Add NTOSTR() macro
Get the string value of a number definition
2020-11-18 23:13:00 +01:00
ejurgensen
5929938a18 [outputs] RTP: Distinguish clearly between payload type and marker bit
Also make quality an optional input to rtp_session_new(), since it isn't
required internally by the RTP module.
2020-11-18 23:13:00 +01:00
ejurgensen
2098349fdb [artwork] Add ability to request a specific image format 2020-11-18 23:13:00 +01:00
ejurgensen
7e106aec09 [xcode] Add VP8 encoding profile 2020-11-18 23:13:00 +01:00
ejurgensen
a11ab808b2 [cast] Make fake announcement of video stream (fixes #1092)
For unknown reasons some Chromecast devices disconnect causing a TLS error if
we don't OFFER a video stream. Seems actually sending video isn't required to
fix the issue.
2020-11-18 23:13:00 +01:00
ejurgensen
db43d51568 [xcode] Explicitly set the frame duration of OPUS packets to 20 ms
Protect against errors in case future versions of ffmpeg change default
2020-11-18 23:13:00 +01:00
ejurgensen
ad4b886a11 [cast] Make GET_CAPABILITIES request in debug mode
Note that not all devices support this request
2020-11-18 23:13:00 +01:00
ejurgensen
92953f1a2c [cast] Use unsigned ints for ID's so we don't risk negative values
ssrc_id could become negative because rtp_session.ssrc_id is uint32, but we
were printing it with %d.
2020-11-18 23:13:00 +01:00
ejurgensen
504a66a315 [cast] Add some comments 2020-11-18 23:13:00 +01:00
Christian Meffert
22a4af7b93
Merge pull request #1111 from whatdoineed2do/disable-playlist-caching
[db] playlist cache invalidation fix
2020-11-07 08:43:07 +01:00
ejurgensen
745fee4eb9 [db] Remove unused macro STR() 2020-11-05 23:02:44 +01:00
ejurgensen
6eb01f8ffc [outputs] Remove incorrect NULL return if packet buffer seqnum is 0
Since seqnum wraps around it should be ok to call rtp_packet_get() even when
session->seqnum is 0.
2020-11-03 23:44:22 +01:00
whatdoineed2do/Ray
7917695676 [db] add LISTENER_DATABASE for db_pl_*() on CRUD 2020-11-03 10:12:42 +00:00
whatdoineed2do/Ray
827921a028 [db] update db_statement_run() to accepts update events like db_query_run() 2020-11-03 09:28:14 +00:00
nia
4cdeb1afea Remove unnecessary check for FreeBSD
The non-timerfd code path depends on SIGALRM being defined, so signal.h
always needs to be included.

This allows forked-daapd to build and run on NetBSD and probably other
BSD systems too.
2020-11-02 15:07:17 +01:00
Christian Meffert
3395773c9f
Merge pull request #1105 from chme/rescan-metadata
[spotify] Force metadata update on library "metarescan" update
2020-10-24 09:57:40 +02:00
ejurgensen
c20b85a6d9 [artwork] Always stash results of http requests in cache, even if negative
This is an attempt to be nice to peers, so that we don't make many similar
requests to e.g. Discogs. This could happen via proces_items() for an album
where we have the same artwork url for each track, and if it was 404 we
would continue attempting the same request for each track.
2020-10-20 23:22:49 +02:00
ejurgensen
0383f19e9f [artwork] Avoid repeating online search requests with same query
This changes online_source_search_check_last() so that it also works if the
last search query was unsuccesful, i.e. last_artwork_url was NULL.
2020-10-19 22:34:26 +02:00
ejurgensen
f48fae20e2 [db] Remove unused db_speaker_clear_all() 2020-10-19 20:39:03 +02:00
ejurgensen
d2d9b78ae7 [player] Don't unselect disappeared speakers on exit/restart
With the new speaker selection philosophy we aim to preserve user choice, so we
shouldn't unselect speakers just because they happen to be switched off when
the server is restarted.
2020-10-19 20:36:32 +02:00
ejurgensen
ce9fbff8f5 [artwork] Use cache stash to avoid making repeated requests
E.g. for an album we would for each track request artwork from Spotify, even
though the requests are similar and the first one didn't give a result.
2020-10-19 20:25:01 +02:00
ejurgensen
3233aefa8a [scan] Improve logging of inotify events 2020-10-19 20:24:31 +02:00
chme
bda2cff5db [spotify] Force metadata update on library "metarescan" update 2020-10-18 10:35:51 +02:00
chme
d29f56f3eb [httpd] Add "max-age=0" to Cache-Control header to force browsers to
always revalidate cached content
2020-09-27 19:13:07 +02:00
chme
20a2c96b2a [jsonapi] Add boolean field "random" to playlist
The new field "random" is true for smart playlists with an order by
clause "random", otherwise it is false. This allows clients to handle
randomly generated playlists differently from static playlists.
2020-09-27 19:13:07 +02:00
chme
dd811e6c70 [jsonapi] Prevent browsers to cache playlist tracks
The tracks of a smart playlist might change between library rescans.
Allowing them to be cached based on the last rescan timestamp
("Last-Modified" header in the response) leads to potentially showing
incorrect track listing if a cached version is used. Thus the response
for playlist tracks should never be cached by the browser (this is
achieved with setting "Cache-Control" header to "no-store").
2020-09-27 19:13:07 +02:00
Tucker Kern
39b14ff8d4 Use relative paths in web interface to ease reolcation or proxying 2020-09-27 19:13:07 +02:00
chme
023436c959 [settings] Add support for (optional) default values and remove default
value functions for artwork
2020-09-27 19:13:07 +02:00
chme
e86aa95d89 [settings] Add new setting for "webinterface"
- add settings to show/hide menu items in the top nav bar
- add setting to show/hide cover artwork in album lists
2020-09-27 19:13:07 +02:00
Christian Meffert
1258427afc
Merge pull request #1090 from chme/spotify-release-date
Map release date for Spotify tracks + fix release data being off by one day
2020-09-24 06:44:23 +02:00
ejurgensen
81c776fc4a [player] Fixup commit 1f45967 2020-09-21 17:18:09 +02:00
ejurgensen
1f45967481 [player] Fix autoselect so it also applies when there are no selected devices (second attempt)
Second attempt at fixing regression in version 27.2. First attempt was commit 2345885.

Closes #1091.
2020-09-21 17:12:18 +02:00
chme
a28c6ba1d6 [spotify] Scan album info during saved playlists scan (if available) 2020-09-19 08:00:26 +02:00
ejurgensen
513a09e6d1 [player] Reduce log severity of devices not starting 2020-09-06 23:18:08 +02:00
ejurgensen
2345885f19 [player] Fix autoselect so it also applies when there are no selected devices
Regression in version 27.2. Closes #1091.
2020-09-06 00:12:15 +02:00
ejurgensen
500f57ba1a [player] Clear up return value of outputs_start()
Should return 0 if no devices at all, or if none selected. Should not return
negative from failure to stop unselected devices.
2020-09-06 00:08:40 +02:00
chme
451e0bf10b [spotify/jsonapi] Map date_released for Spotify tracks; fix date
released being off by one day in the JSON API
2020-09-01 20:37:10 +02:00
chme
6f5822e461 [jsonapi] Map fields time_added, time_played, seek for album / artist 2020-08-30 09:08:41 +02:00
chme
a74a3e5add [db] Add fields time_added, time_played, seek to group object 2020-08-30 09:08:41 +02:00
chme
382467eb9c [jsonapi] Map additional metadata for artist and album 2020-08-30 09:08:41 +02:00
chme
8afae4a41b [db] Fetch additional metadata for artist and album in group query 2020-08-30 09:08:41 +02:00
ejurgensen
bb9536ef44 [scan] Early skip if file should be ignored
Avoids needless logging, e.g. from failed lstat(). Closes #1078.
2020-08-22 21:38:12 +02:00
ejurgensen
c5df688caf [alsa] Align commit bfe99e5 with coding style 2020-08-22 21:36:10 +02:00
whatdoineed2do/Ray
bfe99e56f7 [alsa] use alsamixer volume adjustment algorithm 2020-08-22 21:25:17 +02:00
ejurgensen
11de4c09bc [misc] Also have buildopts[] have disabled features + regex 2020-08-19 20:12:06 +02:00
ejurgensen
a5ddb3c85d [player] Fix for volumes of unselected devices being reduced
Closes #1077
2020-08-13 20:48:48 +02:00
ejurgensen
de5060bc57 [db] Remove a FIXME, not much of an issue 2020-08-10 23:03:37 +02:00
ejurgensen
d77927d3c3 [xcode] Fix incorrect error check, unsigned int can't be negative
av_find_best_stream() returns an int, with negative being an error

Credit lgtm.com
2020-08-10 22:56:08 +02:00
ejurgensen
d9177dfb25 [artwork] Remove some superfluous checks
Credit lgtm.com
2020-08-10 22:50:04 +02:00
ejurgensen
a0876e532c [websocket] Prefix globals with websocket_
Avoids e.g. "event" being both the name of a global and a parameter name in
send_notify_reply()

credit lgtm.com
2020-08-10 22:36:00 +02:00
ejurgensen
23be5aa749 [config] Name change to avoid overlapping/hiding global variable "cfg"
credit lgtm.com
2020-08-10 22:29:02 +02:00
ejurgensen
5e6b5fbe8a [httpd/logger] Use gmtime_r/localtime_r instead of gmtime/localtime
gmtime and localtime are not thread safe

credit lgtm.com
2020-08-10 22:23:21 +02:00
ejurgensen
fada4c0ee7 [lastfm] Fix incorrect error condition test 2020-08-10 22:08:35 +02:00
ejurgensen
47779e59e7 [input] Fix memleak of path when seting up a new input file
Credit @whatdoineed2do

Closes #1067
2020-08-10 22:01:49 +02:00
whatdoineed2do/Ray
76d35f5abc [scan] bulk_scan() counter reset before processing any library dirs 2020-08-09 22:33:23 +02:00
ejurgensen
55d5289c05 [player] Add settings for persisting repeat, shuffle and consume
Closes issue #963
2020-07-24 20:15:03 +02:00
ejurgensen
3245b81e60 [settings] Add shorthand macros for getting/setting options 2020-07-24 20:15:03 +02:00
whatdoineed2do/Ray
d567bd004a [db,conf,json] new backup endpoint 2020-07-24 20:07:42 +02:00
ejurgensen
a71444d3e1 [player] Limit auto reconnection + add option for user override
With this commit auto reconnection per default will only be done for ATV4s and
HomePods. Reconnection is not always desirable, for instance if the device cuts
the connection because it is busy with something else, ref. issue #934.

The commit also adds an option to override auto reconnection, thus either
enabling it for other devices or disabling it for affected devices.
2020-07-24 00:10:26 +02:00
ejurgensen
e8bdcd2365 [xcode] Use ffmpeg's "image2pipe" muxer instead of "image2"
With ffmpeg 4.3 it seems image2 no longer works for non-file output, so use
image2pipe instead.

Closes #1061
2020-07-19 23:52:42 +02:00
ejurgensen
d0a7d5114b [http] Drop own Shoutcast metadata requestor, rely on ffmpeg now
ffmpeg/libav has been capable of this since approx 2016, so the fallback
functions can be dropped now.

Also means we don't add automatically add Icy-MetaData: 1 to request
headers any more.
2020-07-17 00:08:16 +02:00
ejurgensen
3e707c4060 [http] Make libcurl a hard requirement
Always using libcurl makes the code simpler, plus makes sure we always have a
https client
2020-07-16 23:30:05 +02:00
ejurgensen
941fb47c1d [player] Only resurrect speakers that fail during playback
Fix bug where we would resurrect speakers, incl restart playback, if the speaker
disconnected after a flush.

Closes #1057
2020-07-16 23:08:58 +02:00
ejurgensen
c4d6e1c251 [raop] Extra logging of invalid retransmit headers 2020-07-16 21:30:48 +02:00
whatdoineed2do/Ray
c6c1e8f9ee [alsa] dump_card() includes ALSA device name
Include ALSA's device name in the ALSA modules 'info' logging to help
identify sound devices as seen by the system for assisting config setup

Many configs use ALSA's hw ids to refer to device but ALSA can also use
device names:

    laudio: Available ALSA playback mixer(s) on hw:0 CARD=Intel (HDA Intel): 'Master' 'Headphone' 'Speaker' 'PCM' 'Mic' 'Beep'
    laudio: Available ALSA playback mixer(s) on hw:1 CARD=E30 (E30): 'E30 '

From the example above can use these ALSA names interchangably:
    'hw:0' and 'hw:Intel'
    'hw:1' and 'hw:E30'
2020-07-14 21:55:46 +01:00
ejurgensen
67f16138c5 [pipe] Change int64_t print mask for log message
Removes compiler warning
2020-07-05 20:59:03 +02:00
ejurgensen
5e60527f40 [spotify] Add an API endpoint for logging out of Spotify 2020-07-05 20:43:51 +02:00