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
403403 // A write transaction to clear registered higher 4 bytes of destination address
404404 // has an effect to suppress asynchronous transaction from device.
405405 static 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)
407407 {
408408 int i;
409409
@@ -554,7 +554,7 @@ static void ff400_finish_session(struct snd_ff *ff) · 144 unmodified lines
554554 // in its lower offset and expects userspace application to configure the
555555 // register for it.
556556 static void ff400_handle_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
557− size_t length)
557+ size_t length, u32 tstamp)
558558 {
559559 int i;
560560
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
394394 // (0x'....'....'0000'0000) and expects userspace application to configure the
395395 // register for it.
396396 static 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)
398398 {
399399 u32 data = le32_to_cpu(*buf);
400400 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
131131 {
132132 struct snd_ff *ff = callback_data;
133133 __le32 *buf = data;
134+ u32 tstamp = fw_request_get_timestamp(request);
134135
135136 fw_send_response(card, request, RCODE_COMPLETE);
136137
137138 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);
139140 }
140141
141142 static 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
111111
112112 struct snd_ff_protocol {
113113 void (*handle_msg)(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
114− size_t length);
114+ size_t length, u32 tstamp);
115115 int (*fill_midi_msg)(struct snd_ff *ff,
116116 struct snd_rawmidi_substream *substream,
117117 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