[Jack-Devel] [jackaudio/jack1] 4492ce: [alsa_midi] fix hotplug device (de)enumeration

Paul Davis paul at linuxaudiosystems.com
Mon May 4 14:05:44 CEST 2015


  Branch: refs/heads/master
  Home:   https://github.com/jackaudio/jack1
  Commit: 4492cea02fb46305632d19796460b91fd319ec96
      https://github.com/jackaudio/jack1/commit/4492cea02fb46305632d19796460b91fd319ec96
  Author: Hanspeter Portner <dev at open-music-kontrollers.ch>
  Date:   2015-05-04 (Mon, 04 May 2015)

  Changed paths:
    M drivers/alsa_midi/a2j.h
    M drivers/alsa_midi/alsa_midi.c
    M drivers/alsa_midi/port_thread.c
    M drivers/alsa_midi/port_thread.h

  Log Message:
  -----------
  [alsa_midi] fix hotplug device (de)enumeration

Issues:
- With a running JACK with enabled alsa_midi driver (-X alsa_midi), plugging in
	a new MIDI device has no effect, e.g. no corresponding JACK ports are spawned
- With a running JACK with enabled alsa_midi driver (-X alsa_midi), deplugging
	a MIDI device has no effect, e.g. the corresponding JACK ports stay around

Result:
- JACK only creates JACK ports of ALSA MIDI clients/ports found at startup
- JACK has to be restarted for any ALSA MIDI device (de)enumeration to take
	place

Problem:
- There are some functions defined which actually should accomplish this in the
	alsa_midi driver code (e.g. 'a2j_update_ports' and 'a2j_free_ports'), but they
	are not called from any other function ;-)

Solution:
- Discriminate properly between ALSA PORT_START and PORT_CHANGE events
	- 'a2j_new_ports' function has been added which recycles some code from
		'alsa_input_thread'
- Actually call the already existing hot(de)plugging infrastructure
	- 'a2j_update_ports' and 'a2j_new_ports' get called from the
		'alsa_input_thread'
	- 'a2j_free_ports' gets called from 'alsa_output_thread'
	- 'alsa_out_thread' is woken up by 'a2j_jack_process_internal'
- Cleanup code that is not used:
	- 'port_add' ringbuffer has no function, as 'new_ports' ringbuffer seems to be
		implemented to accomplish the same

Signed-off-by: Hanspeter Portner <dev at open-music-kontrollers.ch>


  Commit: 6685cc737eec2937f0fb9d3088be2efee95a910e
      https://github.com/jackaudio/jack1/commit/6685cc737eec2937f0fb9d3088be2efee95a910e
  Author: Paul Davis <paul at linuxaudiosystems.com>
  Date:   2015-05-04 (Mon, 04 May 2015)

  Changed paths:
    M drivers/alsa_midi/a2j.h
    M drivers/alsa_midi/alsa_midi.c
    M drivers/alsa_midi/port_thread.c
    M drivers/alsa_midi/port_thread.h

  Log Message:
  -----------
  Merge branch 'ventosus-fix_alsa_midi_hotplug'


Compare: https://github.com/jackaudio/jack1/compare/fb78f60db1db...6685cc737eec


More information about the Jackaudio mailing list