Commit Graph

308 Commits

Author SHA1 Message Date
Martin Pulec
99588ababe remove module.deleter 2025-06-17 12:35:38 +02:00
Martin Pulec
497d6f5b17 fix other occurences of missing NL 2025-06-17 11:37:30 +02:00
Martin Pulec
227c6d1e01 acap,aplay/portaudio: print index hint just if numeric
If given by name, the info was that the invalid index was -2, which is
an internal value. The message that a device with given name could not
have been found is already printed.
2025-06-04 15:42:18 +02:00
Martin Pulec
90e1dce1f6 portaudio: selection by name - filter out unusable
do not return not usable deviecs - eg. "Microsoft Sound Mapper" doesn't
return "Microsoft Sound Mapper - Input" device if playback wanted but
"- Output" one.
2025-06-04 14:10:59 +02:00
Ben Roeder
a62fe80c3f Fix spelling errors throughout codebase
Corrected various spelling mistakes in comments, documentation, and
variable names across the project. Changes include:
- Documentation files (CONTRIBUTING.md, README.md, etc.)
- Source code comments in C/C++ files
- Function parameter names and descriptions

No functional changes were made.
2025-06-01 18:03:40 +01:00
Martin Pulec
af2981758b coreaudio: add alloc assertions 2025-05-07 10:13:06 +02:00
Martin Pulec
02841a2ba7 wasapi: show IDs only in fullhelp
the IDs shlighlyt mess up the output and may not be necessary needed to
use (name is also an option now if user wants stable identifier)
2025-04-17 15:50:35 +02:00
Martin Pulec
d33d923c98 aplay/wasapi: use get_name from acap
+ rename the fn
2025-04-17 15:50:35 +02:00
Martin Pulec
adf39939fe acap,aplay/wasapi: prefer dev name with d= 2025-04-17 15:50:35 +02:00
Martin Pulec
ce140867ed aplay/wasapi: move parsing to sep fn 2025-04-17 15:50:35 +02:00
Martin Pulec
fb3e152c2c aplay/wasapi: allow specification by name 2025-04-17 15:50:10 +02:00
Martin Piatka
7138a52881 aplay/pipewire: Set buffer frame count
This is optional and doesn't do anything by itself, but it's returned by
pipwire to the application in the pw_time struct as 'queued'.
2025-04-15 13:21:35 +02:00
Martin Piatka
b3b18f9175 aplay/pipewire: Prevent underruns by writing silence
This makes sure that pipewire always gets a steady stream of samples,
even when we're not receiving anything. This prevents the error count in
pw-top skyrocketing when the sender stops sending.
2025-04-15 13:21:29 +02:00
Martin Pulec
e8ae7ebfcd jack: query the devices after help
Evantual error messages from audio_jack_probe will be better aligned
after the available devices line.
2025-04-15 10:36:08 +02:00
Martin Pulec
b278ecefbf aplay/jack: print the help even if no ports found
Even if no devices were found, print the help and empty list of
devices. Without that, it would be missleading because the help shows
nothing.

Print the empty list ("Available deviviecs:" with nothing) also for
acap/jack to make clear that there are actually no devices.

