Commit Graph

65 Commits

Author SHA1 Message Date
Reinhard Panhuber a1efd41649 Merge remote-tracking branch 'upstream/master' into edpt_ISO_xfer 2021-04-03 09:50:08 +02:00
hathach 48bb96f507 correct midi stream read behavior to read until user buffer is full or no more data from usb fifo 2021-04-02 15:08:36 +07:00
hathach 350eb11277 refactor midi read buffer to stream 2021-04-02 14:52:44 +07:00
hathach da59c4ad44 rename midi write()/read() to stream_write() stream_read()
also add deprecated for warning and rename hint
2021-04-02 14:43:38 +07:00
hathach 99b78e62f2 removed tud_midi_write24() 2021-04-02 14:34:13 +07:00
hathach 08fe16840f refactor midi write into stream 2021-04-02 14:26:55 +07:00
hathach 6b04efd443 refactor midi stream read 2021-04-02 13:55:51 +07:00
hathach 080b14b292 fix midi tx fifo overflow cause data corruption
rename
2021-04-02 13:26:55 +07:00
hathach 949ff791e0 code format 2021-03-31 00:34:09 +07:00
hathach b05084e406 remove tud_midi_read_flush() 2021-03-30 23:56:55 +07:00
hathach c5aa661c89 rename tud_midi_receive/send to tud_midi_packet_read/write 2021-03-30 23:54:17 +07:00
hathach 794083b647 Merge branch 'master' into edpt_ISO_xfer 2021-03-10 17:10:49 +07:00
Reinhard Panhuber 7e56f46957 Extend FIFO mutex to use separate write and read mutexes.
Adjust all USB drivers using FIFO and mutexes.
2021-03-04 13:52:14 +01:00
hathach 33a29c9e4c add midi comment 2021-03-04 19:30:08 +07:00
hathach aa85099171 fix tud_midi_write24 typo
rename jack_id to cable_num in function argument
2021-02-19 10:51:47 +07:00
Ha Thach be1bd74b4b
Merge pull request #618 from homeodor/master
A CDC-like blocking behaviour for MIDI, incl. SysEx
2021-02-06 12:30:28 +07:00
Alexander Golovanov 2a34be2eb0
A CDC-like blocking behaviour 2021-01-30 04:11:08 +03:00
Michael Himing c4f7ea09f1 Fix midi sysex sending bug 2021-01-28 20:31:11 +11:00
hathach 8813f9d3b8 clean up 2020-11-20 15:33:05 +07:00
hathach e2abb089f4 migrate midi device to new control xfer cb 2020-11-20 15:30:36 +07:00
Reinhard Panhuber da1c3c226b Change AUDIO_PROTOCOL_V1 to AUDIO_FUNC_PROTOCOL_CODE_UNDEF in midi.c.
The USB specification does not define any AUDIO_PROTOCOL_V1!
2020-09-28 22:44:09 +02:00
Ha Thach 8b2c822557
Merge pull request #512 from mzero/fix-midi-sysex
Fix a bug in writing SysEx messages.
2020-09-23 11:23:53 +07:00
Mark Lentczner 3b0216d3bf
Update midi_device.c
Fix a bug in writing SysEx messages.

At the start of a new USB packet (4 bytes), while in the middle of a SysEx, the code mistakenly
set the buffer length to 4, not the target length. As a consequence, the 3rd and 4th bytes from
the last packet were included, after every byte of the SysEx after the first packet of three.

