lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 21 Jun 2008 01:09:10 +0200
From:	Pierre Ossman <drzeus@...eus.cx>
To:	Rene Herman <rene.herman@...access.nl>,
	Takashi Iwai <tiwai@...e.de>, Jaroslav Kysela <perex@...ex.cz>
Cc:	ALSA devel <alsa-devel@...a-project.org>, mulix@...ix.org,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [alsa-devel] looping S/PDIF data

On Sat, 21 Jun 2008 00:23:51 +0200
Rene Herman <rene.herman@...access.nl> wrote:

> On 21-06-08 00:00, Pierre Ossman wrote:
> 
> > On Fri, 20 Jun 2008 21:52:55 +0200 Rene Herman
> > <rene.herman@...access.nl> wrote:
> > 
> >> On 20-06-08 21:45, Pierre Ossman wrote:
> >>> Are there any specs on this hardware? I could play around a bit
> >>> myself, but I can't really find any documentation on the
> >>> registers.
> >> At:
> >> 
> >> ftp://ftp.alsa-project.org/pub/manuals/trident/
> >> 
> >> there's a 4D-Wave DX technical reference manual and .doc files
> >> which at first glance look useful.
> >> 
> > 
> > Ah, thanks. This is an NX, but hopefully they don't differ that much.
> 
> No idea, but if you come up with something and keep me in CC I'll test 
> it on a DX. Just acquired one on eBay a few days ago as a coincedence.
> 

Well aren't things just so much easier with a decent spec. I have this
one solved now. :)

The following patch disables both the S/PDIF output, and the DMA engine
when paused. As for Jaroslav's comment, the documentation seems to
suggest that the DMA disabled by the main code path is just for the
mixer engine, which is not used when feeding the S/PDIF directly. This
is supported by my tests as S/PDIF output is paused when using hw:0.0
(the mixer engine), but not with hw:0.2 (the raw S/PDIF).

Regarding the DX, the docs say that the DX lacks S/PDIF, so it should
be unaffected. For the SiS chip, Takashi's patch might still be needed.

--

trident: pause s/pdif output

Stop the S/PDIF DMA engine and output when the device is told to pause.
It will keep on looping the current buffer contents if this isn't done.

Signed-off-by: Pierre Ossman <drzeus@...eus.cx>
--

diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index bbcee2c..a69b420 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -1590,7 +1590,10 @@ static int snd_trident_trigger(struct snd_pcm_substream *substream,
        if (spdif_flag) {
                if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
                        outl(trident->spdif_pcm_bits, TRID_REG(trident, NX_SPCSTATUS));
-                       outb(trident->spdif_pcm_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
+                       val = trident->spdif_pcm_ctrl;
+                       if (!go)
+                               val &= ~(0x28);
+                       outb(val, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
                } else {
                        outl(trident->spdif_pcm_bits, TRID_REG(trident, SI_SPDIF_CS));
                        val = inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) | SPDIF_EN;

-- 
     -- Pierre Ossman

  WARNING: This correspondence is being monitored by the
  Swedish government. Use end-to-end encryption where
  possible.

Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