Changeset 5056:b31e60545552 in roaraudio
- Timestamp:
- 06/02/11 23:13:11 (13 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
configure
r5052 r5056 1585 1585 test_func_defmake ROAR_HAVE_GETVERSIONEX GetVersionEx 'OSVERSIONINFO osinfo; osinfo.dwOSVersionInfoSize = sizeof(osinfo);GetVersionEx(&osinfo);' -- windows.h 1586 1586 1587 test_func_defmake ROAR_HAVE_AO_APPEND_GLOBAL_OPTION ao_append_global_option 'ao_append_global_option("","")' ao -- ao/ao.h 1588 1587 1589 1588 1590 echo -n 'checking for basic IO calls... ' -
roard/driver_ao.c
r5012 r5056 32 32 if ( _driver_ao_usage_counter++ == 0 ) 33 33 ao_initialize(); 34 35 #ifdef ROAR_HAVE_AO_APPEND_GLOBAL_OPTION 36 ao_append_global_option("client_name", "roard"); 37 #endif 34 38 } 35 39 … … 44 48 ao_sample_format format; 45 49 int driver; 50 int autoconfig = 0; 46 51 47 52 ROAR_WARN("The libao driver is obsolete, use another!"); … … 49 54 if ( fh != -1 ) 50 55 return -1; 56 57 if ( sstream != NULL ) { 58 autoconfig = streams_get_flag(ROAR_STREAM(sstream)->id, ROAR_FLAG_AUTOCONF); 59 } 51 60 52 61 driver_ao_init(); … … 94 103 break; 95 104 default: 96 ROAR_ERR("Can not open audio device via libao: codec not supported. You may want to try -oO codec=pcm"); 97 driver_ao_uninit(); 98 return -1; 99 break; 105 if ( autoconfig ) { 106 format.byte_format = AO_FMT_NATIVE; 107 info->codec = ROAR_CODEC_DEFAULT; 108 } else { 109 ROAR_ERR("Can not open audio device via libao: codec not supported. You may want to try -oO codec=pcm"); 110 driver_ao_uninit(); 111 return -1; 112 } 113 break; 100 114 } 101 115 102 116 aodevice = ao_open_live(driver, &format, NULL /* no options */); 117 118 if ( aodevice == NULL && autoconfig ) { 119 format.byte_format = AO_FMT_NATIVE; 120 format.bits = 16; 121 info->codec = ROAR_CODEC_DEFAULT; 122 info->bits = 16; 123 aodevice = ao_open_live(driver, &format, NULL /* no options */); 124 } 103 125 104 126 if ( aodevice == NULL ) { -
roard/driver_artsc.c
r4809 r5056 51 51 int driver_artsc_open_vio(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream) { 52 52 struct roar_artsc * self = NULL; 53 int autoconfig = 0; 53 54 54 55 (void)sstream; … … 56 57 if ( fh != -1 || device != NULL ) 57 58 return -1; 59 60 if ( sstream != NULL ) { 61 autoconfig = streams_get_flag(ROAR_STREAM(sstream)->id, ROAR_FLAG_AUTOCONF); 62 } 58 63 59 64 self = roar_mm_malloc(sizeof(struct roar_artsc)); … … 73 78 self->info = info; 74 79 self->stream = arts_play_stream(info->rate, info->bits, info->channels, "roard"); 80 81 if ( self->stream == NULL && autoconfig ) { 82 info->bits = 16; 83 self->stream = arts_play_stream(info->rate, info->bits, info->channels, "roard"); 84 } 75 85 76 86 if ( self->stream == NULL ) { -
roard/driver_portaudio.c
r5012 r5056 35 35 long flags = PABLIO_WRITE; 36 36 #elif defined(ROAR_HAVE_PA19_VERSION_19) 37 PaStreamParameters params; 38 #endif 37 39 PaError err; 38 PaStreamParameters params; 39 #endif 40 int autoconfig = 0; 40 41 41 42 if ( fh != -1 ) 42 43 return -1; 44 45 if ( sstream != NULL ) { 46 autoconfig = streams_get_flag(ROAR_STREAM(sstream)->id, ROAR_FLAG_AUTOCONF); 47 } 43 48 44 49 switch (info->bits) { … … 56 61 break; 57 62 default: 58 return -1; 63 if ( autoconfig ) { 64 info->codec = ROAR_CODEC_DEFAULT; 65 fmt = paInt8; 66 } else { 67 return -1; 68 } 59 69 break; 60 70 } 61 71 break; 62 72 case 16: 63 if ( info->codec != ROAR_CODEC_DEFAULT ) 64 return -1; 73 if ( info->codec != ROAR_CODEC_DEFAULT ) { 74 if ( autoconfig ) { 75 info->codec = ROAR_CODEC_DEFAULT; 76 } else { 77 return -1; 78 } 79 } 65 80 fmt = paInt16; 66 81 break; 67 82 #ifdef paPackedInt24 68 83 case 24: 69 if ( info->codec != ROAR_CODEC_DEFAULT ) 84 if ( info->codec != ROAR_CODEC_DEFAULT ) { 85 if ( autoconfig ) { 86 info->codec = ROAR_CODEC_DEFAULT; 87 } else { 88 return -1; 89 } 90 } 91 fmt = paPackedInt24; 92 break; 93 #endif 94 case 32: 95 if ( info->codec != ROAR_CODEC_DEFAULT ) { 96 if ( autoconfig ) { 97 info->codec = ROAR_CODEC_DEFAULT; 98 } else { 99 return -1; 100 } 101 } 102 fmt = paInt32; 103 break; 104 default: 105 if ( autoconfig ) { 106 info->codec = ROAR_CODEC_DEFAULT; 107 info->bits = 16; 108 fmt = paInt16; 109 } else { 70 110 return -1; 71 fmt = paPackedInt24; 72 break; 73 #endif 74 case 32: 75 if ( info->codec != ROAR_CODEC_DEFAULT ) 76 return -1; 77 fmt = paInt32; 78 break; 79 default: 80 return -1; 111 } 112 break; 81 113 } 82 114 … … 100 132 case 2: flags |= PABLIO_STEREO; break; 101 133 default: 102 roar_mm_free(self); 103 Pa_Terminate(); 104 return -1; 105 } 106 107 if ( OpenAudioStream(&(self->ostream), info->rate, fmt, flags) != paNoError ) { 134 if ( autoconfig ) { 135 info->channels = 2; 136 flags |= PABLIO_STEREO; 137 } else { 138 roar_mm_free(self); 139 Pa_Terminate(); 140 return -1; 141 } 142 } 143 144 err = OpenAudioStream(&(self->ostream), info->rate, fmt, flags); 145 146 if ( err != paNoError && autoconfig ) { 147 if ( (flags & PABLIO_MONO) == PABLIO_MONO ) { 148 flags -= PABLIO_MONO; 149 flags |= PABLIO_STEREO; 150 info->channels = 2; 151 } 152 fmt = paInt16; 153 info->codec = ROAR_CODEC_DEFAULT; 154 info->bits = 16; 155 156 err = OpenAudioStream(&(self->ostream), info->rate, fmt, flags); 157 } 158 159 if ( err != paNoError ) { 108 160 roar_mm_free(self); 109 161 Pa_Terminate(); … … 133 185 ); 134 186 187 if ( err != paNoError && autoconfig ) { 188 params.sampleFormat = paInt16; 189 params.channelCount = 2; 190 info->codec = ROAR_CODEC_DEFAULT; 191 info->bits = 16; 192 info->channels = 2; 193 194 err = Pa_OpenStream(&(self->stream), 195 NULL, 196 ¶ms, 197 info->rate, 198 128 /*FIXME:frames*/, 199 paClipOff, 200 NULL, 201 NULL 202 ); 203 } 204 135 205 if ( err != paNoError ) { 136 206 ROAR_ERR("driver_portaudio_open(*): Could not open PortAudio device: \"%s\".", Pa_GetErrorText(err)); -
roard/driver_pulsesimple.c
r5012 r5056 34 34 pa_stream_direction_t dir = PA_STREAM_PLAYBACK; 35 35 pa_sample_spec ss; 36 int autoconfig = 0; 37 int needauto = 0; 36 38 37 39 // pa_sample_format_t format; /**< The sample format */ 40 41 if ( fh != -1 ) 42 return -1; 43 44 if ( sstream != NULL ) { 45 autoconfig = streams_get_flag(ROAR_STREAM(sstream)->id, ROAR_FLAG_AUTOCONF); 46 } 38 47 39 48 switch (info->codec) { … … 50 59 break; 51 60 default: 52 return -1;61 needauto = 1; 53 62 break; 54 63 } … … 60 69 break; 61 70 default: 62 return -1;71 needauto = 1; 63 72 break; 64 73 } … … 70 79 ss.format = PA_SAMPLE_U8; 71 80 } else { 72 return -1;81 needauto = 1; 73 82 } 74 83 break; 75 84 default: 76 return -1;85 needauto = 1; 77 86 break; 87 } 88 89 if ( needauto ) { 90 if ( !autoconfig ) { 91 return -1; 92 } 93 94 info->bits = 16; 95 info->codec = ROAR_CODEC_DEFAULT; 96 ss.format = PA_SAMPLE_S16NE; 78 97 } 79 98 … … 85 104 86 105 self->handle = pa_simple_new(device, "roard", dir, subdev, "RoarAudio Sound Server", &ss, NULL, NULL, &pulseerror); 106 107 if ( self->handle == NULL && autoconfig ) { 108 info->bits = 16; 109 info->codec = ROAR_CODEC_DEFAULT; 110 ss.format = PA_SAMPLE_S16NE; 111 112 self->handle = pa_simple_new(device, "roard", dir, subdev, "RoarAudio Sound Server", &ss, NULL, NULL, &pulseerror); 113 } 87 114 88 115 if ( self->handle == NULL ) { -
roard/driver_roar.c
r4708 r5056 47 47 48 48 if ( roar_vio_simple_stream(inst, info->rate, info->channels, info->bits, info->codec, device, dir, "roard") == -1 ) { 49 if ( streams_get_flag(ROAR_STREAM(sstream)->id, ROAR_FLAG_AUTOCONF) ) { 50 roar_profile2info(info, "default"); 51 if ( roar_vio_simple_stream(inst, info->rate, info->channels, info->bits, info->codec, device, dir, "roard") == -1 ) { 52 return -1; 53 } 54 } 49 55 return -1; 50 56 } -
roard/driver_rsound.c
r5012 r5056 75 75 tmp = -1; // unknown by RSound 76 76 77 if ( info->bits > 16 && streams_get_flag(ROAR_STREAM(sstream)->id, ROAR_FLAG_AUTOCONF) ) { 78 info->bits = 32; 79 } 80 77 81 switch (info->codec) { 78 82 case ROAR_CODEC_PCM_S_LE: … … 80 84 case 8: tmp = RSD_S8; break; 81 85 case 16: tmp = RSD_S16_LE; break; 86 #ifdef RSD_S32_LE 87 case 32: tmp = RSD_S32_LE; break; 88 #endif 82 89 } 83 90 break; … … 86 93 case 8: tmp = RSD_S8; break; 87 94 case 16: tmp = RSD_S16_BE; break; 95 #ifdef RSD_S32_BE 96 case 32: tmp = RSD_S32_BE; break; 97 #endif 88 98 } 89 99 break; … … 97 107 case 8: tmp = RSD_U8; break; 98 108 case 16: tmp = RSD_U16_LE; break; 109 #ifdef RSD_U32_LE 110 case 32: tmp = RSD_U32_LE; break; 111 #endif 99 112 } 100 113 break; … … 103 116 case 8: tmp = RSD_U8; break; 104 117 case 16: tmp = RSD_U16_BE; break; 118 #ifdef RSD_U32_BE 119 case 32: tmp = RSD_U32_BE; break; 120 #endif 105 121 } 106 122 break; … … 111 127 break; 112 128 } 129 130 #ifdef RSD_S16_NE 131 if ( tmp == -1 && streams_get_flag(ROAR_STREAM(sstream)->id, ROAR_FLAG_AUTOCONF) ) { 132 info->bits = 16; 133 info->codec = ROAR_CODEC_DEFAULT; 134 tmp = RSD_S16_NE; 135 } 136 #endif 113 137 114 138 if ( tmp == -1 ) { -
roard/driver_wmm.c
r5012 r5056 215 215 216 216 mmres = 217 waveOutOpen(& self->hwo,217 waveOutOpen(&(self->hwo), 218 218 self->id, 219 & self->wavefmt,219 &(self->wavefmt), 220 220 (DWORD_PTR)0/* waveOutProc */, 221 221 (DWORD_PTR)self,
Note: See TracChangeset
for help on using the changeset viewer.