Re: Problem with setting period time and buffer time.

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

 



Ignacy Kasperowicz wrote:
> I need to set proper period time for my application. What I need my
> code to do is to play sine wave with set frequency and for exact time
> of 1/1200 s (something about 834 us).

The period time specifies after which interval the sound hardware issues
an interrupt, i.e., after which time your application gets waken up when
it is waiting for the sound buffer to become non-empty.  This has
nothing to do with the actual sounds that are being played.

You are not required to write data in period-sized chunks, so you don't
actually need to care about the period time.

> When I try to set period time for 834 us I've got this error:
> Unable to set period time 834 for playback: Invalid argument .
> Honestly speaking  I've got this error message no matter what value I
> try to set).

Period (and buffer) times are hardware dependent; you cannot be sure
that any specific value is supported by the sound card.

(And you're calling snd_pcm_hw_params_set_period_time_max() which would
allow the driver to choose any lower value.)


HTH
Clemens
_______________________________________________
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