History

ALSA: fireface: pick up time stamp for request subaction of asynchronous transaction

The time stamp of isochronous cycle at which asynchronous transaction is sent is perhaps useful somehow. A commit b2405aa948b9 ("firewire: add kernel API to access packet structure in request structure for AR context") adds kernel API to retrieve the time stamp in inner structure of request subaction. This commit changes local framework to handle message delivered by the asynchronous transaction so that time stamp is picked up by the kernel API.

Takashi Sakamoto committed 3 years ago

Commit 4bdcb8d1 parent 50c597c4 files · +6 −5Browse files

Unified · Split

4 files
  1. sound/firewire/fireface/ff-protocol-former.c +2 −2
  2. sound/firewire/fireface/ff-protocol-latter.c +1 −1
  3. sound/firewire/fireface/ff-transaction.c +2 −1
  4. sound/firewire/fireface/ff.h +1 −1
sound/firewire/fireface/ff-protocol-former.c+2−2
@@ -403,7 +403,7 @@ static void ff800_finish_session(struct snd_ff *ff) · 402 unmodified lines
403// A write transaction to clear registered higher 4 bytes of destination address403// A write transaction to clear registered higher 4 bytes of destination address
404// has an effect to suppress asynchronous transaction from device.404// has an effect to suppress asynchronous transaction from device.
405static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,405static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
406 size_t length)406 size_t length, u32 tstamp)
407{407{
408 int i;408 int i;
409 409
@@ -554,7 +554,7 @@ static void ff400_finish_session(struct snd_ff *ff) · 144 unmodified lines
554// in its lower offset and expects userspace application to configure the554// in its lower offset and expects userspace application to configure the
555// register for it.555// register for it.
556static void ff400_handle_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,556static void ff400_handle_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
557 size_t length)557 size_t length, u32 tstamp)
558{558{
559 int i;559 int i;
560 560
sound/firewire/fireface/ff-protocol-latter.c+1−1
@@ -394,7 +394,7 @@ static void latter_dump_status(struct snd_ff *ff, struct snd_info_buffer *buffer · 393 unmodified lines
394// (0x'....'....'0000'0000) and expects userspace application to configure the394// (0x'....'....'0000'0000) and expects userspace application to configure the
395// register for it.395// register for it.
396static void latter_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,396static void latter_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
397 size_t length)397 size_t length, u32 tstamp)
398{398{
399 u32 data = le32_to_cpu(*buf);399 u32 data = le32_to_cpu(*buf);
400 unsigned int index = (data & 0x000000f0) >> 4;400 unsigned int index = (data & 0x000000f0) >> 4;
sound/firewire/fireface/ff-transaction.c+2−1
@@ -131,11 +131,12 @@ static void handle_msg(struct fw_card *card, struct fw_request *request, int tco · 130 unmodified lines
131{131{
132 struct snd_ff *ff = callback_data;132 struct snd_ff *ff = callback_data;
133 __le32 *buf = data;133 __le32 *buf = data;
134 u32 tstamp = fw_request_get_timestamp(request);
134 135
135 fw_send_response(card, request, RCODE_COMPLETE);136 fw_send_response(card, request, RCODE_COMPLETE);
136 137
137 offset -= ff->async_handler.offset;138 offset -= ff->async_handler.offset;
138 ff->spec->protocol->handle_msg(ff, (unsigned int)offset, buf, length);139 ff->spec->protocol->handle_msg(ff, (unsigned int)offset, buf, length, tstamp);
139}140}
140 141
141static int allocate_own_address(struct snd_ff *ff, int i)142static int allocate_own_address(struct snd_ff *ff, int i)
sound/firewire/fireface/ff.h+1−1
@@ -111,7 +111,7 @@ enum snd_ff_clock_src { · 110 unmodified lines
111 111
112struct snd_ff_protocol {112struct snd_ff_protocol {
113 void (*handle_msg)(struct snd_ff *ff, unsigned int offset, const __le32 *buf,113 void (*handle_msg)(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
114 size_t length);114 size_t length, u32 tstamp);
115 int (*fill_midi_msg)(struct snd_ff *ff,115 int (*fill_midi_msg)(struct snd_ff *ff,
116 struct snd_rawmidi_substream *substream,116 struct snd_rawmidi_substream *substream,
117 unsigned int port);117 unsigned int port);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t