All of lore.kernel.org
 help / color / mirror / Atom feed
* hw_params function and OSS emulation
@ 2007-08-21 18:15 Timur Tabi
  2007-08-21 23:42 ` Trent Piepho
  2007-08-22  9:17 ` Takashi Iwai
  0 siblings, 2 replies; 21+ messages in thread
From: Timur Tabi @ 2007-08-21 18:15 UTC (permalink / raw)
  To: alsa-devel

I'm working on an ASoC driver, and I noticed that with OSS emulation enabled, 
my snd_pcm_ops.hw_params and and snd_pcm_ops.hw_free are called multiple times 
when an OSS driver uses the OSS emulation.  In my case, .hw_params is called 
*four* times, each time with a different DMA buffer size and number of periods.

The problem is that my driver allocates a DMA buffer in my .hw_params 
function.  For now, I have it deallocate the buffers at the top of the 
function and then allocate new ones based on the new hw_params values.

This is really annoying.  So I have a few questions:

1) Is there any way this can be fixed?  Can't the OSS emulation code figure 
out what it needs and wait until it's done before it calls .hw_params?

As a solution to the DMA buffer deallocate/reallocate hack I'm using, would it 
be okay to move the actual allocations to snd_pcm_ops.prepare()?  My 
.hw_params function will collect the relevant data and keep them in some 
private structure.  Then when .prepare() is called, I do the actual buffer 
allocation.

2) Can I assume that .prepare() is called only once?

3) Can I assume that .hw_params() is never called after .prepare() is called?

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2007-08-23 22:17 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-21 18:15 hw_params function and OSS emulation Timur Tabi
2007-08-21 23:42 ` Trent Piepho
2007-08-22  9:17 ` Takashi Iwai
2007-08-22 14:28   ` Timur Tabi
2007-08-22 14:59     ` Takashi Iwai
2007-08-22 15:02       ` Timur Tabi
2007-08-22 15:39         ` Takashi Iwai
2007-08-22 15:48           ` Timur Tabi
2007-08-22 15:57             ` Takashi Iwai
2007-08-23 17:36               ` Timur Tabi
2007-08-23 17:40                 ` Takashi Iwai
2007-08-23 18:43                   ` Timur Tabi
2007-08-23 19:01                     ` Takashi Iwai
2007-08-23 19:13                       ` Timur Tabi
2007-08-23 19:35                         ` Takashi Iwai
2007-08-23 22:17                       ` Trent Piepho
2007-08-22 20:25       ` Trent Piepho
2007-08-22 21:05         ` Takashi Iwai
2007-08-22 21:08           ` Timur Tabi
2007-08-22 21:57             ` Takashi Iwai
2007-08-22 22:08               ` Timur Tabi

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.