3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 Christian Schoenebeck * |
* Copyright (C) 2005 - 2007 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
33 |
InitWithDefault(); // use default card |
InitWithDefault(); // use default card |
34 |
} |
} |
35 |
|
|
36 |
AudioOutputDeviceAlsa::ParameterCard::ParameterCard(String s) throw (LinuxSamplerException) : DeviceCreationParameterString(s) { |
AudioOutputDeviceAlsa::ParameterCard::ParameterCard(String s) throw (Exception) : DeviceCreationParameterString(s) { |
37 |
} |
} |
38 |
|
|
39 |
String AudioOutputDeviceAlsa::ParameterCard::Description() { |
String AudioOutputDeviceAlsa::ParameterCard::Description() { |
54 |
|
|
55 |
optional<String> AudioOutputDeviceAlsa::ParameterCard::DefaultAsString(std::map<String,String> Parameters) { |
optional<String> AudioOutputDeviceAlsa::ParameterCard::DefaultAsString(std::map<String,String> Parameters) { |
56 |
std::vector<String> cards = PossibilitiesAsString(Parameters); |
std::vector<String> cards = PossibilitiesAsString(Parameters); |
57 |
if (cards.empty()) throw LinuxSamplerException("AudioOutputDeviceAlsa: Can't find any card"); |
if (cards.empty()) throw Exception("AudioOutputDeviceAlsa: Can't find any card"); |
58 |
return cards[0]; // first card by default |
return cards[0]; // first card by default |
59 |
} |
} |
60 |
|
|
86 |
return CardNames; |
return CardNames; |
87 |
} |
} |
88 |
|
|
89 |
void AudioOutputDeviceAlsa::ParameterCard::OnSetValue(String s) throw (LinuxSamplerException) { |
void AudioOutputDeviceAlsa::ParameterCard::OnSetValue(String s) throw (Exception) { |
90 |
// not posssible, as parameter is fix |
// not posssible, as parameter is fix |
91 |
} |
} |
92 |
|
|
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
// *************** ParameterSampleRate *************** |
100 |
|
// * |
101 |
|
|
102 |
|
AudioOutputDeviceAlsa::ParameterSampleRate::ParameterSampleRate() : AudioOutputDevice::ParameterSampleRate::ParameterSampleRate() { |
103 |
|
} |
104 |
|
|
105 |
|
AudioOutputDeviceAlsa::ParameterSampleRate::ParameterSampleRate(String s) : AudioOutputDevice::ParameterSampleRate::ParameterSampleRate(s) { |
106 |
|
} |
107 |
|
|
108 |
|
std::map<String,DeviceCreationParameter*> AudioOutputDeviceAlsa::ParameterSampleRate::DependsAsParameters() { |
109 |
|
static ParameterCard card; |
110 |
|
std::map<String,DeviceCreationParameter*> dependencies; |
111 |
|
dependencies[card.Name()] = &card; |
112 |
|
return dependencies; |
113 |
|
} |
114 |
|
|
115 |
|
optional<int> AudioOutputDeviceAlsa::ParameterSampleRate::DefaultAsInt(std::map<String,String> Parameters) { |
116 |
|
if (!Parameters.count("CARD")) return optional<int>::nothing; |
117 |
|
|
118 |
|
// obtain information from given sound card |
119 |
|
ParameterCard card(Parameters["CARD"]); |
120 |
|
String pcm_name = "hw:" + card.ValueAsString(); |
121 |
|
snd_pcm_t* pcm_handle = NULL; |
122 |
|
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
123 |
|
snd_pcm_hw_params_t* hwparams; |
124 |
|
snd_pcm_hw_params_alloca(&hwparams); |
125 |
|
if (snd_pcm_hw_params_any(pcm_handle, hwparams) < 0) { |
126 |
|
snd_pcm_close(pcm_handle); |
127 |
|
return optional<int>::nothing; |
128 |
|
} |
129 |
|
uint rate = 44100; |
130 |
|
if (snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &rate, NULL) < 0) { |
131 |
|
snd_pcm_close(pcm_handle); |
132 |
|
return optional<int>::nothing; |
133 |
|
} |
134 |
|
snd_pcm_close(pcm_handle); |
135 |
|
return rate; |
136 |
|
} |
137 |
|
|
138 |
|
optional<int> AudioOutputDeviceAlsa::ParameterSampleRate::RangeMinAsInt(std::map<String,String> Parameters) { |
139 |
|
if (!Parameters.count("CARD")) return optional<int>::nothing; |
140 |
|
|
141 |
|
// obtain information from given sound card |
142 |
|
ParameterCard card(Parameters["CARD"]); |
143 |
|
String pcm_name = "hw:" + card.ValueAsString(); |
144 |
|
snd_pcm_t* pcm_handle = NULL; |
145 |
|
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
146 |
|
snd_pcm_hw_params_t* hwparams; |
147 |
|
snd_pcm_hw_params_alloca(&hwparams); |
148 |
|
if (snd_pcm_hw_params_any(pcm_handle, hwparams) < 0) { |
149 |
|
snd_pcm_close(pcm_handle); |
150 |
|
return optional<int>::nothing; |
151 |
|
} |
152 |
|
uint rate; |
153 |
|
if (snd_pcm_hw_params_get_rate_min(hwparams, &rate, NULL) < 0) { |
154 |
|
snd_pcm_close(pcm_handle); |
155 |
|
return optional<int>::nothing; |
156 |
|
} |
157 |
|
snd_pcm_close(pcm_handle); |
158 |
|
return rate; |
159 |
|
} |
160 |
|
|
161 |
|
optional<int> AudioOutputDeviceAlsa::ParameterSampleRate::RangeMaxAsInt(std::map<String,String> Parameters) { |
162 |
|
if (!Parameters.count("CARD")) return optional<int>::nothing; |
163 |
|
|
164 |
|
// obtain information from given sound card |
165 |
|
String pcm_name = "hw:" + Parameters["CARD"]; |
166 |
|
snd_pcm_t* pcm_handle = NULL; |
167 |
|
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
168 |
|
snd_pcm_hw_params_t* hwparams; |
169 |
|
snd_pcm_hw_params_alloca(&hwparams); |
170 |
|
if (snd_pcm_hw_params_any(pcm_handle, hwparams) < 0) { |
171 |
|
snd_pcm_close(pcm_handle); |
172 |
|
return optional<int>::nothing; |
173 |
|
} |
174 |
|
uint rate; |
175 |
|
if (snd_pcm_hw_params_get_rate_max(hwparams, &rate, NULL) < 0) { |
176 |
|
snd_pcm_close(pcm_handle); |
177 |
|
return optional<int>::nothing; |
178 |
|
} |
179 |
|
snd_pcm_close(pcm_handle); |
180 |
|
return rate; |
181 |
|
} |
182 |
|
|
183 |
|
|
184 |
|
|
185 |
|
// *************** ParameterChannels *************** |
186 |
|
// * |
187 |
|
|
188 |
|
AudioOutputDeviceAlsa::ParameterChannels::ParameterChannels() : AudioOutputDevice::ParameterChannels::ParameterChannels() { |
189 |
|
//InitWithDefault(); |
190 |
|
// could not determine default value? ... |
191 |
|
//if (ValueAsInt() == 0) SetValue(2); // ... then (try) a common value |
192 |
|
} |
193 |
|
|
194 |
|
AudioOutputDeviceAlsa::ParameterChannels::ParameterChannels(String s) : AudioOutputDevice::ParameterChannels::ParameterChannels(s) { |
195 |
|
} |
196 |
|
|
197 |
|
std::map<String,DeviceCreationParameter*> AudioOutputDeviceAlsa::ParameterChannels::DependsAsParameters() { |
198 |
|
static ParameterCard card; |
199 |
|
std::map<String,DeviceCreationParameter*> dependencies; |
200 |
|
dependencies[card.Name()] = &card; |
201 |
|
return dependencies; |
202 |
|
} |
203 |
|
|
204 |
|
optional<int> AudioOutputDeviceAlsa::ParameterChannels::DefaultAsInt(std::map<String,String> Parameters) { |
205 |
|
if (!Parameters.count("CARD")) return optional<int>::nothing; |
206 |
|
|
207 |
|
// obtain information from given sound card |
208 |
|
ParameterCard card(Parameters["CARD"]); |
209 |
|
String pcm_name = "hw:" + card.ValueAsString(); |
210 |
|
snd_pcm_t* pcm_handle = NULL; |
211 |
|
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
212 |
|
snd_pcm_hw_params_t* hwparams; |
213 |
|
snd_pcm_hw_params_alloca(&hwparams); |
214 |
|
if (snd_pcm_hw_params_any(pcm_handle, hwparams) < 0) { |
215 |
|
snd_pcm_close(pcm_handle); |
216 |
|
return optional<int>::nothing; |
217 |
|
} |
218 |
|
uint channels = 2; |
219 |
|
if (snd_pcm_hw_params_set_channels_near(pcm_handle, hwparams, &channels) < 0) { |
220 |
|
snd_pcm_close(pcm_handle); |
221 |
|
return optional<int>::nothing; |
222 |
|
} |
223 |
|
snd_pcm_close(pcm_handle); |
224 |
|
return channels; |
225 |
|
} |
226 |
|
|
227 |
|
optional<int> AudioOutputDeviceAlsa::ParameterChannels::RangeMinAsInt(std::map<String,String> Parameters) { |
228 |
|
uint channels = 1; |
229 |
|
if (!Parameters.count("CARD")) return channels; |
230 |
|
|
231 |
|
// obtain information from given sound card |
232 |
|
ParameterCard card(Parameters["CARD"]); |
233 |
|
String pcm_name = "hw:" + card.ValueAsString(); |
234 |
|
snd_pcm_t* pcm_handle = NULL; |
235 |
|
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return channels; |
236 |
|
snd_pcm_hw_params_t* hwparams; |
237 |
|
snd_pcm_hw_params_alloca(&hwparams); |
238 |
|
if (snd_pcm_hw_params_any(pcm_handle, hwparams) < 0) { |
239 |
|
snd_pcm_close(pcm_handle); |
240 |
|
return channels; |
241 |
|
} |
242 |
|
|
243 |
|
if (snd_pcm_hw_params_get_channels_min(hwparams, &channels) < 0) { |
244 |
|
snd_pcm_close(pcm_handle); |
245 |
|
return channels; |
246 |
|
} |
247 |
|
snd_pcm_close(pcm_handle); |
248 |
|
return channels; |
249 |
|
} |
250 |
|
|
251 |
|
optional<int> AudioOutputDeviceAlsa::ParameterChannels::RangeMaxAsInt(std::map<String,String> Parameters) { |
252 |
|
uint channels = 100; |
253 |
|
if (!Parameters.count("CARD")) return channels; |
254 |
|
|
255 |
|
// obtain information from given sound card |
256 |
|
String pcm_name = "hw:" + Parameters["CARD"]; |
257 |
|
snd_pcm_t* pcm_handle = NULL; |
258 |
|
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return channels; |
259 |
|
snd_pcm_hw_params_t* hwparams; |
260 |
|
snd_pcm_hw_params_alloca(&hwparams); |
261 |
|
if (snd_pcm_hw_params_any(pcm_handle, hwparams) < 0) { |
262 |
|
snd_pcm_close(pcm_handle); |
263 |
|
return channels; |
264 |
|
} |
265 |
|
|
266 |
|
if (snd_pcm_hw_params_get_channels_max(hwparams, &channels) < 0) { |
267 |
|
snd_pcm_close(pcm_handle); |
268 |
|
return channels; |
269 |
|
} |
270 |
|
snd_pcm_close(pcm_handle); |
271 |
|
return channels; |
272 |
|
} |
273 |
|
|
274 |
|
|
275 |
|
|
276 |
// *************** ParameterFragments *************** |
// *************** ParameterFragments *************** |
277 |
// * |
// * |
278 |
|
|
280 |
InitWithDefault(); |
InitWithDefault(); |
281 |
} |
} |
282 |
|
|
283 |
AudioOutputDeviceAlsa::ParameterFragments::ParameterFragments(String s) throw (LinuxSamplerException) : DeviceCreationParameterInt(s) { |
AudioOutputDeviceAlsa::ParameterFragments::ParameterFragments(String s) throw (Exception) : DeviceCreationParameterInt(s) { |
284 |
} |
} |
285 |
|
|
286 |
String AudioOutputDeviceAlsa::ParameterFragments::Description() { |
String AudioOutputDeviceAlsa::ParameterFragments::Description() { |
303 |
} |
} |
304 |
|
|
305 |
optional<int> AudioOutputDeviceAlsa::ParameterFragments::DefaultAsInt(std::map<String,String> Parameters) { |
optional<int> AudioOutputDeviceAlsa::ParameterFragments::DefaultAsInt(std::map<String,String> Parameters) { |
306 |
return 2; // until done |
if (!Parameters.count("CARD")) return optional<int>::nothing; |
307 |
|
|
308 |
|
// obtain information from given sound card |
309 |
|
ParameterCard card(Parameters["CARD"]); |
310 |
|
String pcm_name = "hw:" + card.ValueAsString(); |
311 |
|
snd_pcm_t* pcm_handle = NULL; |
312 |
|
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
313 |
|
snd_pcm_hw_params_t* hwparams; |
314 |
|
snd_pcm_hw_params_alloca(&hwparams); |
315 |
|
if (snd_pcm_hw_params_any(pcm_handle, hwparams) < 0) { |
316 |
|
snd_pcm_close(pcm_handle); |
317 |
|
return optional<int>::nothing; |
318 |
|
} |
319 |
|
uint segs = 2; |
320 |
|
if (snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &segs, NULL) < 0) { |
321 |
|
snd_pcm_close(pcm_handle); |
322 |
|
return optional<int>::nothing; |
323 |
|
} |
324 |
|
snd_pcm_close(pcm_handle); |
325 |
|
return segs; |
326 |
} |
} |
327 |
|
|
328 |
optional<int> AudioOutputDeviceAlsa::ParameterFragments::RangeMinAsInt(std::map<String,String> Parameters) { |
optional<int> AudioOutputDeviceAlsa::ParameterFragments::RangeMinAsInt(std::map<String,String> Parameters) { |
329 |
if (!Parameters.count("CARD")) return optional<int>::nothing; |
if (!Parameters.count("CARD")) return optional<int>::nothing; |
330 |
|
|
331 |
// obtain information from given sound card |
// obtain information from given sound card |
332 |
String pcm_name = "hw:" + Parameters["CARD"]; |
ParameterCard card(Parameters["CARD"]); |
333 |
|
String pcm_name = "hw:" + card.ValueAsString(); |
334 |
snd_pcm_t* pcm_handle = NULL; |
snd_pcm_t* pcm_handle = NULL; |
335 |
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
336 |
snd_pcm_hw_params_t* hwparams; |
snd_pcm_hw_params_t* hwparams; |
353 |
if (!Parameters.count("CARD")) return optional<int>::nothing; |
if (!Parameters.count("CARD")) return optional<int>::nothing; |
354 |
|
|
355 |
// obtain information from given sound card |
// obtain information from given sound card |
356 |
String pcm_name = "hw:" + Parameters["CARD"]; |
ParameterCard card(Parameters["CARD"]); |
357 |
|
String pcm_name = "hw:" + card.ValueAsString(); |
358 |
snd_pcm_t* pcm_handle = NULL; |
snd_pcm_t* pcm_handle = NULL; |
359 |
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
360 |
snd_pcm_hw_params_t* hwparams; |
snd_pcm_hw_params_t* hwparams; |
377 |
return std::vector<int>(); |
return std::vector<int>(); |
378 |
} |
} |
379 |
|
|
380 |
void AudioOutputDeviceAlsa::ParameterFragments::OnSetValue(int i) throw (LinuxSamplerException) { |
void AudioOutputDeviceAlsa::ParameterFragments::OnSetValue(int i) throw (Exception) { |
381 |
// not posssible, as parameter is fix |
// not posssible, as parameter is fix |
382 |
} |
} |
383 |
|
|
394 |
InitWithDefault(); |
InitWithDefault(); |
395 |
} |
} |
396 |
|
|
397 |
AudioOutputDeviceAlsa::ParameterFragmentSize::ParameterFragmentSize(String s) throw (LinuxSamplerException) : DeviceCreationParameterInt(s) { |
AudioOutputDeviceAlsa::ParameterFragmentSize::ParameterFragmentSize(String s) throw (Exception) : DeviceCreationParameterInt(s) { |
398 |
} |
} |
399 |
|
|
400 |
String AudioOutputDeviceAlsa::ParameterFragmentSize::Description() { |
String AudioOutputDeviceAlsa::ParameterFragmentSize::Description() { |
417 |
} |
} |
418 |
|
|
419 |
optional<int> AudioOutputDeviceAlsa::ParameterFragmentSize::DefaultAsInt(std::map<String,String> Parameters) { |
optional<int> AudioOutputDeviceAlsa::ParameterFragmentSize::DefaultAsInt(std::map<String,String> Parameters) { |
420 |
return 128; // until done |
if (!Parameters.count("CARD")) return optional<int>::nothing; |
421 |
|
|
422 |
|
// obtain information from given sound card |
423 |
|
ParameterCard card(Parameters["CARD"]); |
424 |
|
String pcm_name = "hw:" + card.ValueAsString(); |
425 |
|
snd_pcm_t* pcm_handle = NULL; |
426 |
|
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
427 |
|
snd_pcm_hw_params_t* hwparams; |
428 |
|
snd_pcm_hw_params_alloca(&hwparams); |
429 |
|
if (snd_pcm_hw_params_any(pcm_handle, hwparams) < 0) { |
430 |
|
snd_pcm_close(pcm_handle); |
431 |
|
return optional<int>::nothing; |
432 |
|
} |
433 |
|
snd_pcm_uframes_t size = 128; |
434 |
|
if (snd_pcm_hw_params_set_period_size_near(pcm_handle, hwparams, &size, NULL) < 0) { |
435 |
|
snd_pcm_close(pcm_handle); |
436 |
|
return optional<int>::nothing; |
437 |
|
} |
438 |
|
snd_pcm_close(pcm_handle); |
439 |
|
return size; |
440 |
} |
} |
441 |
|
|
442 |
optional<int> AudioOutputDeviceAlsa::ParameterFragmentSize::RangeMinAsInt(std::map<String,String> Parameters) { |
optional<int> AudioOutputDeviceAlsa::ParameterFragmentSize::RangeMinAsInt(std::map<String,String> Parameters) { |
443 |
if (!Parameters.count("CARD")) return optional<int>::nothing; |
if (!Parameters.count("CARD")) return optional<int>::nothing; |
444 |
|
|
445 |
// obtain information from given sound card |
// obtain information from given sound card |
446 |
String pcm_name = "hw:" + Parameters["CARD"]; |
ParameterCard card(Parameters["CARD"]); |
447 |
|
String pcm_name = "hw:" + card.ValueAsString(); |
448 |
snd_pcm_t* pcm_handle = NULL; |
snd_pcm_t* pcm_handle = NULL; |
449 |
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
450 |
snd_pcm_hw_params_t* hwparams; |
snd_pcm_hw_params_t* hwparams; |
467 |
if (!Parameters.count("CARD")) return optional<int>::nothing; |
if (!Parameters.count("CARD")) return optional<int>::nothing; |
468 |
|
|
469 |
// obtain information from given sound card |
// obtain information from given sound card |
470 |
String pcm_name = "hw:" + Parameters["CARD"]; |
ParameterCard card(Parameters["CARD"]); |
471 |
|
String pcm_name = "hw:" + card.ValueAsString(); |
472 |
snd_pcm_t* pcm_handle = NULL; |
snd_pcm_t* pcm_handle = NULL; |
473 |
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
if (snd_pcm_open(&pcm_handle, pcm_name.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) return optional<int>::nothing; |
474 |
snd_pcm_hw_params_t* hwparams; |
snd_pcm_hw_params_t* hwparams; |
491 |
return std::vector<int>(); |
return std::vector<int>(); |
492 |
} |
} |
493 |
|
|
494 |
void AudioOutputDeviceAlsa::ParameterFragmentSize::OnSetValue(int i) throw (LinuxSamplerException) { |
void AudioOutputDeviceAlsa::ParameterFragmentSize::OnSetValue(int i) throw (Exception) { |
495 |
// not posssible, as parameter is fix |
// not posssible, as parameter is fix |
496 |
} |
} |
497 |
|
|
586 |
|
|
587 |
/* Set number of periods. Periods used to be called fragments. */ |
/* Set number of periods. Periods used to be called fragments. */ |
588 |
if ((err = snd_pcm_hw_params_set_periods(pcm_handle, hwparams, Fragments, dir)) < 0) { |
if ((err = snd_pcm_hw_params_set_periods(pcm_handle, hwparams, Fragments, dir)) < 0) { |
589 |
throw AudioOutputException(String("Error setting number of periods: ") + snd_strerror(err)); |
throw AudioOutputException(String("Error setting number of ") + ToString(Fragments) + " periods: " + snd_strerror(err)); |
590 |
} |
} |
591 |
|
|
592 |
/* Set buffer size (in frames). The resulting latency is given by */ |
/* Set buffer size (in frames). The resulting latency is given by */ |
637 |
//StopThread(); //FIXME: commented out due to a bug in thread.cpp (StopThread() doesn't return at all) |
//StopThread(); //FIXME: commented out due to a bug in thread.cpp (StopThread() doesn't return at all) |
638 |
//dmsg(0,("OK\n")); |
//dmsg(0,("OK\n")); |
639 |
|
|
640 |
//FIXME: currently commented out due to segfault |
snd_pcm_close(pcm_handle); |
|
//snd_pcm_close(pcm_handle); |
|
641 |
|
|
642 |
if (pAlsaOutputBuffer) { |
if (pAlsaOutputBuffer) { |
643 |
//FIXME: currently commented out due to segfault |
//FIXME: currently commented out due to segfault |
735 |
} |
} |
736 |
|
|
737 |
String AudioOutputDeviceAlsa::Version() { |
String AudioOutputDeviceAlsa::Version() { |
738 |
String s = "$Revision: 1.20 $"; |
String s = "$Revision: 1.24 $"; |
739 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
740 |
} |
} |
741 |
|
|
768 |
exit(EXIT_FAILURE); |
exit(EXIT_FAILURE); |
769 |
} |
} |
770 |
} |
} |
771 |
|
// just to suppress compiler warning |
772 |
|
return EXIT_FAILURE; |
773 |
} |
} |
774 |
|
|
775 |
/** |
/** |