Commit Graph

150 Commits

Author SHA1 Message Date
Martin Pulec
68eeafca5e Revert "audio transmit: new sending API"
This reverts commit bf35242e78.
2023-10-16 16:19:56 +02:00
Martin Pulec
cdef66a141 Revert "audio TX: use the packet API"
This reverts commit 8da83d3e92.
2023-10-16 16:19:56 +02:00
Martin Pulec
7fc14c3d51 control: added commands to (un)mute audio
In addition to already existing "mute", that toggled mutte for the
receiver, [un]mute-{sender,receiver} was added, which mutes or unmutes
the sender or receiver.
2023-09-27 09:24:47 +02:00
Martin Pulec
e4bcac7f84 audio msg processing: simplified
refactor only - removed unneeded branching (early return)
2023-09-27 09:24:43 +02:00
Martin Pulec
8a50ff4d2e audio messages: rename MUTE->MUTE_TOGGLE
* the MUTE commands are actually mute-toggle
2023-09-25 16:29:03 +02:00
Martin Pulec
356be2d0e5 audio: small improvements 2023-09-08 15:25:25 +02:00
Martin Pulec
c28a0d2710 audio: mixer segfault fix
Broken since 2021-05-25 (commit 1d47a5f0), which put the initialization
of rtp socket after passing to the mixer.
2023-09-08 08:45:32 +02:00
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
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
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
fc491d02ec removed play/pause stuff
this stuff is no longer used (has been used by CoUniverse)
2023-06-29 16:30:30 +02:00
Martin Pulec
61f0f03be0 audio.cpp: remove unused rang references 2023-06-13 16:35:49 +02:00
Martin Pulec
1ceced7ded UG RTP audio: use longer timeouts when idle
Similarly to previous commit (and the original, 8977fd42), use longer
timeouts when not receiving any audio to preserve CPU cycles.
2023-05-18 16:46:49 +02:00
Martin Pulec
98ff26a5c9 SDP autorun: support for audio 2023-04-27 15:28:36 +02:00
Martin Pulec
4604257fcc SDP: accept options even when no video 2023-04-27 15:28:31 +02:00
Martin Pulec
d330520d59 SDP: refactor - use global state
Until now, `uv -s testcard --protocol sdp` didn't generate the SDP file
(nor output) because the all SDP state initialization was handled in
video_rxtx/h264_sdp.
2023-04-27 15:21:16 +02:00
Martin Pulec
16c931bf63 audio: register should exit callback
this fixes commit 2074a125 from 2023-03-23

The problem was that whenever neither display nor vidcap was started,
UltraGrid immediately exited. Steps to reproduce fixed behavior:

    uv -s testcard          # or
    uv -r dummy             # or both:
    uv -s testcard -r dummy

finish immediately
2023-04-24 15:45:00 +02:00
Martin Pulec
2074a1257e audio: do not read global should_exit 2023-03-24 14:06:47 +01:00
Martin Piatka
0f1dce2b7b audio: Allow filter to completely discard frame 2022-11-29 12:53:25 +01:00
Martin Piatka
7cb9771962 Move tokenize and sv_parse_num into string_view_utils 2022-11-10 12:04:41 +01:00
Martin Pulec
7b94be5a84 audio volume: print channel indices
When there are more channels, it may get harder to find bearings.
2022-11-08 16:49:36 +01:00
Martin Pulec
066dec5287 audio: small refactor
moved the code to audio_decoder_state_create()
2022-10-26 11:10:01 +02:00
Martin Pulec
cdf96b75fc handle audio resampler init exception gracefully
Catch the exception. Can occur mainly if wrong '--param resampler='
option is given.
2022-10-26 10:07:14 +02:00
Martin Pulec
a5c059da60 moved audio resampler to separate file 2022-10-25 15:51:03 +02:00
Martin Pulec
cd60f1828c audio: improved init prototype
- return int to signalize if error or help was displayed
- rename audio_cfg_init to audio_init
2022-10-11 15:04:45 +02:00
Martin Pulec
6ff02e7e2e added audio_cap_jack_should_exit
Added audio_cap_jack_should_exit in order to prevent freeze if waiting
on semaphore but jack callbacks are not triggered (no data).
2022-10-03 16:41:16 +02:00
Martin Pulec
52af6884c6 acap: do not print error twice
+ simplify in audio.cpp
+ make consistent also for aplay (printed in the audio_playback.c, not
  audio.cpp)
