Changeset 191
- Timestamp:
- 01/16/08 13:29:17 (4 years ago)
- Location:
- fm_server/trunk/src
- Files:
-
- 4 modified
-
fm_output_alsa.c (modified) (5 diffs)
-
fm_output_alsa.h (modified) (2 diffs)
-
fm_output_jack.c (modified) (7 diffs)
-
fm_output_jack.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fm_server/trunk/src/fm_output_alsa.c
r149 r191 1 1 /* 2 2 * FreeMix - sound server 3 * Copyright (C) 2006 Alberto Botti <alberto.botti@yoda2000.net>3 * Copyright (C) 2006-2008 Alberto Botti <alberto.botti@yoda2000.net> 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify … … 16 16 * along with this program; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * 19 * 20 * fm_output_alsa.c - Output element for the JACK audio subsystem 21 * 22 * (a lot of this code comes from AlsaPlayer and TerminatorX) 23 * 18 24 */ 19 25 20 21 /* Most of this stuff came from AlsaPlayer. */22 26 23 27 #include <glib.h> … … 38 42 39 43 #define ALSA_DEFAULT_DEVICE "default" 44 //#define ALSA_DEFAULT_DEVICE "surround40" 40 45 #define ALSA_DEFAULT_SAMPLE_RATE 44100 46 //#define ALSA_DEFAULT_SAMPLE_RATE 48000 41 47 #define ALSA_DEFAULT_BUFFER_TIME 22000 42 48 #define ALSA_DEFAULT_PERIOD_TIME 10000 … … 288 294 } 289 295 290 output->sample_rate = 44100; 296 // output->sample_rate = 44100; 297 output->sample_rate = ALSA_DEFAULT_SAMPLE_RATE; 291 298 err = snd_pcm_hw_params_set_rate_near (output_alsa->sound_handle, 292 299 output_alsa->hwparams, … … 437 444 //g_print("asking for %d samples\n", output_alsa->buffer_size_samples); 438 445 FM_BUFFER_REQUESTED(output_alsa->main_buffer) = output_alsa->buffer_size_samples; 439 fm_element_get_buffer_from_src(element, output_alsa->main_buffer );440 441 FmSync *sync = fm_element_pipeline_get_sync_info (element);442 fm_sync_update_cycle (sync); 446 fm_element_get_buffer_from_src(element, output_alsa->main_buffer, NULL); 447 448 /* FmSync *sync = fm_element_pipeline_get_sync_info (element); 449 fm_sync_update_cycle (sync); FIXME: obsoleted */ 443 450 444 451 src_float_to_short_array_stereo (output_alsa->main_buffer->channel_data[0], -
fm_server/trunk/src/fm_output_alsa.h
r151 r191 1 1 /* 2 2 * FreeMix - sound server 3 * Copyright (C) 2006 Alberto Botti <alberto.botti@yoda2000.net>3 * Copyright (C) 2006-2008 Alberto Botti <alberto.botti@yoda2000.net> 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify … … 16 16 * along with this program; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * 19 * 20 * fm_output_alsa.h - Output element for the JACK audio subsystem 21 * 22 * (a lot of this code comes from AlsaPlayer and TerminatorX) 23 * 18 24 */ 19 25 -
fm_server/trunk/src/fm_output_jack.c
r181 r191 1 /* 2 * FreeMix - sound server 3 * Copyright (C) 2008 Alberto Botti <alberto.botti@yoda2000.net> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * 19 * 20 * fm_output_jack.c - Output element for the JACK audio subsystem 21 * 22 * (a lot of this code comes from the JACK programming examples) 23 * 24 */ 25 26 1 27 #include <glib.h> 2 28 #include <glib-object.h> … … 139 165 FmOutputJack *output_jack = FM_OUTPUT_JACK (element); 140 166 167 if (!output_jack->client) { 168 g_warning ("Can't activate FmOutputJack - not initialized\n"); 169 return FALSE; 170 } 171 141 172 g_print ("Activating FmOutputJack\n"); 173 142 174 143 175 /* Creating the ports... */ … … 184 216 jack_start (FmOutput *output) 185 217 { 186 FmOutputJack *output_jack = FM_OUTPUT_JACK(output); 218 FmElement *element = FM_ELEMENT (output); 219 FmOutputJack *output_jack = FM_OUTPUT_JACK (output); 220 221 g_return_val_if_fail (element->active, FALSE); 187 222 188 223 if (jack_activate(output_jack->client) == 0) { … … 199 234 jack_stop (FmOutput *output) 200 235 { 201 FmOutputJack *output_jack = FM_OUTPUT_JACK(output); 236 FmElement *element = FM_ELEMENT (output); 237 FmOutputJack *output_jack = FM_OUTPUT_JACK (output); 238 239 g_return_val_if_fail (element->active, FALSE); 202 240 203 241 if (jack_deactivate(output_jack->client) == 0) { … … 214 252 jack_connect_to_hw_ports (FmOutputJack *output_jack) 215 253 { 216 /* FIXME: check if activated */ 254 FmElement *element = FM_ELEMENT (output_jack); 255 g_return_if_fail (element->active); 217 256 218 257 const char **ports = jack_get_ports (output_jack->client, … … 293 332 294 333 FM_BUFFER_REQUESTED(output_jack->main_buffer) = nframes; 295 fm_element_get_buffer_from_src(element, output_jack->main_buffer );334 fm_element_get_buffer_from_src(element, output_jack->main_buffer, NULL); 296 335 297 336 memcpy(left, FM_BUFFER_CHANNEL_DATA(output_jack->main_buffer, 0), … … 300 339 nframes * sizeof(jack_default_audio_sample_t)); 301 340 302 FmSync *sync = fm_element_pipeline_get_sync_info (element);303 fm_sync_update_cycle (sync); 341 /* FmSync *sync = fm_element_pipeline_get_sync_info (element); 342 fm_sync_update_cycle (sync); FIXME: obsoleted */ 304 343 305 344 return 0; -
fm_server/trunk/src/fm_output_jack.h
r151 r191 1 1 /* 2 2 * FreeMix - sound server 3 * Copyright (C) 200 6Alberto Botti <alberto.botti@yoda2000.net>3 * Copyright (C) 2008 Alberto Botti <alberto.botti@yoda2000.net> 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify … … 16 16 * along with this program; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * 19 * 20 * fm_output_jack.h - Output element for the JACK audio subsystem 21 * 22 * (a lot of this code comes from the JACK programming examples) 23 * 18 24 */ 19 25
