audio - ALSA - Which channel is sampled first -


i have 2 channels of analog audio (left , right) connected alsa device , let soundcard sampling.

the result 1 digital stream of interleaved audio. problem occurs when try play them. once these channels swapped , once not. seems depends on channel sampled first or on time when playing begun.

to clarify situation:

i have 3 sound cards: cards , b sampling analog audio, send 1 digitalized audio channel each card c, thru lan. example send left channel card card c , simultaneously send right channel card b card c.

on card c, reasemble data packets interleaved stream. take first sample (which card a) , sample card b. way can play buffer interleaved audio. card c playing data buffer. given soundcard starts playing samples left channel, should have no problem. swaps channels , can't figure out why.

i'm controlling arm processor.

is there way can access alsa's internal frame buffer or how in stream played first ?

it leads question, how example in wav format player knows part of data left , right channel ?

wav rather easy: channels stored in lsb-order in appear in dwchannelmask, (a bitmask listing of speakers present). if bitmask 0x3, bits 0 , 1 set, , you'll have 2 audio streams in wav: first left (bitmask 0x1) , second right (bitmask 0x2). if bitmask 0xb, there third audio stream, bass channel (0x8).

alsa linux audio , that's not designed. there's no such thing the internal alsa streambuffer.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

python - Django-cities exits with "killed" -

python - How to get a widget position inside it's layout in Kivy? -