aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/usb
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2014-12-16 08:56:33 -0500
committerFelipe Balbi <balbi@ti.com>2015-01-12 13:13:25 -0500
commit0d6be59a1d8a93086cd81e1c59f8d60ba35b40a2 (patch)
treec81c6f24028f20955daa629408964622d25beb57 /Documentation/usb
parentcdbe287d271637cb90f239d6a826e2aed555c1d7 (diff)
Documentation: usb: MIDI function testing
Summary of how to test MIDI function of USB gadget. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'Documentation/usb')
-rw-r--r--Documentation/usb/gadget-testing.txt84
1 files changed, 84 insertions, 0 deletions
diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb/gadget-testing.txt
index 01b9ffe2eabc..c2f148d245a5 100644
--- a/Documentation/usb/gadget-testing.txt
+++ b/Documentation/usb/gadget-testing.txt
@@ -9,6 +9,7 @@ provided by gadgets.
96. HID function 96. HID function
107. LOOPBACK function 107. LOOPBACK function
118. MASS STORAGE function 118. MASS STORAGE function
129. MIDI function
12 13
13 14
141. ACM function 151. ACM function
@@ -282,3 +283,86 @@ Testing the MASS STORAGE function
282device: connect the gadget, enable it 283device: connect the gadget, enable it
283host: dmesg, see the USB drives appear (if system configured to automatically 284host: dmesg, see the USB drives appear (if system configured to automatically
284mount) 285mount)
286
2879. MIDI function
288================
289
290The function is provided by usb_f_midi.ko module.
291
292Function-specific configfs interface
293------------------------------------
294
295The function name to use when creating the function directory is "midi".
296The MIDI function provides these attributes in its function directory:
297
298 buflen - MIDI buffer length
299 id - ID string for the USB MIDI adapter
300 in_ports - number of MIDI input ports
301 index - index value for the USB MIDI adapter
302 out_ports - number of MIDI output ports
303 qlen - USB read request queue length
304
305Testing the MIDI function
306-------------------------
307
308There are two cases: playing a mid from the gadget to
309the host and playing a mid from the host to the gadget.
310
3111) Playing a mid from the gadget to the host
312host)
313
314$ arecordmidi -l
315 Port Client name Port name
316 14:0 Midi Through Midi Through Port-0
317 24:0 MIDI Gadget MIDI Gadget MIDI 1
318$ arecordmidi -p 24:0 from_gadget.mid
319
320gadget)
321
322$ aplaymidi -l
323 Port Client name Port name
324 20:0 f_midi f_midi
325
326$ aplaymidi -p 20:0 to_host.mid
327
3282) Playing a mid from the host to the gadget
329gadget)
330
331$ arecordmidi -l
332 Port Client name Port name
333 20:0 f_midi f_midi
334
335$ arecordmidi -p 20:0 from_host.mid
336
337host)
338
339$ aplaymidi -l
340 Port Client name Port name
341 14:0 Midi Through Midi Through Port-0
342 24:0 MIDI Gadget MIDI Gadget MIDI 1
343
344$ aplaymidi -p24:0 to_gadget.mid
345
346The from_gadget.mid should sound identical to the to_host.mid.
347The from_host.id should sound identical to the to_gadget.mid.
348
349MIDI files can be played to speakers/headphones with e.g. timidity installed
350
351$ aplaymidi -l
352 Port Client name Port name
353 14:0 Midi Through Midi Through Port-0
354 24:0 MIDI Gadget MIDI Gadget MIDI 1
355128:0 TiMidity TiMidity port 0
356128:1 TiMidity TiMidity port 1
357128:2 TiMidity TiMidity port 2
358128:3 TiMidity TiMidity port 3
359
360$ aplaymidi -p 128:0 file.mid
361
362MIDI ports can be logically connected using the aconnect utility, e.g.:
363
364$ aconnect 24:0 128:0 # try it on the host
365
366After the gadget's MIDI port is connected to timidity's MIDI port,
367whatever is played at the gadget side with aplaymidi -l is audible
368in host's speakers/headphones.