Hi, <br><br> I am working on a setup which has Linux Kernel running and I have pulseaudio as Sound server. ASoc Alsa driver <i>snd_pcm_mmap</i> function returns me<br> Virtual Memory mapped to physical memory which is strictly 32 Bit Aligned.<br>
<br> When I am trying to Mix two streams with gst-launch, pa_mix
function tries to write 16Bit mixed samples to this physical memory
resulting in Bus error.<br><br> As a work around I am trying following code which is trying to write two Mixed 16Bit samples write making it a 32Bit write.<br>
src/pulsecore/sample-util.c<br><br> // *((int16_t*) data) = (int16_t) sum;<br> if(j==0) {<br> temp[0]=(int16_t) sum;<br> j=1;<br> } else { <br>
temp[1]=(int16_t) sum; <br> j=0;<br> sum = ((temp[1] << 16) | (0x0000FFFF & temp[0])); <div id=":2zl"> <br>
data = (uint8_t*) data - sizeof(int16_t);<br>
*((int32_t*) data) = (int32_t) sum;<br> data = (uint8_t*) data + sizeof(int16_t);<br> }<br><br>With this I am able to mix a <i>gst-launch</i> stream and already loaded sample from pulseaudio played with <i>play-sample</i> from <i>pacmd</i>. <br>
But not able to mix two streams with gst-launch.<br><br>I am new to Pulseaudio. May I know What is that I am missing here ??<br>Kuldeep<br></div>