On Mon, 7 Nov 2011 09:37:09 -0200 Gustavo Sverzut Barbieri <[email protected]> said:
bigger fish to fry atm. > Please convert to proper eina log. I'd use one domain per backend, they are > separated modules. > > On Monday, November 7, 2011, Enlightenment SVN <[email protected]> > wrote: > > Log: > > and some more cleaning/formatting in alsa code > > > > > > > > Author: raster > > Date: 2011-11-06 21:57:46 -0800 (Sun, 06 Nov 2011) > > New Revision: 64855 > > Trac: http://trac.enlightenment.org/e/changeset/64855 > > > > Modified: > > trunk/edje/src/modules/alsa_snd_player/alsa_snd_player.c > > > > Modified: trunk/edje/src/modules/alsa_snd_player/alsa_snd_player.c > > =================================================================== > > --- trunk/edje/src/modules/alsa_snd_player/alsa_snd_player.c > 2011-11-07 05:45:00 UTC (rev 64854) > > +++ trunk/edje/src/modules/alsa_snd_player/alsa_snd_player.c > 2011-11-07 05:57:46 UTC (rev 64855) > > @@ -43,72 +43,69 @@ > > > > if ((err = snd_pcm_open(&alsa_dev, device, SND_PCM_STREAM_PLAYBACK, > 0)) < 0) > > { > > + printf("cannot open alsa playback stream (%s)\n", > snd_strerror(err)); > > goto catch_error; > > } > > - > > if ((err = snd_pcm_hw_params_malloc(&hw_params)) < 0) > > { > > + printf("cannot alloc snd hw params (%s)\n", snd_strerror(err)); > > goto catch_error; > > } > > - > > if ((err = snd_pcm_hw_params_any(alsa_dev, hw_params)) < 0) > > { > > - printf("cannot initialize hardware parameter structure (%s)\n", > snd_strerror(err)); > > + printf("cannot initialize snd hw params (%s)\n", > snd_strerror(err)); > > goto catch_error; > > } > > - > > - if ((err = snd_pcm_hw_params_set_access(alsa_dev, hw_params, > SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) > > + if ((err = snd_pcm_hw_params_set_access(alsa_dev, hw_params, > > + > SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) > > { > > printf("cannot set access type (%s)\n", snd_strerror(err)); > > goto catch_error; > > } > > - > > - if ((err = snd_pcm_hw_params_set_format(alsa_dev, hw_params, > SND_PCM_FORMAT_FLOAT)) < 0) > > + if ((err = snd_pcm_hw_params_set_format(alsa_dev, hw_params, > > + SND_PCM_FORMAT_FLOAT)) < 0) > > { > > // FIXME: handle if float format not possible > > printf("cannot set sample format (%s)\n", snd_strerror(err)); > > goto catch_error; > > } > > - > > - if ((err = snd_pcm_hw_params_set_rate_near(alsa_dev, hw_params, > &samplerate, 0)) < 0) > > + if ((err = snd_pcm_hw_params_set_rate_near(alsa_dev, hw_params, > > + &samplerate, 0)) < 0) > > { > > // FIXME: get actual sample rate and tell remix > > printf("cannot set sample rate (%s)\n", snd_strerror(err)); > > goto catch_error; > > } > > - > > if ((err = snd_pcm_hw_params_set_channels(alsa_dev, hw_params, > channels)) < 0) > > { > > printf("cannot set channel count (%s)\n", snd_strerror(err)); > > goto catch_error; > > } > > - > > - if ((err = snd_pcm_hw_params_set_buffer_size_near(alsa_dev, > hw_params, &alsa_buffer_frames)) < 0) > > + if ((err = snd_pcm_hw_params_set_buffer_size_near(alsa_dev, hw_params, > > + > &alsa_buffer_frames)) < 0) > > { > > fprintf(stderr, "cannot set buffer size (%s)\n", > snd_strerror(err)); > > goto catch_error; > > } > > - > > - if ((err = snd_pcm_hw_params_set_period_size_near(alsa_dev, > hw_params, &alsa_period_size, 0)) < 0) > > + if ((err = snd_pcm_hw_params_set_period_size_near(alsa_dev, hw_params, > > + &alsa_period_size, > 0)) < 0) > > { > > fprintf(stderr, "cannot set period size (%s)\n", > snd_strerror(err)); > > goto catch_error; > > } > > - > > if ((err = snd_pcm_hw_params(alsa_dev, hw_params)) < 0) > > { > > printf("cannot set parameters (%s)\n", snd_strerror(err)); > > goto catch_error; > > } > > - > > snd_pcm_hw_params_free(hw_params); > > if ((err = snd_pcm_prepare(alsa_dev)) < 0) > > { > > - printf("cannot prepare audio interface for use (%s)\n", > snd_strerror(err)); > > + printf("cannot prepare audio for use (%s)\n", snd_strerror(err)); > > goto catch_error; > > } > > > > - catch_error: > > +catch_error: > > if ((err < 0) && (alsa_dev != NULL)) > > { > > snd_pcm_close(alsa_dev); > > @@ -127,7 +124,8 @@ > > snd_pcm_drain(player_data->alsa_dev); > > snd_pcm_close(player_data->alsa_dev); > > } > > - player_data->alsa_dev = alsa_open(player_data->channels, > player_data->frequency); > > + player_data->alsa_dev = alsa_open(player_data->channels, > > + player_data->frequency); > > if (!player_data->alsa_dev) > > { > > remix_set_error(env, REMIX_ERROR_SYSTEM); > > @@ -152,10 +150,8 @@ > > channels = remix_get_channels(env); > > > > player_data->channels = cd_set_size(env, channels); > > - if (player_data->channels == 1) > > - player_data->stereo = 0; > > - else if (player_data->channels == 2) > > - player_data->stereo = 1; > > + if (player_data->channels == 1) player_data->stereo = 0; > > + else if (player_data->channels == 2) player_data->stereo = 1; > > > > player_data->frequency = remix_get_samplerate(env); > > alsa_player_reset_device(env, base); > > > > > > > ------------------------------------------------------------------------------ > > RSA(R) Conference 2012 > > Save $700 by Nov 18 > > Register now > > http://p.sf.net/sfu/rsa-sfdev2dev1 > > _______________________________________________ > > enlightenment-svn mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > > > > -- > Gustavo Sverzut Barbieri > http://profusion.mobi embedded systems > -------------------------------------- > MSN: [email protected] > Skype: gsbarbieri > Mobile: +55 (19) 9225-2202 > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > enlightenment-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) [email protected] ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