2022-09-12 16:44:06 +02:00
Martin Pulec
65557d112d get rid of rang.hpp dependency through color_out.h
Removed indirect dependency on rang.hpp through color_out.h. Now only
remaining dependencies on rang.hpp are direct.

+ fixed escape sequence for foreground magenta
2022-08-17 17:24:34 +02:00
Martin Pulec
0b8cc39f9c removed perf tool
It was almost never used since added.
2022-08-17 17:24:34 +02:00
Martin Pulec
6729a8a1ad audio: use const audio_frame 2022-05-25 17:09:42 +02:00
Martin Pulec
83ccb7e755 audio: use time_ns_t for stats
+ fix CID 263928
2022-04-21 08:32:32 +02:00
Martin Piatka
c506112d89 audio/filter: Adding filters via control port 2022-03-21 15:19:42 +01:00
Martin Piatka
79437689ff audio/filter: Add support for control port 2022-03-21 14:25:41 +01:00
Martin Piatka
a05362e760 audio: Use module_raii wrapper 2022-03-21 13:02:52 +01:00
Martin Piatka
e81af5423f Add audio capture filter infrastructure 2022-03-18 14:15:30 +01:00
Martin Pulec
d1f3206077 RTP: work also with time in NS 2022-03-18 08:52:32 +01:00
Martin Pulec
b5f1fd3735 Replaced chrono clocks with integer nanoseconds
Ref 84861d6

It was perhaps rather a workaround for low-resolution Windows timeval
compat. On the other hand it enforced C++ API and makes things a bit
complicated. It had also broken some invariants, namely that the timeval
values had been wallclock time.
2022-03-18 08:52:29 +01:00
Martin Pulec
31c750e4a1 audio volume report: use RMS/peak format
Seems to be more readable than the previous format.
2022-03-11 10:48:47 +01:00
Martin Pulec
eadaee0de1 audio capture/playback: do not pass NULL as cfg
This makes it more consistent with other modules and also it simplifies
the modules that do not need to check/handle NULLs by themselves.
2022-03-03 16:20:54 +01:00
Martin Pulec
a486f7848b audio volume report: use onle line for all channels
Output only onle line of volume for all channels.

This prevents flooding the output with plently of status lines when
multiple channels (like 16) are used.
2022-03-03 16:20:53 +01:00
Martin Piatka
96033da66f main: Add echo canceller to help 2022-01-10 15:46:29 +01:00
Martin Piatka
e9b2873af8 audio.cpp: reorder echo canceller calls 2022-01-10 12:28:17 +01:00
Martin Piatka
f3c5923aab echo cancellation rewrite 2022-01-10 12:28:16 +01:00
Martin Pulec
e712578f43 Added audio RS encoding 2021-11-30 17:09:29 +01:00
Martin Pulec
2a43758fd6 Audio: init encoder only if needed
+ rename audio_coder to audio_encoder to make sure that it is used for
  sender only
2021-11-25 15:49:04 +01:00
Martin Pulec
1b3b27eb7c Updated copyright dates for modified files 2021-11-08 15:43:14 +01:00
Martin Pulec
2ec8eec912 Audio: display muted status even if not sending
Originally mute for both sender and receiver were dispatched by the
sender, which doesn't need to be present, however.
2021-10-27 13:31:17 +02:00
Martin Pulec
80924bfd1b Audio: indicate muted sender in periodic stats 2021-10-04 14:07:20 +02:00
Martin Pulec
34f0445af8 Audio: print explicitly muted receiver 2021-10-04 14:06:07 +02:00