OpenQNX :: The QNX Community Portal

Oct 06, 2008 - 06:40 PM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 50 unlogged users and 1 registered user online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Mike Gorchak
Post subject: 6.3.2's io-audio broken again  PostPosted: Nov 15, 2007 - 07:59 AM
Guest





Hello, All!

Somewhere between 6.3.0SP2 and 6.3.2 releases io-audio (or libasound.so)
became broken again.
My audio driver spreads, that it can support large frag sizes, since it
supports 6 channels with 32 bits per sample:

PCM capabilities looks like:

drv->pcm_capture_caps.min_fragsize = 256;
drv->pcm_capture_caps.max_fragsize = 128 * 1024;
drv->pcm_capture_caps.max_dma_size = 32 * 128 * 1024;

When I trying to play 8 bit, mono, 11025Hz audio stream the following occurs
(I'm using plugins while playing this audio stream in QSA to reconstitute
the source stream to supported stream parameters, which are 16 bit, stereo,
48000Khz minimum):

When application requests frag_size=2048, maximum frags=8 and plugin returns
to application that it has frags=7, frag_size=2048, while driver has been
called with the following arguments:

Nov 15 09:17:32 1 7 0 config->dmabuf.size=249648
Nov 15 09:17:32 1 7 0 config->mode.block.frag_size=35664
Nov 15 09:17:32 1 7 0 config->mode.block.frags_total=7

Sound is played and all is ok.

When application requests frag_size=32768, maximum frags=8 and plugin
returns to application that it has frags=2, frag_size=7526, while driver has
been requested to allocate buffers with the following parameters:

Nov 15 09:15:08 1 7 0 config->dmabuf.size=262144
Nov 15 09:15:08 1 7 0 config->mode.block.frag_size=131072
Nov 15 09:15:08 1 7 0 config->mode.block.frags_total=2

And nothing works. After that.snd_pcm_plugin_write() always returns UNDERRUN
condition during writes. And this is understandable, because written data
count is much smaller than the frag size. Why this happens and how to avoid
this ?

Looks like io-audio or libasound trying to fix dma buffer size to 256Kb now
and this is the root of this problem. This look like someone put hardware
dma buffer size limitation checks (which is common for many hardware -
limitation for the dma buffer size to 65536 samples, which is 256Kb in case
of 16 bit stereo mode) into the high level API code instead of the driver
code.

Anyway after the plugin_setup call, application must obtain _correct_ frag
sizes !

Thanks for attention.

With best regards, Mike Gorchak. E-mail: mike@malva.ua
 
   
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.