Commit Graph

5746 Commits

Author SHA1 Message Date
Martin Pulec
be4f6434ec audio capture format: accept shortened options 2023-08-07 14:21:52 +02:00
Martin Pulec
bde2735dbb lavc: NVENC: default rc_buf_size_factor = 1.5
Since 2022-06-18 (commit cbc548d3), dynamic rate limiter allows
overshooting one frame by the factor of 50% so we can safely set the
default factor to 1.5 now.

see also GH-114
2023-08-07 11:47:32 +02:00
Martin Pulec
f590145ed3 ug_srand->ug_rand_init (improved seeding)
On POSIX systems, add also clock() to the seed + use as a source also
/dev/random if available.
2023-08-07 11:42:50 +02:00
Martin Pulec
a097fe7b09 DeckLink disp.: rename max_channels->max_aud_chans 2023-08-07 08:31:09 +02:00
Martin Pulec
aeb1be31a1 bmd_option: decrease log lvl on E_NOTIMPL
Decrease log level for implicit options returning E_NOTIMPL to info -
perhaps not important at all (like passthrough on old devices) and we
do not want to decrease user attention to warning.s
2023-08-02 15:41:09 +02:00
Martin Pulec
1c82ab9c63 DeckLink disp.: set actual output ch. count
Adjust desc with device actual reported maximal channel count, not
hard-coded maximum.
2023-08-02 15:26:28 +02:00
Martin Pulec
b007d29550 DeckLink cap.: allow 32/64 channs unconditionally
It doesn't seem to be restricted by API version, eg. on an Intensity Pro,
16 works for both SDK 11.6 and 12 (second advertises 32/64 channels in
SDK doc, first not), although it has only 2 channels (attrs mach/aach/iach).
32 channels is refused by both SDK versions, so doesn't necessarily need
to be related to version.

Since this setting is on the sender, we do not need  to check the validity
since if invalid, it would fail later, anyways.
2023-08-02 15:24:00 +02:00
Martin Pulec
2c21e4da6f DeckLink disp.: require deckLinkAttributes
ensure that the attributes are always present

+ print error if unable to query
2023-08-02 15:24:00 +02:00
Martin Pulec
fdd0d547af DeckLink (cap): simple interface for attr query
added `query=` parameter that prints device attribute (Flag or Int)
2023-08-02 15:23:56 +02:00
Martin Pulec
3639d00dbf replaced not thread-safe *rand48 functions
Use rand_s() in Windows and random() in POSIX systems.
2023-08-02 10:07:19 +02:00
Martin Pulec
f82091842b keyboard control: print elapsed time in info
+ use the thread-safe time-related functions variants
2023-08-01 16:19:46 +02:00
Martin Piatka
0d12a49531 aplay/pipewire: Old pw compat 2023-08-01 13:45:01 +02:00
Martin Piatka
682368113e acap/pipewire: Old pw compat 2023-08-01 13:45:01 +02:00
Martin Piatka
2d5967bc0b audio/pipewire_common: NODE_RATE compat for old PW 2023-08-01 13:45:00 +02:00
Martin Pulec
371e99de02 packet counter: modernize 2023-08-01 12:01:09 +02:00
Martin Pulec
f106180bbf packet counter: remoed unneeded packet store
Not needed to store separately "current" buffer packets since it is
already stored in cumulative, it is just needed to store the current
buffer number.
2023-08-01 12:01:09 +02:00
Martin Pulec
2e03e67ba3 packet counter: removed unused function
+ optimized includes + using
2023-08-01 12:01:09 +02:00
Martin Pulec
7f810b8ddd lavd audio: use packet API
use packet API for OPUS
2023-08-01 12:01:09 +02:00
Martin Pulec
29421cd1fe audio decompress: pass packet list (iterator) 2023-08-01 12:01:09 +02:00
Martin Pulec
8da83d3e92 audio TX: use the packet API
It needs to be enabled explicitly, anyways - at least Opus won't work
with former UG versions. For 40 ms frame, it produces 2 packets. When
merged into one packet, the decoder is unable to decompress.
2023-08-01 12:01:05 +02:00
Martin Pulec
bf35242e78 audio transmit: new sending API
Added API allowing sending multiple compressed packets (eg. by Opus)
with the same timestamp.
2023-08-01 10:26:15 +02:00
Martin Pulec
a81b19d231 format_audio_header: do not use audio_frame2
rewrite for further changes
2023-08-01 10:26:15 +02:00
Martin Pulec
6c07a3e43f audio_tx_send: send indiviual channel with a func
Send channels sequentially with a new function to simplify the code.

