<div dir="ltr">I am trying to modify the module-alsa-sink module to process the audio data. <br><br>Within: static int mmap_write(struct userdata *u) {}<br><br>I am calling a routine that just sets the audio data to 0 so I know that I can actually affect the data. I am doing this like so:<br>
<br><br><div style="text-align: left;"><blockquote> /* Check these are multiples of 8 bit */<br> pa_assert((areas[0].first & 7) == 0);<br> pa_assert((areas[0].step & 7)== 0);<br><br> /* We assume a single interleaved memory buffer */<br>
pa_assert((areas[0].first >> 3) == 0);<br> pa_assert((areas[0].step >> 3) == u->frame_size);<br> <br> p = (uint8_t*) areas[0].addr + (offset * u->frame_size);<br> <br>
<br> zeroData((uint8_t*) p, frames * u->frame_size); <br> <br> <br> chunk.memblock = pa_memblock_new_fixed(u->core->mempool, p, frames * u->frame_size, 1);<br>
chunk.length = pa_memblock_get_length(chunk.memblock);<br> chunk.index = 0;<br><br> pa_sink_render_into_full(u->sink, &chunk);<br><br></blockquote></div><br>here is my function for zeroData():<br>
<br>static void biquadProcess(uint8_t *p, int length)<br>{<br> int j;<br><br> for(j = 0; j < length; j++)<br> *p++ = 0;<br>}<br><br><br><br>This does not seem to affect the audio at all. I don't know what I am doing wrong. Also is there a way to access the data through chunk.memblock? chunk is of type pa_memchunk.<br>
<br>Thanks<br><br>
</div>