<div dir="ltr"><div>Hello,<br></div>I'm writing a driver for a device which clears the BAR DMA buffer if I send the Start IO command to it. I'm not sure how to workaround this issue.<div><br></div><div>I have got the driver working to some extent by moving the Start IO command code to the open() callback instead of the trigger(SNDRV_PCM_TRIGGER_START) however that's obviously a hack and causes issues (the first ~0.1s of audio is lost).</div><div><br></div><div>I also tried to memcpy() the memory to a temporary buffer in the SNDRV_PCM_TRIGGER_START trigger, however that turned out to be a performance bottleneck (it took about ~300ms to copy that memory back, which is ~the period size, probably related).</div><div><br></div><div>I'm also aware that using some sort of a copy buffer could work, but that sounds like a performance waste as it's not needed after the playback is started.</div><div><br></div><div>I tried to search for existing kernel drivers utilizing a similar mechanism (there's the SNDRV_PCM_INFO_DOUBLE flag after all), but could not find any results that made sense.</div><div><br></div><div>Any help is appreciated.</div><div><br></div><div>Thank you,</div><div>Paul Pawlowski</div></div>