Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Question Regarding Simple ALSA Stereo Output
@ 2004-06-23 13:57 Bill Kapralos
  2004-06-23 14:45 ` Clemens Ladisch
  2004-06-23 15:44 ` James Courtier-Dutton
  0 siblings, 2 replies; 8+ messages in thread
From: Bill Kapralos @ 2004-06-23 13:57 UTC (permalink / raw)
  To: alsa-devel

Hello

I am failry new to Linux programming and recently started using the ALSA
API for some software I am writing involving the output of sound to a apir
of headphones. Using (and slightly modifying) a simple example found on
the ALSA web site (Matthias Nagorni, "ALSA 0.9.0 Howto") I am able to
open the auduio port and send data to it however,  I am having some
difficulty with the output of stereo data.  In particular, I am
initializing the device for interleaved output (e.g.
SND_PCM_ACCESS_RW_INTERLEAVED) and specifying two channels (at 16 bit
little endian format).  I then have some stereo data (which I "create"
which is in interleaved format (e.g. first word (2-byte sample) is for the
left channel, second for the right channel, third for the left etc... but
when i do send this data to the audio device (using the "writei" function,
I do not get the desired result.  It appears as if it is simply outputting
the data assuming one channel e.g. the same signal is heard in both the
left and right ear even when I have deliberately made the signals
different (e.g. introduced a considerable delay to one channel etc.).
Furthermore, when I explicitly set all left channel samples to "0" and the
right channel samples to "non-zero", no sound is heard at all - it seems
as if only the left channel data is being output which is of course all
zero.  In contrast, if i set all the right channel samples to zero and the
left channel samples to non-zero, the sound is heard.

I am really confused with this problem! It appears as if I cannot control
what is sent to the left/right channel! Am i completely overlooking
something here? I am really puzzled by what I initially thought of as a
trivial matter!!!

Any help would be greatly appreciated! Thank You in advance!

Please reply to: billkATcs.yorku.ca (of course replace "AT" with "@".

Regards,


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com

^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <Pine.GSO.4.58.0406231129100.6839@blue.cs.yorku.ca>]
[parent not found: <E1Bd8zp-00028B-03@sc8-sf-list2.sourceforge.net>]

end of thread, other threads:[~2004-06-23 22:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-23 13:57 Question Regarding Simple ALSA Stereo Output Bill Kapralos
2004-06-23 14:45 ` Clemens Ladisch
2004-06-23 15:04   ` Bill Kapralos
2004-06-23 15:18     ` Clemens Ladisch
2004-06-23 16:50     ` James Courtier-Dutton
2004-06-23 15:44 ` James Courtier-Dutton
     [not found] <Pine.GSO.4.58.0406231129100.6839@blue.cs.yorku.ca>
2004-06-23 16:10 ` Clemens Ladisch
     [not found] <E1Bd8zp-00028B-03@sc8-sf-list2.sourceforge.net>
2004-06-23 22:11 ` Tom Watson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox