All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Pietryka <martin.pietryka@streamunlimited.com>
To: alsa-devel@alsa-project.org
Subject: Hot to properly output DSD silence pattern before/after playback?
Date: Wed, 21 Oct 2015 15:46:33 +0200	[thread overview]
Message-ID: <56279739.6050409@streamunlimited.com> (raw)

Hello Guys,

I have already asked the question last week, but the thing got a bit 
more complicated.

So we need to achieve the following when playing back DSD audio:

1.) Start outputting the DSD silence pattern (0x69) for ~40ms
2.) After ~10ms unset a mute GPIO
3.) Start outputting DSD data after silence is over

and after DSD playback is finished a similar procedure:

1.) Start outputting the DSD silence pattern (0x69) for ~40ms
2.) After ~10ms set a mute GPIO
3.) (let silence run out)

In addition to that, we also have the need to toggle the mute GPIO from 
an appropriate place at an appropriate time, the timing does not have to 
be exact but we need to be sure that the actual hardware already started 
outputting the silence samples.

We have figured out three possibilities where to add the silence:
1.) Inside our application:
     We are using GStreamer and for various reasons we currently can't 
do it here without a significant effort.

2.) Inside alsa-lib:
     The idea here is to inject a snd_pcm_writei() call on the first 
call of snd_pcm_writei() and inside snd_pcm_drain(). This is really 
ugly, but doable, I already have a simple proof of concept working. But 
here I think the GPIO stuff will get really complicated.

3.) Inside the kernel:
     Modify the soc driver to output the silence pattern before and 
after playback.

So what do you guys think would be the best approach to this problem, 
are there any other possibilities?

I would imagine someone has had to do something similar before, but I 
couldn't find anything with Google, so if you know something regarding 
this, please let me know.

Thanks,

Martin

                 reply	other threads:[~2015-10-21 13:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56279739.6050409@streamunlimited.com \
    --to=martin.pietryka@streamunlimited.com \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.