diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2014-12-16 08:56:33 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-01-12 13:13:25 -0500 |
commit | 0d6be59a1d8a93086cd81e1c59f8d60ba35b40a2 (patch) | |
tree | c81c6f24028f20955daa629408964622d25beb57 /Documentation/usb | |
parent | cdbe287d271637cb90f239d6a826e2aed555c1d7 (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.txt | 84 |
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. | |||
9 | 6. HID function | 9 | 6. HID function |
10 | 7. LOOPBACK function | 10 | 7. LOOPBACK function |
11 | 8. MASS STORAGE function | 11 | 8. MASS STORAGE function |
12 | 9. MIDI function | ||
12 | 13 | ||
13 | 14 | ||
14 | 1. ACM function | 15 | 1. ACM function |
@@ -282,3 +283,86 @@ Testing the MASS STORAGE function | |||
282 | device: connect the gadget, enable it | 283 | device: connect the gadget, enable it |
283 | host: dmesg, see the USB drives appear (if system configured to automatically | 284 | host: dmesg, see the USB drives appear (if system configured to automatically |
284 | mount) | 285 | mount) |
286 | |||
287 | 9. MIDI function | ||
288 | ================ | ||
289 | |||
290 | The function is provided by usb_f_midi.ko module. | ||
291 | |||
292 | Function-specific configfs interface | ||
293 | ------------------------------------ | ||
294 | |||
295 | The function name to use when creating the function directory is "midi". | ||
296 | The 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 | |||
305 | Testing the MIDI function | ||
306 | ------------------------- | ||
307 | |||
308 | There are two cases: playing a mid from the gadget to | ||
309 | the host and playing a mid from the host to the gadget. | ||
310 | |||
311 | 1) Playing a mid from the gadget to the host | ||
312 | host) | ||
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 | |||
320 | gadget) | ||
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 | |||
328 | 2) Playing a mid from the host to the gadget | ||
329 | gadget) | ||
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 | |||
337 | host) | ||
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 | |||
346 | The from_gadget.mid should sound identical to the to_host.mid. | ||
347 | The from_host.id should sound identical to the to_gadget.mid. | ||
348 | |||
349 | MIDI 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 | ||
355 | 128:0 TiMidity TiMidity port 0 | ||
356 | 128:1 TiMidity TiMidity port 1 | ||
357 | 128:2 TiMidity TiMidity port 2 | ||
358 | 128:3 TiMidity TiMidity port 3 | ||
359 | |||
360 | $ aplaymidi -p 128:0 file.mid | ||
361 | |||
362 | MIDI ports can be logically connected using the aconnect utility, e.g.: | ||
363 | |||
364 | $ aconnect 24:0 128:0 # try it on the host | ||
365 | |||
366 | After the gadget's MIDI port is connected to timidity's MIDI port, | ||
367 | whatever is played at the gadget side with aplaymidi -l is audible | ||
368 | in host's speakers/headphones. | ||