From 5f6236ee356d71ae7903b2f0eb6ffd9b05d0437c Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Sat, 25 Apr 2009 15:57:07 +0000 Subject: [PATCH] Try to open 128:0 Timidity port as well. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3354 --- src/gui/midi_alsa.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/gui/midi_alsa.h b/src/gui/midi_alsa.h index f9aae8a2..1e64b1ab 100644 --- a/src/gui/midi_alsa.h +++ b/src/gui/midi_alsa.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: midi_alsa.h,v 1.17 2007-08-08 08:04:53 qbix79 Exp $ */ +/* $Id: midi_alsa.h,v 1.18 2009-04-25 15:57:07 qbix79 Exp $ */ #define ALSA_PCM_OLD_HW_PARAMS_API #define ALSA_PCM_OLD_SW_PARAMS_API @@ -125,7 +125,7 @@ public: bool Open(const char * conf) { char var[10]; unsigned int caps; - bool defaultport = true; //try 17:0 as well. Seems to be default nowadays + bool defaultport = true; //try 17:0 and 128:0 as well. Seems to be default nowadays // try to use port specified in config file if (conf && conf[0]) { @@ -168,10 +168,13 @@ public: if (snd_seq_connect_to(seq_handle, my_port, seq_client, seq_port) < 0) { if (defaultport) { //if port "65:0" (default) try "17:0" as well seq_client = 17; seq_port = 0; //Update reported values - if(snd_seq_connect_to(seq_handle,my_port,seq_client,seq_port) < 0) { - snd_seq_close(seq_handle); - LOG_MSG("ALSA:Can't subscribe to MIDI port (65:0) nor (17:0)"); - return false; + if(snd_seq_connect_to(seq_handle,my_port,seq_client,seq_port) < 0) { //Try 128:0 Timidity port as well + seq_client = 128; seq_port = 0; //Update reported values + if(snd_seq_connect_to(seq_handle,my_port,seq_client,seq_port) < 0) { + snd_seq_close(seq_handle); + LOG_MSG("ALSA:Can't subscribe to MIDI port (65:0) nor (17:0) nor (128:0)"); + return false; + } } } else { snd_seq_close(seq_handle);