period_size and .asoundrc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everybody,
I'm writing a little software that play a tone on a pcm device.
In the hw param initialization I'm hardcoding the "periods" and "period_size" values:

                unsigned int periods = 4;
                if (snd_pcm_hw_params_set_periods_near(buzzer_device.pcm_handle, buzzer_device.hwparams, &periods, 0) < 0) {
                               fprintf(stderr, "Error setting periods.\n");
                               return 1;
                }
                ///* set the period time */
                period_size = 8192;
                err = snd_pcm_hw_params_set_period_size_near(buzzer_device.pcm_handle, buzzer_device.hwparams, &period_size, 0);
                if (err < 0) {
                               printf("Unable to get period size for playback: %s\n", snd_strerror(err));
                               return err;
                }

I'd like to read this parameter form the .asoundrc file, so I'm wondering if there were API that does this task.

Thanks

Matteo Canella

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux