Commit graph

1159 commits

Author SHA1 Message Date
Wim Taymans
6e9d3bdb36 tests: add small dict benchmark 2020-01-14 13:52:08 +01:00
George Kiagiadakis
0c63d045ee alsa-pcm: call reuse_buffers when resetting the state of the buffers
This allows the upstream node to put buffers back to its pool in case
they were left around in the ready list locally when the alsa-pcm-sink
was last paused.

Fixes #203
2020-01-14 11:28:04 +00:00
Wim Taymans
9db240e786 bluez: implement profile on device
Enumerate the available profiles on the device. Make params
visible.

Implement set_profile, only expose the nodes that belong to the
profile.
2020-01-10 13:25:40 +01:00
Wim Taymans
5f70a2713e a2dp: fix audio
Don't just remove the buffer from the queue when it was only
partially written. To do this, return the error code from add_buffer
and only remove the buffer when there is a real error.
2020-01-10 09:55:02 +01:00
Wim Taymans
f026e95585 audioconvert: use position rate as default rate 2020-01-09 16:50:02 +01:00
Wim Taymans
c14881fbe2 Respect the rate from the position as the default 2020-01-09 16:43:08 +01:00
Wim Taymans
852ac043d3 Use the DSP format for dsp formats
Use the DSP media subtype to describe DSP formats. DSP formats
don't include the rate, channels and channel position in the
format and must use the rate and duration from the position io. This
makes it possible to later change the samplerate dynamically without
having to renegotiate the graph.

The same goes for the video DSP format, which uses the io_video_size
from the io_position to get the size/stride. Set this up in the node
based on the defaults from the context.

Make it possible to define defaults in the daemon config file, such
as samplerate, quantum, video size and framerate. This is stored in
the context and used for the DSP formats.
2020-01-09 15:18:59 +01:00
Wim Taymans
5a6da7d5e1 video: add and parse modifier as well 2020-01-09 13:36:52 +01:00
Wim Taymans
9ffa9c0b08 v4l2: handle suspend 2020-01-08 13:23:35 +01:00
Wim Taymans
8f3b2b9543 bluez5: implement sync, profile and enum_profile 2020-01-03 13:01:54 +01:00
Michael Tretter
8e6a5a1714 v4l2: print pixelformat as string
The pixelformats are actual 4 letter sequences. Print the letters
instead of the hex value to make the output more readable.
2019-12-19 15:43:13 +01:00
Michael Tretter
94ffe88b65 filter: return error if id cannot be dereferenced
If an ID cannot be de-referenced, e.g., because the builder buffer is
too small, spa_pod_filter() still reports success, but the result is
NULL. Any subsequent access to result will cause a segfault.

Return an error if no pod is found to properly propagate and handle the
error.

The segfault can be reproduced by using the v4l2 module with Vivid
devices [0], because the buffer for the v4l2 controls is too small.

[0] https://github.com/PipeWire/pipewire/issues/138
2019-12-19 15:43:04 +01:00
Wim Taymans
f391353c7f Make interface types a string
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
2019-12-19 13:36:04 +01:00
Wim Taymans
9657486a81 alsa-seq: update duration when slaved as well 2019-12-18 13:27:29 +01:00
Wim Taymans
24ab22db12 audioadapter: avoid infinite loop
Rewrite the slave/converter loop a little to avoid infinite loops.
2019-12-18 12:58:42 +01:00
Wim Taymans
d67d012362 audioadapter: loop until we have data
Keep caling the slave processing function until we have data from
the converter or until no process can be made.
2019-12-17 15:11:31 +01:00
Wim Taymans
58a7e18ed5 audioadapter: set data flags 2019-12-17 15:08:39 +01:00
Wim Taymans
b681286362 pod: Use private names for variable in macros
Fixes #197
2019-12-13 13:13:22 +01:00
Wim Taymans
49a4440692 audioadapter: pass slave properties directly 2019-12-10 12:48:18 +01:00
Wim Taymans
181c2de2ee parser: only recurse into CHOICE when 1 value
Only try to collect the CHOICE value when there is only 1 value.
This makes it possible to parse the complete choice as a SPA_Pod.
2019-12-09 12:23:24 +01:00
Wim Taymans
c5ee45044d fix unit test 2019-11-29 13:34:07 +01:00
Wim Taymans
3f3dfbc67e More session manager work
pulseaudio card is mapped to device
pulseaudio sink/source is mapped to an endpoint
prepare to map streams to card profiles
Add Route param to implement the endpoint routing later (ports)
Create an alsa endpoint for each device
Create one stream for each endpoint (Playback/Capture)

Implement create_link on the endpoint. The idea is to call
create link on the peer endpoint to complete the link. Remove
create_link on the session.

