Commit graph

276 commits

Author SHA1 Message Date
Wim Taymans
3dc6820e9e Don't use __ in defines or declarations, it's reserved
SPA_TYPE -> SPA_TYPE_INFO for type info strings
improve includes

Fixes #115
2019-01-14 13:00:00 +01:00
Wim Taymans
b0f4be5fbc fix more compile errors
Avoid void * arithmetic
Do explicit casts to target type to make c++ happy
2019-01-08 11:53:36 +01:00
Wim Taymans
5b7ddb0105 buffer: remove buffer id
The buffer id is not needed/used, we use the index of the buffer in the
buffer array when configuring the port.
2019-01-07 17:57:03 +01:00
Wim Taymans
e918f9f77c fix sign confusion 2019-01-07 15:52:42 +01:00
Wim Taymans
d2bcbdf9cf resample: fix unrolled counter 2018-12-20 12:01:45 +01:00
Wim Taymans
2fd8f0906f alsa: set stride to frame size 2018-12-12 15:13:36 +01:00
Wim Taymans
bf1c927087 alsa: reset queued and free buffers on start
When we are out of buffers, drop the available samples.
2018-12-05 11:23:30 +01:00
Wim Taymans
4e7af5644b alsa: set period size to something larger
Setting a small period size will also result in a small buffer, on some
cards smaller than what we can deal with right now.
2018-12-03 15:56:53 +01:00
Wim Taymans
d6836d89ee alsa: stop try writing samples when no progress 2018-11-30 17:52:48 +01:00
Wim Taymans
c5f5f1d94b alsa-device: remember current profile 2018-11-30 17:52:23 +01:00
Wim Taymans
bf344a86e5 alsa: add on and off profiles 2018-11-29 15:24:13 +01:00
Wim Taymans
354bb042e2 alsa: retry _avail after xrun
..or else we pretend all is fine and end up with no available samples
to read in an infinite loop.
2018-11-29 15:19:33 +01:00
Wim Taymans
7c54b4b89c audio-dsp: improve properties 2018-11-28 13:24:33 +01:00
Wim Taymans
0c9dc75cb3 alsa: cleanup 2018-11-28 12:27:17 +01:00
Wim Taymans
59d77818d6 device: improve properties and info 2018-11-28 12:21:58 +01:00
Wim Taymans
72dee1686d alsa: clean up device info 2018-11-28 11:14:28 +01:00
Wim Taymans
7bc9c1ebfe node: remove info from node interface
Replace with info event emited when callbacks are set. This makes it
easier to implement dynamic changes.
2018-11-26 12:41:40 +01:00
Wim Taymans
57e94f7bc4 monitor: remove enum_items
Make the monitor and device emit the info and items when the callbacks
are set. This makes it easier to implement the monitor because there
is much less state to keep around and invalidate etc.
Rework the monitors
Add bluez5 device
2018-11-26 12:18:53 +01:00
Wim Taymans
36cbb947f1 alsa: add media.class to device 2018-11-23 19:28:47 +01:00
Wim Taymans
3ae39180ca improve monitors 2018-11-23 19:14:47 +01:00
Wim Taymans
e23c209a5f alsa: implement monitor and device 2018-11-23 17:41:39 +01:00
Wim Taymans
e1bd12e599 device: add device object
Make a device object, let the v4l2 monitor create device objects
The device object is responsible for dynamically creating nodes.
2018-11-23 12:43:47 +01:00
Wim Taymans
b27206c24a alsa: debug->trace 2018-11-20 16:13:56 +01:00
Wim Taymans
d70b4b2b10 alsa: more tweaks
Set the lowest possible period time, this lowers the latency.
Adjust slaved stream when we are drifting too much.
Use faster snd_pcm_avail and only use get_status when in error.
2018-11-20 16:08:57 +01:00
Wim Taymans
afd9a6c95f alsa: fix capture again 2018-11-19 18:03:45 +01:00
Wim Taymans
7e9b223216 alsa: reduce start latency 2018-11-19 12:01:36 +01:00
Wim Taymans
27451e4350 alsa: tweak dll some more after xrun 2018-11-19 11:51:51 +01:00
Wim Taymans
0343297257 alsa: rework timing
Use a DLL to track the hardware pointer and use this to set the
timer.
Handle XRUN and recover.
2018-11-16 17:00:40 +01:00
Wim Taymans
d8db090ac2 alsa: only remove sources when they were added 2018-11-12 15:52:11 +01:00
Wim Taymans
416b9c254e alsa: have slaved sink
When we are slaved, calculate our rate difference with the master
2018-11-12 10:18:21 +01:00
Wim Taymans
6f555c63e2 alsa: set buffer_id in io to INVALID when in use 2018-11-12 09:56:45 +01:00
Wim Taymans
0f7a3bdb2a alsa: use dynamic bandwidth 2018-11-12 09:55:21 +01:00
Wim Taymans
e69cf24f24 alsa: add dll to estimate clock drift
Make delay signed in the clock io so that we can simply add it to the
tick to get the hw position.
Add clock drift to clock info
2018-11-09 15:26:08 +01:00
Wim Taymans
088ee9f09e Improve TIMESPEC_TO_TIME
Add explicit TO_NSEC and TO_USEC versions to make it clearer and to
allow for some optimizations.
2018-11-07 09:56:24 +01:00
Wim Taymans
85f2e93c54 Relicense as MIT/X11
Remove some obsolete files
2018-11-05 17:48:52 +01:00
Wim Taymans
6bb90ed88e alsa: refactor get_status 2018-10-31 15:21:23 +00:00
Wim Taymans
2206deb3e8 alsa: implement set_io and handle position io
Use position io for deciding the size of the output buffers in
alsasrc
2018-10-24 10:27:57 +02:00
Wim Taymans
66de372e9a add node set_io function
Also allow setting io areas on nodes. We need this to set the
graph clock and period size on the nodes.
2018-10-23 12:31:41 +02:00
Wim Taymans
6590d3a258 alsa: sanitize channel map
Remove unknown channels
Remove duplicate channels
Fill unknown channels with default channels
2018-10-17 12:44:05 +02:00
Wim Taymans
6c7d2d0e1e alsa-utils: enumerate channels using channel map
When there is a channelmap, return format descriptions for each layout
otherwise return a range.
2018-10-16 18:10:43 +02:00
Wim Taymans
0f69a7b767 node: remove and add node from graph in idle/running
Add the node and all links to the graph when going to running and
remove them again when idle.
2018-10-02 05:10:55 +02:00
Wim Taymans
ec1d7b8df7 alsa: deal with less frequent hw pointer updates 2018-09-24 13:37:10 +02:00
Wim Taymans
0aca605bfb alsa: init variable correctly
We need to initialize the frames variable correctly before calling mmap.
Also initialize the now timer when starting.
2018-09-24 10:36:53 +02:00
Wim Taymans
1ebb3850e9 alsa: remove useless debug 2018-09-20 10:11:22 +02:00
Wim Taymans
ca2d35ca30 alsa: fix monitor strings 2018-09-17 17:15:05 +02:00
Wim Taymans
5196f7f053 audio: remove layout from audio
Make special format types for planar and interleaved instead of
having a field.
Add enum for audio channel positions
Add some default audio channel layouts
Place the channel layout in the audio format when possible
alsa: place audio channel positions in format
Add sse optimized channel mixing for some common cases
Remove name from port info, it's not mandatory and in the properties
Add direction to port info
2018-09-13 17:03:56 +02:00
Wim Taymans
fb3379e587 Pass channelmask around and use it to name ports
Use the channel name in the port names of the dsp
2018-09-11 18:09:45 +02:00
Wim Taymans
cc842cbdc8 Type changes
Only allow properties inside objects, this makes it easier to
iterate the object, which is needed for efficiently processing
control streams.
Add a choice type to mark variable properties.
SPA_TYPE_Enum -> SPA_TYPE_Id to avoid confusion with choice enum
Make it easier to allocate and initialize properties on the stack
Make more efficient methods to make objects.
2018-09-05 16:41:07 +02:00
Wim Taymans
2631db14a8 pod: use {} as object delimited, like json
Use <> for sequence
2018-08-30 09:53:29 +02:00
Wim Taymans
ff6a244d8f Make media type and subtype properties
This is easier to debug and we only want properties in objects
in the future.
2018-08-29 18:08:52 +02:00