The fix is simple, as it was just a typo, as can bee seen from the other branches in the same
section of if/else statements: At the start of a new packet, the code should set up the target
length... the buffer length should be left at 2 (as set on line 180).
2020-09-13 15:05:18 -07:00
hathach 801f8b5b38 update claim edpt for hid and midi 2020-09-10 23:32:08 +07:00
hathach 2d8787cdeb fix typo 2020-08-24 15:29:34 +07:00
hathach a1b7e767af improve midi
- fix #436 tud_midi_rx_cb() not invoked
- fix xfer_cb() not handle ep in
- add ZLP if needed
2020-08-24 14:31:46 +07:00
hathach 881025afdc add new name warning to cdc and midi (skip msc, hid warning for now) 2020-07-17 23:01:39 +07:00
hathach fea6fb73a1
add fs & hs config for cdc_msc_freertos, midi_test, msc_dual_lun 2020-07-16 13:04:10 +07:00
hathach 10cd3f24bf initial transfer failed in open() shouldn't cause the driver open to fail. 2020-05-28 13:48:02 +07:00
hathach 8f560bf275
update midi open() 2020-05-28 11:41:37 +07:00
hathach 017c95037f add usbd edpt open
- RTT mode is blocking to prevent log lost
- Improve logging message
2020-04-26 14:51:44 +07:00
hathach c59fa77427 Revert "Merge pull request #359 from versioduo/midi-flow-control"
This reverts commit 1d33aa9b6f, reversing
changes made to 718db7e536.
2020-04-23 23:25:20 +07:00
hathach 3b83813f01 clean up 2020-04-22 00:29:51 +07:00
Kay Sievers a0598ef369 MIDI - Add flow control to incoming packet stream
Larger SysEx transfers get corrupted by incoming packets.

This changes the FIFOs not to overwrite their data. MIDI should not be
a transport that drops packets. A potentially blocking device is easier
to detect and handle than a device that silently corrupts the packet
stream at random overflows, especially when SysEx messages are involved.
2020-04-19 11:44:15 +02:00
Ha Thach f9262007ac
Merge pull request #258 from versioduo/midi-packets
MIDI packet interface
2020-04-19 15:43:07 +07:00
hathach bae570f7c7
tested with midi 2020-04-15 10:30:07 +07:00
Kay Sievers 73228a67ef MIDI: Add packet interface
This changes the internal buffering to the raw 4-byte messages. The
conversion of the messages to a byte-stream moved to the read/write
methods.

It adds a raw packet interface to send and retrieve the raw 4-byte
USB MIDI message:
  static inline bool     tud_midi_receive    (uint8_t packet[4]);
  static inline bool     tud_midi_send       (uint8_t const packet[4]);

MIDI USB packets carry virtual cable/wire/plug data in the packet header,
which cannot be exported in the byte-stream interface. The raw packet
interface allows to send and and receive the complete USB message.
2020-01-16 10:11:37 +01:00
hathach 05fd02194e correct return value of midid_xfer_cb 2020-01-16 11:12:26 +07:00
Nathan Conrad 25c1bea782 Normalize line endings 2020-01-15 14:47:43 -05:00
Peter Lawrence ff0e7d2bed implement multiple interfaces support 2019-12-28 14:27:32 -06:00
hathach fe1eadf177 fix #229 2019-11-27 12:34:30 +07:00
hathach 6183dbd0ce add -Wextra for more warnings to example
non-stack warning (probably mcu driver) should be suppressed in the
board.mk
2019-09-27 00:15:43 +07:00
Scott Shawcroft 00c440cb26
Merge pull request #99 from jepler/issue98-midi-program-change
midi_device: Send message classes C and D as 2 bytes
2019-08-15 23:34:42 -07:00
jepler 96d96a94b8 midi_device: Send message classes C and D as 2 bytes
.. sending these as two 1-byte messages with CIN of 0xF is
misinterpreted by OSes including Windows 10 and (reportedly)
Mac.

Testing performed: Ran the reproducer script, which sends Program
Change (0xCx) messages.  I did not check with Change Pressure (0xDx)
messages, but expect the same thing.

Closes: #98
2019-08-14 19:15:29 -05:00
hathach 2a543c0e79 update vendor device similar to cdc read/write
maybe refactor later
2019-07-24 23:07:30 +07:00
hathach c63f2b30cb rename tud_control_vendor_request_cb/complete_cb to tud_vendor_control_request_cb/complete_cb 2019-07-24 09:45:32 +07:00
hathach 33de35504a more house keeping 2019-07-19 20:20:13 +07:00
hathach cb4e6837e9 clean up, rename internal driver control_request_complete to simply control_complete 2019-07-12 22:03:40 +07:00
hathach 216ccc6e93 midi only use audio 1.0 without IAD 2019-07-05 16:46:11 +07:00
hathach 1b242cb3c6 clean up 2019-07-04 01:31:56 +07:00