All of lore.kernel.org
 help / color / mirror / Atom feed
* PCM plugin transfer callback size issue
@ 2008-05-13  0:39 Ben C
  0 siblings, 0 replies; only message in thread
From: Ben C @ 2008-05-13  0:39 UTC (permalink / raw)
  To: alsa-devel

Hello,

I'm writing a PCM external filter type plugin. However, due to the processing I must handle fixed size each time. I can only handle 256 samples at a time. In the transfer callback, there would be no problem if the size is say 1024 each time, I just loop it. But the problem is that sometimes it comes back with other numbers.

One instance, it came back with 1114. So I change my code to ONLY process 1024, and return 1024 at the conclusion of the transfer callback, to see if ALSA is smart enough to handle the fact that I didn't process everything. Well, ALSA is smart enough, except the next transfer call, it only sent me the 90 samples that I didn't process. But since I can't process 90 samples, it doesn't help me either; I needed ALSA to combine that 90 samples with the next block of incoming PCM data.

My questions:
1) Is there some sort of configuration I can do to constraint the number of samples?

2) I could even manage the extra samples myself with an internal buffer to combine with the next block. But how do I tell ALSA to give me the next block? If I only processed 1024 samples out of 1114, I could store the 90 samples for next time, but if I lie to ALSA and say I did all 1114, wouldn't it try to process 1114 samples instead of 1024?

Thanks,
Ben



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-13  0:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-13  0:39 PCM plugin transfer callback size issue Ben C

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.