Also removed the the cumbersome multiplier packet interleaving - not
sure if it worked as expected (having sliding n-packet interleave window
for n-multiplied stream).

Now we simply send all packets of the frame as without multiplication
and then repeated with M-bit set to the latest packet. It is much easier
and it is  supposed to work approximately the same or even better.
2023-08-01 10:26:15 +02:00
Martin Pulec
452a59e317 audio_tx_send: removed rate-limiting
Currently not used and so it needlessly complicates the code. If later
needed, it can be re-added and possibly in a better way.
2023-08-01 10:26:15 +02:00
Martin Pulec
8da01fea88 DeckLink disp.: fixed scheduled mode
fixed commit 5f1ae260f (21st Jul 2023)
2023-08-01 10:26:14 +02:00
Martin Piatka
7230f51c49 aplay/pipewire: Add help 2023-07-28 12:33:20 +02:00
Martin Piatka
2889ca0db2 acap/pipewire: Add help 2023-07-28 12:33:20 +02:00
Martin Piatka
0bf75cd3b1 acap/pipewire: print format as str on_param_changed() 2023-07-28 12:33:19 +02:00
Martin Piatka
37b778278e acap/pipewire: Set frame format in on_param_changed callback
Since pipewire will convert the audio format to anything we ask it to,
this shouldn't have any effect. Maybe will help when implementing the
exclusive device mode in the future.
2023-07-28 12:33:19 +02:00
Martin Piatka
d8ac145898 acap/pipewire: Wait for stream to start on init 2023-07-28 12:33:19 +02:00
Martin Piatka
79c24477a5 acap/pipewire: Sleep a bit when no audio available 2023-07-28 12:33:19 +02:00
Martin Piatka
4c42eaa80e acap/pipewire: Configurable options 2023-07-28 12:33:18 +02:00
Martin Piatka
69bc251a27 acap/pipewire: Stream setup & reading buffers 2023-07-28 12:33:18 +02:00
Martin Piatka
b249b18c17 aplay/pipewire: reconfigure returns bool 2023-07-28 12:33:18 +02:00
Martin Piatka
f1c4daab4f aplay/pipewire: Log format on param change 2023-07-28 12:33:17 +02:00
Martin Piatka
6dceaa5996 aplay/pipwire: Wait for stream to start on reconf 2023-07-28 12:33:17 +02:00
Martin Piatka
86f69754fe aplay/pipewire: Warn when frame doesn't fit in ring 2023-07-28 12:33:17 +02:00
Martin Piatka
4357fb5c24 aplay/pipewire: Better logging 2023-07-28 12:33:16 +02:00
Martin Piatka
6794ef6fce aplay/pipewire: Configurable buffer length & quant 2023-07-28 12:33:16 +02:00
Martin Piatka
e064f0e40b audio/pipewire: Add bps to pw format helper 2023-07-28 12:33:16 +02:00
Martin Piatka
c28a770bfb audio/pipewire: Add common device listing 2023-07-28 12:33:15 +02:00
Martin Piatka
9d36316473 configure.ac: Add pipewire audio 2023-07-28 12:33:15 +02:00
Martin Piatka
c726394282 pw_capture: Initial 2023-07-28 12:33:15 +02:00
Martin Piatka
e9f0a0ec67 aplay/pipewire: Target node key compat
Stream target should be set using PW_KEY_TARGET_OBJECT to target node
serial or node name.

However, old pipewire versions (e.g. 0.3.48) seem to ignore this
property. So instead we use the PW_KEY_NODE_TARGET (which gets
deprecated in 0.3.64) with the target node name. This older property
however doesn't support serial numbers.
2023-07-28 12:33:15 +02:00
Martin Piatka
6ef50bd9fb aplay/pipewire: Set params buffers 2023-07-28 12:33:14 +02:00
Martin Piatka
e34a332886 audio/pipewire_common: Compat for old pw_deinit() behaviour 2023-07-28 12:33:14 +02:00
Martin Piatka
e3159f990d pipewire_common: Fix segfault on old pw versions 2023-07-28 12:33:14 +02:00
Martin Piatka
1457e07ab0 aplay/pipewire: Add device selection 2023-07-28 12:33:13 +02:00
Martin Piatka
1bde21ba38 Add initial pipewire audio output 2023-07-28 12:33:13 +02:00
Martin Piatka
f9d2156e23 ring_buffer: Fix warn about too big write when writing 0 bytes 2023-07-28 12:33:13 +02:00