Commit Graph

55 Commits

Author SHA1 Message Date
hathach 06392247eb add TU_ATTR_FAST_FUNC for audio sof isr call chain 2022-06-07 11:50:50 +07:00
hathach f2926670cc comment out fifo count method for now 2022-05-31 20:26:37 +07:00
hathach dce2ad4ffb
adding feedback fifo count (WIP) 2022-05-27 23:11:25 +07:00
hathach 15aa593790
wrap feedback and compute to its own struct/union 2022-05-27 12:27:31 +07:00
hathach e5113a1cfc prototype for feedback method 2022-05-19 16:05:55 +07:00
hathach 5766c9ac4e rename tud_audio_sof_isr() to tud_audio_feedback_interval_isr()
- also add interval_log2 to isr callback
- also rename other variables
2022-05-19 13:44:10 +07:00
hathach 20b810d25b
fix ci build 2022-05-13 23:01:06 +07:00
hathach c5ba1ea8c1
changes proposal to audio feedback computation 2022-05-13 22:54:47 +07:00
Reinhard Panhuber 7094ff7125 Introduce 3 fb calc options: NO_SOF_BY_USER, SOF_BY_AUDIO_D, SOF_BY_USER 2022-04-09 16:36:26 +02:00
Reinhard Panhuber 5cd67baf15 Disable SOF ISR feedback calcuation by default s.t. examples still work 2022-03-20 12:57:53 +01:00
Reinhard Panhuber ff2dc0a547 Streamline feedback calc, find fb interval from descriptors, inc. checks 2022-03-20 11:21:33 +01:00
Reinhard Panhuber fdfde8883f Implement power of two, shift, and float calculation 2022-03-19 13:37:54 +01:00
Reinhard Panhuber ceac9d64c0 Disable CFG_TUD_AUDIO_ENABLE_FEEDBACK_DETERMINATION_WITHIN_SOF_ISR
By default disable
CFG_TUD_AUDIO_ENABLE_FEEDBACK_DETERMINATION_WITHIN_SOF_ISR such that
current examples still work.
2022-03-16 08:05:31 +01:00
Reinhard Panhuber f212899b54 Add SOF callback function for feedback value determination in uac - wip! 2022-03-14 20:40:33 +01:00
Valentin Milea a284e438f1 Disable feedback format correction by default #1234 2022-01-07 15:02:52 +02:00
Valentin Milea ef879e8a8a Support disabling feedback format correction #1234 2021-12-06 18:49:58 +02:00
hathach 9736e54734
include clean up 2021-05-27 17:40:39 +07:00
hathach c9177246d2 temporarily fix include recusrive loop 2021-04-28 12:31:24 +07:00
Reinhard Panhuber 4dd1f1f3b5 Fix include path in audio_device.h 2021-04-23 10:32:22 +02:00
Reinhard Panhuber 03f974c9b9 Implement functions to allow for DMA usage in audio driver.
- Add tud_audio_n_get_ep_out_ff(), tud_audio_n_get_ep_in_ff(),
tud_audio_n_get_rx_support_ff(), and tud_audio_n_get_tx_support_ff()
- Change get_linear_read/write_info() to return linear and wrapped part
at once
- Adjusted affected code in audio_device.c and tested with
audio_4_channel.
2021-04-23 10:27:48 +02:00
Reinhard Panhuber 29bcc83d0f Remove unnecessary volatile and short audio function index to func_id 2021-04-21 17:01:38 +02:00
Reinhard Panhuber c7c11b181c Clean up old depracted and misleading variable names 2021-04-20 20:15:02 +02:00
Reinhard Panhuber 8eacdffebd Optimize encode/decode - refactor unnecessary repetitive division 2021-04-07 20:07:28 +02:00
hathach 58bab86d79 minor clean up 2021-04-06 21:09:23 +07:00
Reinhard Panhuber ec6b240de2 Fix #define error in audio_device.h 2021-04-03 15:44:44 +02:00
Reinhard Panhuber 6236effb14 Fix #define error in audio_device.h 2021-04-03 15:29:39 +02:00
Reinhard Panhuber 8b90c08b35 Fix #define errors in audio_device.h 2021-04-03 15:24:38 +02:00
Reinhard Panhuber 9b2ddd9cc6 Generalize audio driver for 3 audio functions plus a lot more.
- Audio format and parameters are parsed from descriptors thus user no
longer needs to give them explicitely

