comparison src/audio/alsa/SDL_alsa_audio.c @ 4334:afadcd7d2319 SDL-1.2

Use the plug: ALSA devices for surround sound formats, which have automatic sample format/rate conversion. Based on feedback from the ALSA development mailing list: http://mailman.alsa-project.org/pipermail/alsa-devel/2009-October/022267.html
author Sam Lantinga <slouken@libsdl.org>
date Tue, 13 Oct 2009 09:59:20 +0000
parents 55717a755897
children 77b20871fd44
comparison
equal deleted inserted replaced
4333:55717a755897 4334:afadcd7d2319
40 #endif 40 #endif
41 41
42 42
43 /* The tag name used by ALSA audio */ 43 /* The tag name used by ALSA audio */
44 #define DRIVER_NAME "alsa" 44 #define DRIVER_NAME "alsa"
45
46 /* The default ALSA audio driver */
47 #define DEFAULT_DEVICE "default"
48 45
49 /* Whether we should set the buffer size or the period size */ 46 /* Whether we should set the buffer size or the period size */
50 /*#define SET_PERIOD_SIZE*/ 47 /*#define SET_PERIOD_SIZE*/
51 /*#define DEBUG_PERIOD_SIZE*/ 48 /*#define DEBUG_PERIOD_SIZE*/
52 49
170 { 167 {
171 const char *device; 168 const char *device;
172 169
173 device = SDL_getenv("AUDIODEV"); /* Is there a standard variable name? */ 170 device = SDL_getenv("AUDIODEV"); /* Is there a standard variable name? */
174 if ( device == NULL ) { 171 if ( device == NULL ) {
175 if (channels == 6) device = "surround51"; 172 switch (channels) {
176 else if (channels == 4) device = "surround40"; 173 case 6:
177 else device = DEFAULT_DEVICE; 174 device = "plug:surround51";
175 break;
176 case 4:
177 device = "plug:surround40";
178 break;
179 default:
180 device = "default";
181 break;
182 }
178 } 183 }
179 return device; 184 return device;
180 } 185 }
181 186
182 /* Audio driver bootstrap functions */ 187 /* Audio driver bootstrap functions */