PCM plugin transfer callback size issue

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

 



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