- Tested for 4 channel software type I PCM encoding with 16 bit with 1
channel per FIFO and 2 channels per FIFO (this is I2S specific)
2021-04-03 09:49:27 +02:00
Reinhard Panhuber d5a5a1cab6 Implement audio PCM type I enc./decoding acc. to 2.3.1.5 Audio Streams
Extending capabilities of support FIFOs
Removing copy from to FIFO
Adjusting audio examples
Remove peek/read into other FIFO
2021-03-10 19:32:13 +01:00
Reinhard Panhuber 8ec99694d2 audio_decive clean up and bootstrapping of linear (formerly evade) buff. 2021-03-01 09:09:15 +01:00
Reinhard Panhuber c098da9803 Implement left and right justifications for 24 to 32 bit PCM encoding 2021-02-18 19:25:08 +01:00
Reinhard Panhuber 9e2a1d2e6a Fix CFG_TUD_AUDIO_EP_IN/OUT_SW_BUFFER_SIZE to be defined anyway 2021-02-12 18:31:54 +01:00
Reinhard Panhuber 185414721f Formating 2021-02-12 18:04:45 +01:00
Reinhard Panhuber a9fd0a454a Complete redesign of audio driver. 2021-02-12 16:28:41 +01:00
Reinhard Panhuber 84406f1654 Rework audio driver 2021-01-31 19:08:23 +01:00
hathach cebb375eac migrate audio device to new control xfer cb 2020-11-20 17:20:05 +07:00
Reinhard Panhuber 032e84c9be Revert dcd_alloc_mem_for_conf() but keep changes from @kasjer for ISO EP
Add tud_audio_set_itf_close_EP_cb()
2020-10-09 19:50:05 +02:00
Reinhard Panhuber f700c08aed Remove CFG_TUD_AUDIO_TX_DMA_RINGBUFFER_SIZE which is not needed any more 2020-10-07 10:57:12 +02:00
hathach 3f54c27afa fix audio_test build 2020-10-07 13:36:03 +07:00
Jerzy Kasenberg 2ace98e943 audio_device: Update explicit feedback support
Feedback can be specified by the user code and will be
sent at feedback endpoint specified interval.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg 759d530506 audio_device: Allow one FIFO for N channels
This allow to build with single FIFO for devices with multiple channels.
Having just one FIFO greatly reduces time needed to feed endpoint.

This change also allows to have one FIFO with 24 bit samples that
is not rounded up to 32 bit elements.
CFG_TUD_AUDIO_RX_ITEMSIZE and CFG_TUD_AUDIO_TX_ITEMSIZE can be manually
defined. This allows to use FIFO more efficiently when 24 bits samples
are already using 3 bytes, in this case there is no need to put them
into FIFO one by one.
For 8, 16, 32 bits samples size efficient FIFO access is always used
when single FIFO is selected.

This also changes FIFO element size to 1, FIFO usage was confusing
in some place it treated content as byte base in other it looked like
ITEM size is to be used. Also bufsize that in most (maybe all) cases
was really meaning item count.
bufsize now mean buffer size in bytes so there is no confusion.
2020-09-28 08:41:17 +02:00
Jerzy Kasenberg 5ad2f8efc6 audio_device: Fix inline function specifiers
Having just inline keyword for function specified in header
may not be enough to generate code for function.

Adding static solves this problem.
static inline is used in all other inline functions in TinyUSB.
2020-09-28 08:41:17 +02:00
Reinhard Panhuber 338e96fa82 Remove tud_audio_n_write_ep_in_buffer() as long as ISO EPs are not RBs. 2020-09-03 18:09:46 +02:00
Reinhard Panhuber 8f0693346c Allow epin_buf to be written directly into in case no TX FIFOs are used.
This is helpful if you have already encoded audio data and want an
efficient way to send it. However, this approach is NOT THREADSAFE so
far and works realiably ONLY IF tud_audio_n_write_ep_in_buffer() is NOT
called form an interrupt!
2020-09-01 11:26:16 +02:00
Reinhard Panhuber 83bd214203 Fix comment. 2020-08-29 13:26:41 +02:00
Reinhard Panhuber 43c4b53635 Fix CFG_TUD_AUDIO_RX_FIFO_SIZE defines. 2020-08-29 13:24:10 +02:00
Jerzy Kasenberg b1f0d6f57e audio_device: Change CFG_TUD_AUDIO_TX_BUFSIZE to CFG_TUD_AUDIO_TX_FIFO_SIZE
CFG_TUD_AUDIO_TX_BUFSIZE seems to be used only in 3 preprocessor
condition while in other places CFG_TUD_AUDIO_TX_FIFO_SIZE is used.
2020-08-25 14:45:40 +02:00
Reinhard Panhuber 37be0ca732 Fix formatting, get rid of all tabs. 2020-08-20 20:09:44 +02:00
Reinhard Panhuber c14f68e2c1 Commit before sharing.
Setup a test example - UNTESTED!
Missing: Start transmitting audio data in set_interface.
2020-08-19 21:07:43 +02:00
Reinhard Panhuber d91843bcd2 Get and set requests work 2020-07-25 11:18:50 +02:00