Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Volume control of SPDIF (digital) output



I have got a lot of request about the modifications of the Soundblaster 1024
Live.
I have put a picture of the modification and more details on this webpage:

http://www.geocities.com/ralfbauer/

Ralf.

-----Original Message-----
From: Ralf Bauer 
Sent: Thursday, December 27, 2001 18:42
To: vdr@linuxtv.org
Subject: Volume control of SPDIF (digital) output


A few days ago there was a question here on the list about controlling the
volume of the SPDIF output with VDR, just like it is done for the analogue
output. I have not seen an answer to this question, so here is how I do it:

The DVB-S card cannot control the volume of the SPDIF out, but if you loop
the SPDIF out put through a soundcard with SPDIF input and output, the DSP
on the soundcard can change the volume of the signal.

I am using the CD-SPDIF input of my Soundblaster Live! with the latest ALSA
drivers. This input is directly connected to pin 4 (SPDIF-out) and pin 10
(GND) of the DVB-S card. I have a bulk-version of the Soundblaster Live!,
which originally does not come with a CD-SPDIF input, but you just need to
bridge a SMD capacitor and get this input for free (if you need details,
please contact me).

The volume can be controlled with the ALSA mixer like this:
	amixer set 'IEC958 TTL' 100

Where 'IEC958 TTL' is the name of the input (CD-SPDIF) and 100 is the volume
in %.
I patched VDR with the following changes in dvbapi.c and Makefile:

diff -u /tmp/VDR/dvbapi.c dvbapi.c
--- /tmp/VDR/dvbapi.c   Fri Dec 14 21:14:21 2001
+++ dvbapi.c    Sun Nov 25 17:38:09 2001
@@ -3507,9 +3507,16 @@
 {
   if (fd_audio >= 0) {
      volume = min(max(Absolute ? Volume : volume + Volume, 0), MAXVOLUME);
+#if defined(SPDIF)
+     char *cmd = NULL;
+     asprintf(&cmd, "amixer set 'IEC958 TTL' %d 2> /dev/null", (volume *
100) / 255);
+     system(cmd);
+     delete cmd;
+#else
      audioMixer_t am;
      am.volume_left = am.volume_right = volume;
      CHECK(ioctl(fd_audio, AUDIO_SET_MIXER, &am));
+#endif
      }
 }diff -u /tmp/VDR/Makefile Makefile
--- /tmp/VDR/Makefile   Sun Oct  7 17:14:50 2001
+++ Makefile    Thu Dec 27 17:47:40 2001
@@ -50,6 +50,11 @@
 DEFINES += -DVFAT
 endif

+ifdef SPDIF
+# volume control for SPDIF output
+DEFINES += -DSPDIF
+endif
+
 all: vdr
 font: genfontfile fontfix.c fontosd.c
        @echo "font files created."


Compile VDR by adding SPDIF=1 in the commandline.
If you are using another SPDIF input or soundcard, you have to change the
name of the input.

Ralf.




Home | Main Index | Thread Index