Commit Graph

48 Commits

Author SHA1 Message Date
ejurgensen
3ee9204ff8 [xcode/daap/rsp] Default transcode to 320 kbps mp3 instead of wav
- Calculate size for both formats (+ move the return to transcode_encode_query)
- Let transcode_needed() decide what format to output
- Determine content-type from transcoding type
- Add transcode-dependent ability to override file metadata in rsp/daap
- Send file size matching format
2023-12-04 17:26:03 +01:00
ejurgensen
537012440b [streaming] Fix mp3 streaming not working with ffmpeg 6
ffmpeg 6 requires fixed size frames for the encoder, so this commit refactors
the mp3 streaming to do support that. Also uses outputs_quality_subscribe which
potentially has better performance (e.g. a 48000 sample rate source will only
be resampled once if both airplay and mp3 streaming want 44100), and makes it
easier to create fixed size frames.

Resolves #1601
2023-05-11 22:30:36 +02:00
ejurgensen
701bad466e [outputs] Add helpers for output buffer copy and free 2023-05-11 22:30:36 +02:00
ejurgensen
e77cb3f94e [streaming] ICY handling using output metadata events/callbacks 2023-03-07 21:01:10 +01:00
whatdoineed2do/Ray
8f722faaf2 [outputs] new output: RCP/Roku/SoundBridge devices
Roku SoundBridge devices can be treated as dumb speakers; they offer a
texted based protocol, RCP, that allows the server to request the Roku
device to connect to the server's stream.mp3 and provides ability to
control volume

Roku devices appear as speakers automatically via mDNS announcements on
the server _roku-rcp._tcp
2022-02-05 21:59:00 +00:00
ejurgensen
f16dc204b2 [player] Logging fixup 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
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
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
ejurgensen
a5ddb3c85d [player] Fix for volumes of unselected devices being reduced
Closes #1077
2020-08-13 20:48:48 +02:00
ejurgensen
a2ec7ee28f [outputs] Fix gcc 10 complaining about multiple definitions
outputs_master_volume, output_device_list and output_buffer were defined in
outputs.h, but should only have been declared with extern.

