Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
UMeier
Posts: 20
Registered: ‎04-27-2011
My Device: Z10

AudioLoopBackSample

Hello!

 

I've programmed an App for the PlayBook which does some heavy sound-analysis using asoundlib.h. Therefore, I need a rather large sample size at a rate of 44.1kHz. Using the SDK for the PlayBook, everything worked, but when i tried to port it to BB10, I stumbled upon some Problems.

I've testet AduiLoopBackSample as well and these problems occur there as well ( everyone can download the sample at https://github.com/blackberry/Core-Native-Community-Samples/tree/master/AudioLoopBackSample ).

 

When setting VOIP_SAMPLE_RATE = 44100; (line 62) in audiopcm.cpp, the outcome of the method capture() (line 430ff) differs, depending on what is set for PREFERRED_FRAME_SIZE (line 61).

  1. Everything up to a value of 2824 works as expected, the fragment-size is about the same as PREFERRED_FRAME_SIZE (line 333)
  2. Above a value of 2824 - until a value of 3527 - the method snd_pcm_plugin_read() (line 449) returns an error-message: -22 : -EINVAL: Partial block buffering is disabled, but the size isn't the full block size. [See: http://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.neutrino.audio/topic/libs/snd_... ]
  3. For values 3528 and above, everything works again, but the the fragment-size (line 333) is always set to 2824, independent of what is set for PREFERRED_FRAME_SIZE.

 

Now, I need more than 1412 samples (=2824/2, because of low- and high-bit) to assure a certain degree of accuracy. But as it is, I can't get more than this number of samples because the method snd_pcm_plugin_read() either returns an error or the fragment-size is fixed to 2824.

 

About the error: snd_pcm_plugin_read() should already enable Partial block buffering (as I've understood it), but I also used snd_pcm_plugin_set_enable(pcm_handle, PLUGIN_BUFFER_PARTIAL_BLOCKS) to be sure.

 

Has anyone further inside into this issue an can direct me to someone, who has?

 

Both my code as well as AudioLoopBackSample where tested on a Dev Alpha A and B device.

 

Kind regards,

Uwe :Balloon:

Developer
UMeier
Posts: 20
Registered: ‎04-27-2011
My Device: Z10

Re: AudioLoopBackSample

Is there really nobody with infos about that issue?