All of lore.kernel.org
 help / color / mirror / Atom feed
* PCM application question: readn
@ 2002-07-03  8:21 Bruce Paterson
  2002-07-03  9:02 ` Jaroslav Kysela
  0 siblings, 1 reply; 2+ messages in thread
From: Bruce Paterson @ 2002-07-03  8:21 UTC (permalink / raw)
  To: alsa-devel


Hi alsa people,

OK, this is probably in the dumb green user category of question but we
are all there at some
time or other !  Nothing in the archives seems to help.

Background:
I am writing a simple linux application which uses a professional
multichannel soundcard: envy24
Originally parts of this program were done under windows, but things
were getting real messy with
the standard windows API when you need more than 2 channels capture.
Alsa 0.9 seems to fit the
bill perfectly, allowing 96000 sample rate on 4 channels with 24 bit
sampling, and even in & out
sync ! 

Where I'm at:
alsa 0.9.0rc2 has been installed sucessfully. aplay works, evny24control
(wonderful!!) works.
Also, if I only playback from my application, it works (as long as I use
plughw:0.0)

Problem 1:
When I try to record I get segmentation fault in
"snd_pcm_route_convert1_one" called indirectly
by my "snd_pcm_readn" call. I would prefer to use readn rather than
readi since it suits my
application better. The capture is opened in blocking mode (whereas my
playback was opened in
non-blocking mode). 
It is possible I have misinterpreted the parameters for "snd_pcm_readn",
but the API doco doesn't
describe "void **bufs" very well. I have assumed I am meant to pass a
pointer to an array of
pointers (array size = #channels configured), which in turn point to
buffers (one for each channel)
each which must be at least as big as ("size" *
#bytes-needed-to-store-sample) bytes. In this current
test I am using 16bit samples, but I'm using the "snd_pcm_format_width"
anyway. I have assumed the
buffers for the channels do not need to be contigueous with each other.
Is this correct ?

Problem 2:
When I try device "hw:0.0" the very first hardware parameter set fails
with unavailable. It's
 snd_pcm_hw_params_set_access(handle, params,
SND_PCM_ACCESS_RW_NONINTERLEAVED); that fails.
I have seen other posts talking about using non-interleaved frames....
surely the ice1712
supports this ??


-- 
Cheers,
Bruce
-------------------------------------------------------------------
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please
notify the system manager.

    /\\\/\\\/\\\    /   /      Bruce Paterson          
   /  \\\ \\\ \\\  /   /    Senior Design Engineer
  /   /\\\/\\\/\\\/   /   87 Peters Ave, Mulgrave, Vic, 3170
 /   /  \\\ \\\ \\\  /  PO Box 4112, Mulgrave, Vic, 3170, Australia
/   /    \\\/\\\ \\\/   Ph: +61 3 8561 4232   Fax: +61 3 9560 9055
      Tele-IP Ltd.      Email: bruce@tele-ip.com    Icq: #32015991
                        WWW:   http://www.tele-ip.com       VK3TJN
-------------------------------------------------------------------


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
No, I will not fix your computer.
http://thinkgeek.com/sf

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

* Re: PCM application question: readn
  2002-07-03  8:21 PCM application question: readn Bruce Paterson
@ 2002-07-03  9:02 ` Jaroslav Kysela
  0 siblings, 0 replies; 2+ messages in thread
From: Jaroslav Kysela @ 2002-07-03  9:02 UTC (permalink / raw)
  To: Bruce Paterson; +Cc: alsa-devel@lists.sourceforge.net

On Wed, 3 Jul 2002, Bruce Paterson wrote:

> 
> Hi alsa people,
> 
> OK, this is probably in the dumb green user category of question but we
> are all there at some
> time or other !  Nothing in the archives seems to help.
> 
> Background:
> I am writing a simple linux application which uses a professional
> multichannel soundcard: envy24
> Originally parts of this program were done under windows, but things
> were getting real messy with
> the standard windows API when you need more than 2 channels capture.
> Alsa 0.9 seems to fit the
> bill perfectly, allowing 96000 sample rate on 4 channels with 24 bit
> sampling, and even in & out
> sync ! 
> 
> Where I'm at:
> alsa 0.9.0rc2 has been installed sucessfully. aplay works, evny24control
> (wonderful!!) works.
> Also, if I only playback from my application, it works (as long as I use
> plughw:0.0)
> 
> Problem 1:
> When I try to record I get segmentation fault in
> "snd_pcm_route_convert1_one" called indirectly
> by my "snd_pcm_readn" call. I would prefer to use readn rather than
> readi since it suits my
> application better. The capture is opened in blocking mode (whereas my
> playback was opened in
> non-blocking mode). 
> It is possible I have misinterpreted the parameters for "snd_pcm_readn",
> but the API doco doesn't
> describe "void **bufs" very well. I have assumed I am meant to pass a
> pointer to an array of
> pointers (array size = #channels configured), which in turn point to
> buffers (one for each channel)
> each which must be at least as big as ("size" *
> #bytes-needed-to-store-sample) bytes. In this current
> test I am using 16bit samples, but I'm using the "snd_pcm_format_width"
> anyway. I have assumed the
> buffers for the channels do not need to be contigueous with each other.
> Is this correct ?
> 
> Problem 2:
> When I try device "hw:0.0" the very first hardware parameter set fails
> with unavailable. It's
>  snd_pcm_hw_params_set_access(handle, params,
> SND_PCM_ACCESS_RW_NONINTERLEAVED); that fails.
> I have seen other posts talking about using non-interleaved frames....
> surely the ice1712
> supports this ??

Not in hardware. Non-interleaved access is emulated. Anyway, if you send 
me a short code showing the problem, I'll try to fix the problem.

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project  http://www.alsa-project.org
SuSE Linux    http://www.suse.com



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
No, I will not fix your computer.
http://thinkgeek.com/sf

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

end of thread, other threads:[~2002-07-03  9:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-03  8:21 PCM application question: readn Bruce Paterson
2002-07-03  9:02 ` Jaroslav Kysela

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.