[alsa-devel] DSD: Playing silence before and after actual audio data

Alexander E. Patrakov patrakov at gmail.com
Thu Oct 15 15:13:54 CEST 2015


15.10.2015 18:01, Martin Pietryka wrote:
> Hi guys,
>
> I'm trying to figure out the best way to insert ~40ms worth of silence
> pattern before and after playing back DSD data.
>
> There seems to be support inside ALSA for a DSD silence pattern, but as
> far as I have seen it's only used when an underrun might occur
> (silence_threshold, silence_size).
>
> Is there some possibility inside ALSA to basically insert silence before
> and after playback, or how hard would it be to implement something like
> this? I have looked a bit for myself and for me it seems that the
> modifications needed inside ALSA to achieve this feature are
> substantial, but of course I also might have missed something.

So you already have some sound data that you want to play, and you know 
it is DSD. So, look at the silence pattern (which is 
0x6969696969696969ULL), and copy an appropriate number of its 
repetitions before and after your sound data. The result will be a valid 
DSD stream that contains silence, your data, and then silence again. 
Then play it as usual, i.e. no explicit ALSA support is needed.

-- 
Alexander E. Patrakov


More information about the Alsa-devel mailing list