improves 8597f39b
2025-04-15 10:27:20 +02:00
Martin Pulec
dc102f7b27 aplay/jack: print help early
to avoid a leak as pointed by CID 472111
2025-04-15 10:08:18 +02:00
Martin Pulec
291e8fbf67 aplay/jack: fix CID 472186
a leak on error - call rather the _done function than custom clean-up
2025-04-11 14:50:17 +02:00
Martin Piatka
d3258a1606 aplay/pipewire: Drop log priority of stream state change 2025-04-08 13:13:15 +02:00
Martin Piatka
feb0790977 aplay/pipewire: Report playback latency 2025-04-08 13:13:15 +02:00
Martin Pulec
4caf732be1 rtp.h: do not include config_*.h 2025-03-26 11:06:46 +01:00
Martin Pulec
31ea569352 aplay/coreaudio: remove unneeded config*.h 2025-03-25 12:36:36 +01:00
Martin Pulec
cfca08b895 audio/playback/*: IWYU 2025-03-25 11:24:10 +01:00
Martin Pulec
283439b9fe aplay/portaudio get_supported_format: sort srates
Sort sampling rates for poraudio playback that are tested if the device
doesn't support natively the received sample rate.

Use lowest higher or equal sampling rate if possible, if not, use the
highest usable sampling rate.

Also remove note in qsort_s.h (no longer valid - can be included where
approopriate, not only before first inclusion of stdlib.h).
2025-03-17 15:51:20 +01:00
Martin Pulec
33915a7eae aplay/portaudio: add dev default sample rate
This complements the previous commit - add the device default rate to
list of rates, that are tested if work (obviously this one should work
by definition so that now testing the remaining sample rates shouldn't
take place).
2025-03-17 15:51:20 +01:00
Martin Pulec
b2e70a619e poraudio: print supported APIs in fullhelp
useful mainly to check ASIO presence in Win
2025-03-07 11:11:01 +01:00
Martin Pulec
00fb576307 wasapi: fix setting dev by UUID
The mutibyte to wide character conversion was (perhaps since the
beginning) wrong - mbtowc converts just one character - it should have
beem mbstowcs but using rather mbsrttowcs (thread-safe).
2025-02-28 14:53:11 +01:00
Martin Pulec
16d41e8a5d aplay/mixer: restricting senders - check err
also workarounds for CIDs 47049{6,7}
2024-12-04 16:17:03 +01:00
Martin Pulec
0ac8c32716 aplay/mixer: allow selection of single participant
Allow selection of a single participant to be sent back with a control
socket (docuented in wiki).
2024-11-28 12:05:12 +01:00
Martin Pulec
9fd68d6447 aplay/mixer: factor out sockaddr_compare 2024-11-28 12:05:11 +01:00
Martin Pulec
82aed4b4ac aplay/mixer: sockadr cmp: check also IPv6 scope ID 2024-11-28 12:05:11 +01:00
Martin Pulec
950f3dc6a4 get_sockaddr_str: obtain IPv6 scope ID
write the IPv6 link-local address with scope ID

This is achieved by using getnameinfo instead of inet_ntop.

Also rewritten in respect to the above change - simplified, no need to
get the port number separately (getnameinfo does that as well).
2024-11-28 12:05:10 +01:00
Martin Pulec
0b27ea6e18 aplay/mixer: do not store particp sockaddr_storage
The participant sockaddr_storage doesn't need to be stored - actually the
participands are stored inside a map, whose key is the sockaddr_storage.

this modifies the commit 225fbc8ea (2024-11-13, and later fixes)
2024-11-28 12:05:10 +01:00
Martin Pulec
23197c9e78 aplay/mixer: pass audio_playback_opts to ctor
+ moved opt parsing to a separate function
2024-11-28 12:05:10 +01:00
Martin Pulec
9ff045c00b aplay API: paas init parameters in a structure
+ add also parent module pointer
2024-11-28 12:05:10 +01:00
Martin Pulec
abd758241a debug: move some stuff to utils/debug
The rationale is to separate the config.h-dependent stuff to a separate
file to eliminate the need to transitively include config.h.

+ fix the files that need config.h directly to include it
2024-11-28 11:46:09 +01:00
Martin Pulec
8d91757f7d fix CID 470420 2024-11-26 08:29:30 +01:00
Martin Pulec
9cd1af1a03 aplay/alsa: remove 2 messages
- do not inform about new API - it has been there a long time and obviously
the "new" API works fine
- do not warn that cannot get the latency - the procfs file is no longer
available so it is issued all the time. It works with the default value
24 ms just fine.
- regading the above, do not obtain the value at all - since it now works
fine, we do not need to depend on an external value that may potentially
break the stuff (it would be required to re-test if needed)
2024-11-25 15:09:08 +01:00
Martin Pulec
73718becae aplay/jack: avoid using alloca/strdup
+ small related improvements
2024-11-22 10:15:54 +01:00
Martin Pulec
d4e216e21c aplay/mixer: participant add/rm print fixes
- do not print it in constructor/dtor - the participant may be moved
- copy the stored address in copy constructor
- use get_sockaddr_str + change its prototype - do not use thread_local
vars but user provided buffer
- also take (const sockaddr *) in the get_sockaddr_str and
get_sockaddr_addr_* functions (participants iterated by const iterator
returning const participant reference)
2024-11-13 17:00:10 +01:00
Martin Pulec
a68f76ca9c aplay/mixer fix
fixed HEAD^^
2024-11-13 16:20:39 +01:00
Martin Pulec
225fbc8ea1 aplay/mixer: print participant add/rm 2024-11-13 14:52:28 +01:00
Martin Pulec
110e656b46 aplay/mixer: fixed including 2024-11-13 14:46:59 +01:00
Martin Pulec
be7dcb67c7 aplay/alsa: print req val if buff fails to set 2024-09-10 08:59:24 +02:00
Martin Pulec
52ed2fdd22 tv.h: replace time conv macros (+ in alsa)
Replace time conversion macros defined 2 commits ago between msec
and usec.

This is proposed (considered) solution to the todo in tv.h - inconsistent
unit conversion macros. Rather than value, it might be better to use
function-like macros.

The issues is that there will be actaully double the amount - A_TO_B and
B_TO_A. To keep it in a reasonable range, it would be best to remove
the _DBL versions and keep the user typing the arg to double inestead
2024-09-10 08:58:27 +02:00
Martin Pulec
f3462fc599 aplay/alsa: control debug print delay by log_level
use run-time log_level rather then macro DEBUG
2024-09-06 11:19:25 +02:00
Martin Pulec
fb15ce9218 aplay/alsa: moved buffer setting to a separate fn
refactor only

changed:
- use symbolic constannts MS_IN_US[_DBL]
- use MSG() instead of log_msg()
- add _MS suffix to macros for default buf sizes
- fixed including
2024-09-06 10:54:31 +02:00
Martin Pulec
e3556c66a7 aplay/alsa: warn if buffer is too short 2024-09-05 14:47:24 +02:00
Martin Pulec
50812bba34 replacing PACKAGE_BUGREPORT with bug_msg
Where the PACKAGE_BUGREPORT is the only used item from config.h,
use bug_msg(), which can be then removed.

Improved bug_msg() to allow printf-like fomat + arguments.
2024-08-14 15:26:12 +02:00
Martin Pulec
f819deec7c wasapi: improved including 2024-07-30 10:38:15 +02:00
Martin Pulec
61bbc65806 wasapi: suppress warnings
Suppress warnings for missing braces:

    src/audio/capture/wasapi.cpp:61:41: warning: suggest braces around initialization of subobject [-Wmissing-braces]
       61 | const GUID KSDATAFORMAT_SUBTYPE_PCM = { STATIC_KSDATAFORMAT_SUBTYPE_PCM };

The macro is actually defined with Mingw-w64.
2024-07-29 11:48:34 +02:00