Ticket #8898: alsa.diff
File alsa.diff, 4.8 KB (added by , 16 years ago) |
---|
-
README
1322 1322 1323 1323 7.6.1) Playing sound with ALSA sequencer: [UNIX ONLY] 1324 1324 ------ ---------------------------------- 1325 If you have installed the ALSA driver with the sequencer support, then 1326 set the environment variable SCUMMVM_PORT or the config file parameter 1327 alsa_port to your sequencer port. The default is "65:0".1325 If you have installed the ALSA driver with the sequencer support, then set the 1326 environment variable SCUMMVM_PORT or the config file parameter alsa_port to 1327 your sequencer port. The default is to try both "65:0" and "17:0". 1328 1328 1329 1329 Here is a little howto on how to use the ALSA sequencer with your soundcard. 1330 1330 In all cases, to have a list of all the sequencer ports you have, try the 1331 1331 command "aconnect -o -l". This should give output similar to: 1332 client 64: 'External MIDI 0' [type=kernel] 1333 0 'MIDI 0-0 ' 1334 client 65: 'Emu10k1 WaveTable' [type=kernel] 1332 1333 client 14: 'Midi Through' [type=kernel] 1334 0 'Midi Through Port-0' 1335 client 16: 'SBLive! Value [CT4832]' [type=kernel] 1336 0 'EMU10K1 MPU-401 (UART)' 1337 client 17: 'Emu10k1 WaveTable' [type=kernel] 1335 1338 0 'Emu10k1 Port 0 ' 1336 1339 1 'Emu10k1 Port 1 ' 1337 1340 2 'Emu10k1 Port 2 ' 1338 1341 3 'Emu10k1 Port 3 ' 1339 client 128: ' Client-128' [type=user]1342 client 128: 'TiMidity' [type=user] 1340 1343 0 'TiMidity port 0 ' 1341 1344 1 'TiMidity port 1 ' 1345 2 'TiMidity port 2 ' 1346 3 'TiMidity port 3 ' 1342 1347 1343 1348 This means the external MIDI output of the sound card is located on the 1344 port 64:0, four WaveTable MIDI outputs in 65:0, 65:1, 65:21345 and 65:3, and two TiMidity ports, located at 128:0 and 128:1.1349 port 16:0, four WaveTable MIDI outputs in 17:0, 17:1, 17:2 1350 and 17:3, and four TiMidity ports, located at 128:0, 128:1, 128:2 and 128:3. 1346 1351 1347 1352 If you have a FM-chip on your card, like the SB16, then you have to load 1348 1353 the SoundFonts using the sbiload software. Example: 1349 sbiload -p 65:0 /etc/std.o3 /etc/drums.o31354 sbiload -p 17:0 /etc/std.o3 /etc/drums.o3 1350 1355 1351 1356 If you have a WaveTable capable sound card, you have to load a sbk or sf2 1352 SoundFont using the sfxload software. Example:1357 SoundFont using the sfxload or asfxload software. Example: 1353 1358 sfxload /path/to/8mbgmsfx.sf2 1354 1359 1355 1360 If you don't have a MIDI capable soundcard, there are two options: FluidSynth -
backends/midi/alsa.cpp
79 79 } 80 80 81 81 int MidiDriver_ALSA::open() { 82 const char *var ;82 const char *var = NULL; 83 83 84 84 if (_isOpen) 85 85 return MERR_ALREADY_OPEN; 86 86 _isOpen = true; 87 87 88 if (!(var = getenv("SCUMMVM_PORT"))) {89 // use config option if no var specified88 var = getenv("SCUMMVM_PORT"); 89 if (!var && ConfMan.hasKey("alsa_port")) { 90 90 var = ConfMan.get("alsa_port").c_str(); 91 } 92 93 if (var) { 91 94 if (parse_addr(var, &seq_client, &seq_port) < 0) { 92 95 error("Invalid port %s", var); 93 96 return -1; 94 97 } 95 } else {96 if (parse_addr(var, &seq_client, &seq_port) < 0) {97 error("Invalid port %s", var);98 return -1;99 }100 98 } 101 99 102 100 if (my_snd_seq_open(&seq_handle) < 0) { … … 120 118 return -1; 121 119 } 122 120 123 if (seq_client != SND_SEQ_ADDRESS_SUBSCRIBERS) { 124 /* subscribe to MIDI port */ 125 if (snd_seq_connect_to(seq_handle, my_port, seq_client, seq_port) < 0) { 126 error("Can't subscribe to MIDI port (%d:%d) see README for help", seq_client, seq_port); 121 if (var) { 122 if (seq_client != SND_SEQ_ADDRESS_SUBSCRIBERS) { 123 // subscribe to MIDI port 124 if (snd_seq_connect_to(seq_handle, my_port, seq_client, seq_port) < 0) { 125 error("Can't subscribe to MIDI port (%d:%d) see README for help", seq_client, seq_port); 126 } 127 127 } 128 else printf("Connected to Alsa sequencer client [%d:%d]\n", seq_client, seq_port); 128 } else { 129 int defaultPorts[] = { 130 65, 0, 131 17, 0 132 }; 133 int i; 134 135 for (i = 0; i < ARRAYSIZE(defaultPorts); i += 2) { 136 seq_client = defaultPorts[i]; 137 seq_port = defaultPorts[i + 1]; 138 if (snd_seq_connect_to(seq_handle, my_port, seq_client, seq_port) >= 0) 139 break; 140 } 141 142 if (i >= ARRAYSIZE(defaultPorts)) 143 error("Can't subscribe to MIDI port (65:0) or (17:0)"); 129 144 } 130 145 146 printf("Connected to Alsa sequencer client [%d:%d]\n", seq_client, seq_port); 131 147 printf("ALSA client initialised [%d:0]\n", my_client); 132 148 133 149 return 0; -
base/commandLine.cpp
212 212 ConfMan.registerDefault("joystick_num", -1); 213 213 ConfMan.registerDefault("confirm_exit", false); 214 214 ConfMan.registerDefault("disable_sdl_parachute", false); 215 #ifdef USE_ALSA216 ConfMan.registerDefault("alsa_port", "65:0");217 #endif218 215 219 216 // Register default savepath 220 217 #ifdef DEFAULT_SAVE_PATH