Commit Graph

4128 Commits

Author SHA1 Message Date
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