All of lore.kernel.org
 help / color / mirror / Atom feed
* Stereo or mono - how to tell, what to do?
@ 2006-03-12 20:14 Adrian McMenamin
  2006-03-12 21:56 ` James Courtier-Dutton
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian McMenamin @ 2006-03-12 20:14 UTC (permalink / raw)
  To: alsa-devel

I want to add the capacity to play stereo samples to my Dreamcast sound
driver.

The hardware does not support interleaved samples and in the OSS driver
I simply separated out the input stream into two different buffers and
transferred them separately into the hardware's memory. Can I do the
same with ALSA or is there some middle layer magic I should be aware of?

And how can my driver tell if the incoming samples are stereo or not. In
OSS this was all done through the SNDCTL_DSP_STEREO and
SNDCTL_DSP_CHANNELS ioctls, how do I do it in ALSA (I need to inform the
hardware to expect two channels and not one).

Adrian




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

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

* Re: Stereo or mono - how to tell, what to do?
  2006-03-12 20:14 Stereo or mono - how to tell, what to do? Adrian McMenamin
@ 2006-03-12 21:56 ` James Courtier-Dutton
  0 siblings, 0 replies; 2+ messages in thread
From: James Courtier-Dutton @ 2006-03-12 21:56 UTC (permalink / raw)
  To: Adrian McMenamin; +Cc: alsa-devel

Adrian McMenamin wrote:
> I want to add the capacity to play stereo samples to my Dreamcast sound
> driver.
>
> The hardware does not support interleaved samples and in the OSS driver
> I simply separated out the input stream into two different buffers and
> transferred them separately into the hardware's memory. Can I do the
> same with ALSA or is there some middle layer magic I should be aware of?
>   
You can get alsa-lib to send either interleaved or non-interleaved 
samples to your driver.
You just tell alsa-lib which format you like, and set the 
snd_pcm_hardware .info parameter.
I have not looked into how alsa-lib informs the driver of the 
non-interleaved nature of the samples. You might have to look into that 
yourself.
Probably something in the snd_pcm_runtime structure.
> And how can my driver tell if the incoming samples are stereo or not. In
> OSS this was all done through the SNDCTL_DSP_STEREO and
> SNDCTL_DSP_CHANNELS ioctls, how do I do it in ALSA (I need to inform the
> hardware to expect two channels and not one).
>
> Adrian
>
>   
You get all that information from the prepare() callback.
The parameter passed is struct snd_pcm_substream *substream.
substream->runtime->rate
substream->runtime->format
substream->runtime->channels
substream->runtime->buffer_size
substream->runtime->period_size
substream->runtime->periods





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

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

end of thread, other threads:[~2006-03-12 21:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-12 20:14 Stereo or mono - how to tell, what to do? Adrian McMenamin
2006-03-12 21:56 ` James Courtier-Dutton

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.