Solve it by making output_buffer static/non-global (wasn't used anyway), and
the two others are now returned by functions.
2020-06-29 00:19:03 +02:00
ejurgensen
8046f13698 [outputs] Fix issue where speaker becomes unselected after pause (flush) 2020-05-30 21:31:27 +02:00
ejurgensen
5d22f11b0e [player/outputs] Fix for speaker selection and volume adj (closes #1011)
* Make sure that vol_adjust() bases adjustments on the same speakers that the
  user sees as active
* If a speaker fails during activation we unselect it, so that we don't keep
  trying to start it, so we find a new master volume if required, and so it is
  possible for the user to reselect it.
2020-05-27 23:02:29 +02:00
ejurgensen
a9a6f4b584 [outputs] Check for session in outputs_device_authorize() 2020-05-27 23:02:29 +02:00
ejurgensen
d6ec6afb5b [outputs] Remove outputs_authorize()
Replaced by outputs_device_authorize()
2020-05-26 23:21:06 +02:00
ejurgensen
2fa2d33602 [outputs] Add a more standard device authentication function
outputs_authorize() has two issues, one that the caller can't specify device
(problem if there are two devices waiting for verification), the other that it
didn't offer a standard callback, so difficult to catch failure/success.
2020-05-26 22:42:06 +02:00
ejurgensen
9308f81224 [player] Get rid of listener notifications direct from outputs
Try to consolidate in player.c
2020-05-25 22:43:08 +02:00
ejurgensen
3b033e48ee [player] Consolidate listener handling in one player trigger - wip
The goal is to make the listener invokation more unified and less ad hoc. Also
reduce risk of blocking/deadlocking player thread.
2020-05-25 22:42:22 +02:00
ejurgensen
661289990c [player] Migrate a lot of speaker handling to outputs.c
Moves speaker selection, volume handling and startup to outputs.c, plus adds
the ability to "resurrect" a speaker that disconnects.

The purpose of moving the code is to concentrate device handling in one place.

Also changes how we deal with speaker selection. The player will now generally
not alter a user selection, even if the device fails. The purpose of this is to
maintain selection both if the device briefly fails, and if the user switches
off the device (we stop playback) and later turns it on + starts new playback.
2020-05-03 00:00:18 +02:00
ejurgensen
0c08e83811 [outputs] Fix segv due to incorrect array size (fix for issue #866)
If the number of quality subscriptions reaches max then this bug will be
triggered, because we will incorrectly use the last element of the
output_buffer for a subscription, thus losing the zero terminator.
2019-12-27 00:10:32 +01:00
ejurgensen
4ab734343c [-] Free events on exit (turns out event_base_free does not free them)
Credit @whatdoineed2do, ref. pr #797
2019-09-09 22:23:00 +02:00
ejurgensen
53780a7ef3 [xcode] Make sample rate + channels variable
This change is preparation to use ffmpeg's resampling capabilities to keep local
audio in sync (by up/downsampling slightly). This requires that sample rates are
not fixed for a transcode profile.

Added benefit of this is that we don't need quite as many xcode profiles.
2019-04-02 22:47:11 +02:00
ejurgensen
4fb45e84f2 [player/outputs] New metadata handling (wip) 2019-03-18 23:06:08 +01:00
ejurgensen
b8e0280567 [outputs] Add a 10 sec stop timer + drop playback_stop()
In the output implementations playback_stop() was somewhat redundant,
since device_stop() does the same.

The timer should make sure that we always close outputs (previously
they were in some cases kept open).

The commit also includes some renaming.
2019-03-18 23:06:08 +01:00
ejurgensen
e3d39cff9b [player] Fix incorrect setting of buffer size to outputs 2019-03-18 23:06:08 +01:00
ejurgensen
3e4766ffaa [outputs] Fix segfault if encode_reset() fails to setup an encode_ctx 2019-03-18 23:06:08 +01:00
ejurgensen
b811122566 [outputs] Rename output_buffer.frame to .data 2019-03-18 23:06:08 +01:00
ejurgensen
c74b305983 [outputs] Fix crash, invalid reference to device after outputs_device_add 2019-03-18 23:06:08 +01:00
ejurgensen
d008e241cf [outputs] Make outputs_device_flush (per device flushing)
Works better with the callback mechanism
2019-03-18 23:06:08 +01:00
ejurgensen
e97ad7d970 [outputs] Reinstate device->activated, so that mdns flukes can't bring down playback 2019-03-18 23:06:08 +01:00
ejurgensen
936103f462 [outputs] Move device_add/rm to outputs and get rid of advertised flag 2019-03-18 23:06:08 +01:00
ejurgensen
a7e8476996 [outputs] Refactor outputs some more, eg change callback system 2019-03-18 23:06:08 +01:00
ejurgensen
14a6d318f0 [outputs] Changes to interface of outputs module
* Drop output_sessions, was just a pointer to the actual session anyway
* Drop the old write, flush and stop prototypes
* Some minor changes/renaming

Purpose of this is also to fix a race condition in player.c where it
could try to start two sessions on the same speaker. This could happen
because outputs_device_start() in line 2093 is conditional on device->session
which however is false while a device is starting up.
2019-03-18 23:06:08 +01:00
ejurgensen
0cb3881621 [player/outputs/raop] Get rid of outputs_playback_start() (still WIP)
outputs_playback_start() had the problem that was not consistently invoked: If
for instance local audio playback was running and a Airplay device was then
activated, the raop's playback_start would never be invoked (and vice versa,
of course).

Instead, the player now writes the presentation timestamp every time to the
output, so it doesn't need to keep track of it from the start.
2019-03-18 23:06:08 +01:00
ejurgensen
cdd0aa884b [outputs] Add ability to deal with multiple qualities
Output module can now take input data in multiple quality levels, and
can resample to those output modules that would require a certain quality
level, like raop.c would
2019-03-18 23:06:08 +01:00
ejurgensen
b6e1269cf2 [raop/dacp/player] Support for Airplay speakers to register volume updates
Implements Active-Remote, which is sent to the speaker, so it can use this
to tell us who it is when it makes dacp request with a device-volume update.
2018-05-27 16:12:20 +02:00
ejurgensen
f63d103753 [raop] Add support for Apple TV device verification, required by tvOS 10.2 (fix for issue #377)
- also change how speakers are saved/retrieved from the db
- add generic authorization methods in outputs.c and player.c
- let filescanner read *.verification files (containing PIN)
- configure options to enable and disable, since libsodium is required
2017-06-19 21:52:01 +02:00
ejurgensen
171a75375b [outputs] Fix for (unlikely) situation where all outputs have no init() 2017-01-27 22:01:24 +01:00
Scott Shambarger
ce4ef0aa23 [config] Many updates to configuration and feature checks
- Added custom checks for libraries and pkgconfig modules that test library
 presence with additional checks for use of headers and functions with
 given options.  Also support correct additional feature library checks
 using provided flags.
- Added custom enable/disable feature macros to simplify their use.
- Use custom CFLAGS and LIBS variables for Makefiles to simplify maintenance.
- Update many feature checks from platform to function.
- Streamline many function checks.
- Correctly check gnutls, gcrypt and gpg-error libraries.
- Fix chromecast and spotify config and compile on FreeBSD
- Added inotify, signalfd and kqueue, and byte swap checks.
- Many clarifications of error messages.
- Correct json-c checks to properly use supplied CFLAGS.
- Correct many quoting inconsistencies
- Use __DATE__ in place of BUILDDATE
- Use full path for gperf and antlr3
- Remove unnecessary CFLAGS
- Added tests for pthread_setname_np parameters
- Added tests for clock_gettime and timer_settime
- Added tests for time.h
- Test if pthread, dl and rt libs are required/available.
- Updated checks for libunistring
2017-01-06 00:44:18 -08:00
chme
65732ccaf6 [outputs] New output type 'fifo' 2016-10-31 18:47:45 +01:00
ejurgensen
5b67f84855 [pulseaudio] First draft 2016-07-21 22:13:32 +02:00
ejurgensen
084a86597b [laudio] Remove OSS4 support and move dummy output to outputs interface 2016-04-14 09:48:48 +02:00
ejurgensen
acc1ff4a47 [player] Sort devices and autoselect based on priority 2016-04-14 09:48:47 +02:00
ejurgensen
c5bb83480d [alsa] Add rewritten ALSA to generic outputs interface 2016-04-14 09:48:47 +02:00
ejurgensen
36755031cb [outputs] Make a wrapper for mp3 streaming so it can be included in
the generic outputs interface and so special handling in player.c can
be removed
2016-04-14 09:48:47 +02:00
ejurgensen
7d6c670fee [chromecast] Fix host address, some more commands, add flush timer 2016-02-11 20:04:29 +01:00
ejurgensen
cd841ad7b5 [outputs] Reorganise new generic output interface 2016-02-11 20:04:29 +01:00
ejurgensen
ffe8653d9e [chromecast] Remove RAOP specifics from player.c, add generic output interface 2016-02-11 20:04:29 +01:00