Add stream-monitor to turn pw_stream nodes into endpoints

Add a policy manager that tries to link endpoints

Use enum pw_direction for the endpoint direction. We can use the
media_class to determine if this is a pw_stream or not but it should
not really matter, you can link any output to any input.

Add autoconnect property for endpoints to make the policy connect.
2019-11-29 13:34:07 +01:00
Wim Taymans
3131acea46 alsa-seq: close seq device
When we unload, close the seq device again so that the source is
removed from the main loop.
2019-11-28 11:21:41 +01:00
Gleb Popov
b73976ff10 logger: use CLOCK_MONOTONIC on freebsd 2019-11-21 17:55:59 +01:00
Wim Taymans
bca114f8c5 system: include time.h for the itimerspec struct 2019-11-21 17:52:58 +01:00
Wim Taymans
bca653198a audioadapter: emit param events only once
The events from the convert are already proxied to the audioadapter
so don't emit the event twice.
2019-11-21 13:07:16 +01:00
Wim Taymans
e9eabead4b add keys.h header 2019-11-21 13:04:58 +01:00
Wim Taymans
feb8dd3a34 Add include of keys.h 2019-11-21 09:34:08 +01:00
Wim Taymans
aa4dc73b21 node: move keys to separate file 2019-11-21 09:33:50 +01:00
Wim Taymans
18974f90f6 pod: rename context to flags in spa_pod_prop
Flags are more useful when we can use them to describe how to
filter properties later.
2019-11-21 09:32:08 +01:00
Wim Taymans
e620412034 param: add more fields to Profile param
Add description and priority to profile
2019-11-21 09:31:53 +01:00
Wim Taymans
f92775719a log: make timestamps configurable 2019-11-19 15:38:09 +01:00
George Kiagiadakis
53f93c2bde logger: print timestamps on logged messages
Timestamps have usec precision and the seconds are limited
to 9 digits. Usually what matters in these messages is to spot
delays between printouts and not really what is the absolute
time of the system.
2019-11-19 14:23:49 +00:00
Wim Taymans
ac24743b2e the epoll shim should only be used by the system library.
All other places should use the system library to get the right
fds.
2019-11-19 15:16:18 +01:00
Gleb Popov
9ab4e39704 Add a stub implementation for sched_getcpu, as this function isn't present on
FreeBSD.
2019-11-19 13:41:40 +01:00
Gleb Popov
da7eefd60e Implement get_count() from cpu.c for FreeBSD. 2019-11-19 13:41:40 +01:00
Gleb Popov
aec64336fe Do not try to include endian.h on FreeBSD. 2019-11-19 13:41:40 +01:00
Gleb Popov
fd937fa378 On FreeBSD, add dependency on epoll-shim library.
FreeBSD doesn't provide timerfd and eventfd functions. These are implemented in
3rd party library called epoll-shim. Link targets requiring these functions to
this library.
2019-11-19 13:41:40 +01:00
Wim Taymans
68e94a2e7e system: use spa_system functions for fds 2019-11-19 13:41:40 +01:00
Wim Taymans
6397db9d68 protocol: init spa_dict properly
Or else the flags might be wrong.
2019-11-04 17:30:33 +01:00
Wim Taymans
29254b688a pulse: fix list_prev 2019-11-04 17:30:33 +01:00
Wim Taymans
6b565d2eab format: add video modifier 2019-11-03 16:39:56 +01:00
Wim Taymans
c67445c343 test: audioadapter 2019-11-03 10:39:48 +01:00
Wim Taymans
d1e331e268 pod: add POD_None 2019-11-03 10:13:30 +01:00
Wim Taymans
a18c8df7d0 meta: make sequence number 64 bits
Add offset in current cycle
2019-10-29 22:44:45 +01:00
Julian Bouzas
9b2d34c04b audioadapter: store format on set_param and use it as a filter when negotiating 2019-10-29 22:44:24 +01:00
Wim Taymans
d94019ccd2 io: Add current video frame size to position
Add some padding, tweak some padding
Remove count in the clock, it's useless
For video frames we will want to use metadata to place
this on individual buffers.
2019-10-29 14:08:40 +01:00
Wim Taymans
f7d32e78f2 pod: remove SPA_POD_IS_OBJECT_TYPE
We have a safer version of that in iter.h
Use macros to get id and type of an object
Use safer checks in plugins.
2019-10-29 10:08:46 +01:00
Wim Taymans
241a6165d2 jack: also add rate to format 2019-10-28 22:02:10 +01:00
Wim Taymans
4f5a5fc917 vulkan: tag port as video DSP port 2019-10-28 13:20:42 +01:00