Commit Graph

1028 Commits

Author SHA1 Message Date
Martin Pulec
c3ba23cf8f moved sdp_send_change_address_message to audio.cpp
In order to audio.cpp not being dependant on SDP.
2023-08-09 16:08:26 +02:00
Martin Pulec
97de457eaf audio cap.: limit user given values
Limit user-specified sampling rate and channel count to values defined
by pixel format.
2023-08-07 16:38:02 +02:00
Martin Pulec
d19531e2d2 audio testcard: prevent overflow on big numbers
Prevent integer overflow on big (perhaps wrong) values, eg. 2E9 channels:

`uv -s testcard -a ch=2000000000`

+ check memory data allocations with assert where there is no overflow
but out-of-memory (eg. `ch=1024:s=16777216:bps=16` requires 32 GiB RAM)
2023-08-07 16:38:02 +02:00
Martin Pulec
be4f6434ec audio capture format: accept shortened options 2023-08-07 14:21:52 +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
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
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 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
eb72130a0c ring_buffer: Move RAII wrapper to header 2023-07-28 12:33:12 +02:00
Martin Pulec
42fd73c685 modernized audio_frame2
mainly added nodiscard attribute to getters

+ fixed some clang-tidy complains (no dtor, overloaded op)
2023-07-27 13:55:00 +02:00
Martin Pulec
21f8b6bf3e audio_frame2: store params as audio_desc struct
this makes things a bit easier
2023-07-27 13:42:29 +02:00
Martin Pulec
a0dd6b9b85 deprecate Speex audio codec
Speex doesn't seem to offer any advantage over other codecs and is deprecated in
favor of Opus by Xiph.Org.

Added this feature in a generic fashion in order to allow eventual deprecation
of some other codecs that may not be useful but would complicate further
development.
2023-07-27 12:02:35 +02:00
Martin Pulec
75fef4bb89 acap testcard: refactored
moved parsing and signal generation to separate function

+ minor improvments:
1. checked return values from user-suplied numeric args
2. print correctly name of noise to status message
2023-07-27 10:47:05 +02:00
Martin Pulec
a4179f8a1d audio testcard: added noise pattern
it is useful to test audio compressions
2023-07-27 10:07:11 +02:00
Martin Pulec
bb53aae336 silence audio filter: fixed build
strdupa compat not included but not needed, VLA can be used
2023-07-26 17:26:07 +02:00
Martin Pulec
b634053b99 added silence audio filter 2023-07-26 12:33:09 +02:00
Martin Pulec
6780691b4e modernize playback APIs
modernized video display, audio playback and vo postprocess APIs

THe APIs were already recently updated so modernize it by using bool
where the return value is semantically boolean value. Using TRUE/FALSE is
inherently ambiguous because it is not obvious from the prototype if
success is 0 or TRUE (1).
2023-07-18 16:43:37 +02:00
Martin Pulec
1784f2cedd receiving: pass received frame TS for futher sync 2023-07-18 11:09:07 +02:00
Martin Pulec
17f50eede2 RTP: send synchronized A/V TS where possible
Send same RTP timestamps for audio/video frames captured at the same
time.

RTP specification allows this (although doesn't require - according to
the spec, the RTP timestamps should colaesce with RTCP NTP
correspondence). We slightly modify that in a way that we use for both
audio and video 90 kHz clock resolution, so if the start point is the
same (random), the RTP timestamps will be exactly the same for related
data.

Implemented for vidcap DeckLink and testcard.
2023-07-18 11:09:07 +02:00
Martin Pulec
6d372f47ca audio/codec.h: relicense
Relicensed and corrected copying audio/codec.h as an original author
(previous copyright and autors were just copied&pasted template from an
another file).
2023-06-29 16:30:30 +02:00
Martin Pulec
fc491d02ec removed play/pause stuff
this stuff is no longer used (has been used by CoUniverse)
2023-06-29 16:30:30 +02:00