Skip to contentSkip to conversation

How to select different S/PDIFoutput ports on a SBLive!

DISCUSSION Gerard Janssen 4 participants 7 messages Aug 31, 2002 – Sep 27, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,

Some time ago, I posted a similar message, but I never got a reply.

The SBLive! card can support four SPDIF output channels, indicated as SPDIF#0 - 3, which are located on the 12 pins or the 40 pins external connector (depending on the type of card).
When I play a file to "spdif" or "iec958:AES0=0x42,AES1 = 0x82,AES2 = 0x02,AES3 = 0x02", the signal is send to the SPDIF#1 output. When I use "front" or "center_lfe", I can get music out of SPDIF#0-3 depending on the ALSA-mixer settings, however, the way the settings have to be chosen is not straight forward (trial and error). So apparently all SPDIF outputs are "available".

I would like to select/address all four SPDIF outputs of the SBLive! card. Now I have the following questions:

1. How can the SPDIF output port be changed when using the "spdif" or "iec958" in the alsa player. I tried to change the channel value of AES2, but this had no effect at all.

2. I tried to find the location where the SPDIF output port is set in the alsa code for the emu10k1. I also searched the emufx-code, since the spdif outputs come directly from the fx8010 processor, but I did not find it. Where is the SPDIF output port set? How can it be changed?

B.t.w. I did find only three SPDIF channel status registers (SPCS0-2). Why are there only three SPCS's in stead of four?

Gerard Janssen

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

#2 lore raw
Quoted 14 lines · Gerard Janssen

Hi,

Some time ago, I posted a similar message, but I never got a reply.

The SBLive! card can support four SPDIF output channels, indicated as SPDIF#0 - 3, which are located on the 12 pins or the 40 pins external connector (depending on the type of card).
When I play a file to "spdif" or "iec958:AES0=0x42,AES1 = 0x82,AES2 = 0x02,AES3 = 0x02", the signal is send to the SPDIF#1 output. When I use "front" or "center_lfe", I can get music out of SPDIF#0-3 depending on the ALSA-mixer settings, however, the way the settings have to be chosen is not straight forward (trial and error). So apparently all SPDIF outputs are "available".

Quoted 6 lines

I would like to select/address all four SPDIF outputs of the SBLive! card. Now I have the following questions:

1. How can the SPDIF output port be changed when using the "spdif" or "iec958" in the alsa player. I tried to change the channel value of AES2, but this had no effect at all.

It's not possible. Actually, DSP code supports optical and coaxial digital outs for LiveDrive, but I haven't information about physical connections for them by hand.

Quoted 4 lines

2. I tried to find the location where the SPDIF output port is set in the alsa code for the emu10k1. I also searched the emufx-code, since the spdif outputs come directly from the fx8010 processor, but I did not find it. Where is the SPDIF output port set? How can it be changed?

Look for EXTIN_TOSLINK_L and EXTIN_COAX_SPDIF_L in emufx.c

Quoted 2 lines

B.t.w. I did find only three SPDIF channel status registers (SPCS0-2). Why are there only three SPCS's in stead of four?

I think that the emu10k1 chip shomehow merges signals from two S/PDIF inputs into one.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

#3 lore raw

Hi Jaroslav,

Quoted 26 lines
Quoted 10 lines

The SBLive! card can support four SPDIF output channels, indicated as SPDIF#0 - 3, which are located on the 12 pins or the 40 pins external connector (depending on the type of card).
When I play a file to "spdif" or "iec958:AES0=0x42,AES1 = 0x82,AES2 = 0x02,AES3 = 0x02", the signal is send to the SPDIF#1 output. When I use "front" or "center_lfe", I can get music out of SPDIF#0-3 depending on the ALSA-mixer settings, however, the way the settings have to be chosen is not straight forward (trial and error). So apparently all SPDIF outputs are "available".

Quoted 6 lines

I would like to select/address all four SPDIF outputs of the SBLive! card. Now I have the following questions:

1. How can the SPDIF output port be changed when using the "spdif" or "iec958" in the alsa player. I tried to change the channel value of AES2, but this had no effect at all.

It's not possible. Actually, DSP code supports optical and coaxial digital outs for LiveDrive, but I haven't information about physical connections for them by hand.

Quoted 4 lines

2. I tried to find the location where the SPDIF output port is set in the alsa code for the emu10k1. I also searched the emufx-code, since the spdif outputs come directly from the fx8010 processor, but I did not find it. Where is the SPDIF output port set? How can it be changed?

Quoted 7 lines

Look for EXTIN_TOSLINK_L and EXTIN_COAX_SPDIF_L in emufx.c

Quoted 2 lines

B.t.w. I did find only three SPDIF channel status registers (SPCS0-2). Why are there only three SPCS's in stead of four?

I think that the emu10k1 chip shomehow merges signals from two S/PDIF inputs into one.

I tried to find the spdif output port addresses by changing the register addresses of EXTOUT_TOSLINK_L/R in emu10k1.h to all 16 possible output address pairs between (00 - 1f). To do this, I removed the extout_mask check in emufx.c in the piece of code given below. I found the addresses of the four spdif output ports of the SBLive! card (I did/could not check this for the Audigity) and they are as follows: spdifo#0 = (0x02,0x03), which is the standard output, spdifo#1 = (0x04,0x05), spdifo#2 = (0x06,0x07) and spdifo#3 = (0x08,0x09).

So in principle it seems to be possible to create 8 digital output channels on the SBLive!, however at the cost of some of its standard functionalities, namely the outputs of the center_lfe, headphone and rear channels to the LiveDrive (I think?).

Now, I would like to implement three additional spdif outputs in the same way as the standard output, so without volume or tone control. I think, this is an interesting extension of the functionality of the SBLive, since by creating 8 independent digital outputs we get a functionality on a cheap soundcard which is now only available at expensive (professional) soundcards. The problem is that I am not a programmer, however, I would like to give it a try where any help from the ALSA community is very much appreciated. I have the following questions:

1. Is the code related to the standard spdif output in emufx.c, limited to the following code lines or is there other code involved?

	if (emu->fx8010.extout_mask &
((1<<EXTOUT_TOSLINK_L)|(1<<EXTOUT_TOSLINK_R))) {
		/* IEC958 Optical Raw Playback Switch */

		for (z = 0; z < 2; z++) {
			SWITCH(icode, &ptr, tmp + 0, 8 + z, gpr + z);
			SWITCH_NEG(icode, &ptr, tmp + 1, gpr + z);
			SWITCH(icode, &ptr, tmp + 1, playback + SND_EMU10K1_PLAYBACK_CHANNELS +
z, tmp + 1);
			OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_TOSLINK_L + z), GPR(tmp + 0),
GPR(tmp + 1), C_00000000);
		}
		snd_emu10k1_init_stereo_onoff_control(controls + i++, "IEC958 Optical Raw
Playback Switch", gpr, 0);
		gpr += 2;
	}

2. To what address does "tmp" refer in the OP instruction above?

3. Do I need to implement additional "Process FX Buses" (now there are 9 buses, indicated as GPR(0) - GPR(9), where GPR(8) and GPR(9) have the comment S/PDIF left/right)?

4. I thought that the spdif channel status registers SPCS0-3 (I added an SPCS3 on address 0x57 in emu10k1.h) were initialized in emu10k1_main.c. However, after playing a wave file using aplay via spdif at 44.1 kHz, the sample frequency in SPCS is changed from 48 kHz to 44.1 kHz. Also other changes appear in some SPCS values, which I cannot trace back. Where in the code is the SPCS value changed?

Regards,

Gerard Janssen

**********************************************************************
Dr.ir. Gerard J.M. Janssen
Delft University of Technology
Faculty of Information Technology and Systems (ITS) Telecommunications and Traffic Control Systems Group P.O. Box 5031, 2600 GA Delft, The Netherlands Phone +31-15-2786736, Fax +31-15-2781774 E-mail [email protected]
**********************************************************************

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#4 lore raw

Hi,

(I removed alsa-users from Cc)

At Fri, 20 Sep 2002 10:56:01 +0200,

Quoted 10 lines · Gerard Janssen

I tried to find the spdif output port addresses by changing the register addresses of EXTOUT_TOSLINK_L/R in emu10k1.h to all 16 possible output address pairs between (00 - 1f). To do this, I removed the extout_mask check in emufx.c in the piece of code given below. I found the addresses of the four spdif output ports of the SBLive! card (I did/could not check this for the Audigity) and they are as follows: spdifo#0 = (0x02,0x03), which is the standard output, spdifo#1 = (0x04,0x05), spdifo#2 = (0x06,0x07) and spdifo#3 = (0x08,0x09).

Quoted 4 lines

So in principle it seems to be possible to create 8 digital output channels on the SBLive!, however at the cost of some of its standard functionalities, namely the outputs of the center_lfe, headphone and rear channels to the LiveDrive (I think?).

it's interesting.
are signals sent to all spdif outs without changing any other reigisters?

Quoted 12 lines

Now, I would like to implement three additional spdif outputs in the same way as the standard output, so without volume or tone control. I think, this is an interesting extension of the functionality of the SBLive, since by creating 8 independent digital outputs we get a functionality on a cheap soundcard which is now only available at expensive (professional) soundcards. The problem is that I am not a programmer, however, I would like to give it a try where any help from the ALSA community is very much appreciated. I have the following questions:

1. Is the code related to the standard spdif output in emufx.c, limited to the following code lines or is there other code involved?

Quoted 16 lines
	if (emu->fx8010.extout_mask &
((1<<EXTOUT_TOSLINK_L)|(1<<EXTOUT_TOSLINK_R))) {
		/* IEC958 Optical Raw Playback Switch */

		for (z = 0; z < 2; z++) {
			SWITCH(icode, &ptr, tmp + 0, 8 + z, gpr + z);
			SWITCH_NEG(icode, &ptr, tmp + 1, gpr + z);
			SWITCH(icode, &ptr, tmp + 1, playback + SND_EMU10K1_PLAYBACK_CHANNELS +
z, tmp + 1);
			OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_TOSLINK_L + z), GPR(tmp + 0),
GPR(tmp + 1), C_00000000);
		}
		snd_emu10k1_init_stereo_onoff_control(controls + i++, "IEC958 Optical Raw
Playback Switch", gpr, 0);
		gpr += 2;
	}

the code above implements a switch for "raw" playback (e.g. ac3). at the first step, you can skip this switch and route wet signals like others.

Quoted 2 lines

2. To what address does "tmp" refer in the OP instruction above?

initialized at the beginning of the function. it's 0x88. as imagined from its name, it's a temporary GPR.

Quoted 3 lines

3. Do I need to implement additional "Process FX Buses" (now there are 9 buses, indicated as GPR(0) - GPR(9), where GPR(8) and GPR(9) have the comment S/PDIF left/right)?

we might need more two FX buses for all 4 separate outputs (see below my comments).
GPR(8) and (9) are used for raw playback, so additionally we need more if 4 raw playbacks are needed, too.

Quoted 6 lines

4. I thought that the spdif channel status registers SPCS0-3 (I added an SPCS3 on address 0x57 in emu10k1.h) were initialized in emu10k1_main.c. However, after playing a wave file using aplay via spdif at 44.1 kHz, the sample frequency in SPCS is changed from 48 kHz to 44.1 kHz. Also other changes appear in some SPCS values, which I cannot trace back. Where in the code is the SPCS value changed?

SPCS is changed in snd_emu10k1_spdif_put() (in emumixer.c). the value is changed if you open the pcm with arguments like AES0=xxx.

the necessary changes would be to add controls to change other SPCS registers via mixer (and more "raw playback" switches if necessary).

basically, the routing can be controlled via a mixer control element. that is, to which FX bus and how much the signal is sent. on the current code, you cannot separate spdif #1 and #2, since both use the same center/lfe source. thus, we can define new FX channels for them and mix if neceessary.

even with the current code, you can change the routing like the following:

SPDIF #0

	normal spdif playback
	% aplay -Dspdif ...

SPDIF #1
(adjust Wave Center Playback Volume
Wave LFE Playback Volume)
% aplay -Dcenter_lfe ...

SPDIF #2
(toggle Headphone Center Playback Switch,1
and Headphone LFE Playback Switch,1
adjust Headphone Playback Volume,1 in addition to the volumes for spdif#2)
% aplay -Dcenter_lfe ...

SPDIF #3

	(adjust Wave Surround Playback Volume)
	% aplay -Drear ...

Takashi

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#5 lore raw
Quoted 84 lines · Takashi Iwai

Hi,

(I removed alsa-users from Cc)

At Fri, 20 Sep 2002 10:56:01 +0200,

Quoted 10 lines · Gerard Janssen

I tried to find the spdif output port addresses by changing the register addresses of EXTOUT_TOSLINK_L/R in emu10k1.h to all 16 possible output address pairs between (00 - 1f). To do this, I removed the extout_mask check in emufx.c in the piece of code given below. I found the addresses of the four spdif output ports of the SBLive! card (I did/could not check this for the Audigity) and they are as follows: spdifo#0 = (0x02,0x03), which is the standard output, spdifo#1 = (0x04,0x05), spdifo#2 = (0x06,0x07) and spdifo#3 = (0x08,0x09).

Quoted 4 lines

So in principle it seems to be possible to create 8 digital output channels on the SBLive!, however at the cost of some of its standard functionalities, namely the outputs of the center_lfe, headphone and rear channels to the LiveDrive (I think?).

it's interesting.
are signals sent to all spdif outs without changing any other reigisters?

Quoted 12 lines

Now, I would like to implement three additional spdif outputs in the same way as the standard output, so without volume or tone control. I think, this is an interesting extension of the functionality of the SBLive, since by creating 8 independent digital outputs we get a functionality on a cheap soundcard which is now only available at expensive (professional) soundcards. The problem is that I am not a programmer, however, I would like to give it a try where any help from the ALSA community is very much appreciated. I have the following questions:

1. Is the code related to the standard spdif output in emufx.c, limited to the following code lines or is there other code involved?

Quoted 16 lines
	if (emu->fx8010.extout_mask &
((1<<EXTOUT_TOSLINK_L)|(1<<EXTOUT_TOSLINK_R))) {
		/* IEC958 Optical Raw Playback Switch */

		for (z = 0; z < 2; z++) {
			SWITCH(icode, &ptr, tmp + 0, 8 + z, gpr + z);
			SWITCH_NEG(icode, &ptr, tmp + 1, gpr + z);
			SWITCH(icode, &ptr, tmp + 1, playback + SND_EMU10K1_PLAYBACK_CHANNELS +
z, tmp + 1);
			OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_TOSLINK_L + z), GPR(tmp + 0),
GPR(tmp + 1), C_00000000);
		}
		snd_emu10k1_init_stereo_onoff_control(controls + i++, "IEC958 Optical Raw
Playback Switch", gpr, 0);
		gpr += 2;
	}

the code above implements a switch for "raw" playback (e.g. ac3). at the first step, you can skip this switch and route wet signals like others.

Quoted 2 lines

2. To what address does "tmp" refer in the OP instruction above?

initialized at the beginning of the function. it's 0x88. as imagined from its name, it's a temporary GPR.

Quoted 3 lines

3. Do I need to implement additional "Process FX Buses" (now there are 9 buses, indicated as GPR(0) - GPR(9), where GPR(8) and GPR(9) have the comment S/PDIF left/right)?

we might need more two FX buses for all 4 separate outputs (see below my comments).
GPR(8) and (9) are used for raw playback, so additionally we need more if 4 raw playbacks are needed, too.

Quoted 6 lines

4. I thought that the spdif channel status registers SPCS0-3 (I added an SPCS3 on address 0x57 in emu10k1.h) were initialized in emu10k1_main.c. However, after playing a wave file using aplay via spdif at 44.1 kHz, the sample frequency in SPCS is changed from 48 kHz to 44.1 kHz. Also other changes appear in some SPCS values, which I cannot trace back. Where in the code is the SPCS value changed?

SPCS is changed in snd_emu10k1_spdif_put() (in emumixer.c). the value is changed if you open the pcm with arguments like AES0=xxx.

Quoted 8 lines

the necessary changes would be to add controls to change other SPCS registers via mixer (and more "raw playback" switches if necessary).

basically, the routing can be controlled via a mixer control element. that is, to which FX bus and how much the signal is sent. on the current code, you cannot separate spdif #1 and #2, since both use the same center/lfe source. thus, we can define new FX channels for them and mix if neceessary.

We're very tight with GPRs with the current firmware. Implementing next features will require the firmware linker / manager in the user space.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#6 lore raw
In reply to Takashi Iwai

Hi,

Takashi wrote

Quoted 11 lines
Quoted 10 lines · Gerard Janssen

I tried to find the spdif output port addresses by changing the register addresses of EXTOUT_TOSLINK_L/R in emu10k1.h to all 16 possible output address pairs between (00 - 1f). To do this, I removed the extout_mask check in emufx.c in the piece of code given below. I found the addresses of the four spdif output ports of the SBLive! card (I did/could not check this for the Audigity) and they are as follows: spdifo#0 = (0x02,0x03), which is the standard output, spdifo#1 = (0x04,0x05), spdifo#2 = (0x06,0x07) and spdifo#3 = (0x08,0x09).

Quoted 7 lines
Quoted 4 lines

So in principle it seems to be possible to create 8 digital output channels on the SBLive!, however at the cost of some of its standard functionalities, namely the outputs of the center_lfe, headphone and rear channels to the LiveDrive (I think?).

it's interesting.
are signals sent to all spdif outs without changing any other reigisters?

In this experiment, I just changed the address of EXTOUT_TOSLINK_L/R in emu10k1.h. When using <aplay -D spdif "test.wav"> the signal is routed to the respective SPDIF output ports coreesponding to the chosen EXTOUT_TOSLINK_L/R adresses as mentioned above.

Quoted 6 lines
Quoted 6 lines

Now, I would like to implement three additional spdif outputs in the same way as the standard output, so without volume or tone control. I think, this is an interesting extension of the functionality of the SBLive, since by creating 8 independent digital outputs we get a functionality on a cheap soundcard which is now only available at expensive (professional)

soundcards.

Quoted 23 lines
Quoted 6 lines

The problem is that I am not a programmer, however, I would like to give it a try where any help from the ALSA community is very much appreciated. I have the following questions:

1. Is the code related to the standard spdif output in emufx.c, limited to the following code lines or is there other code involved?

Quoted 16 lines
	if (emu->fx8010.extout_mask &
((1<<EXTOUT_TOSLINK_L)|(1<<EXTOUT_TOSLINK_R))) {
		/* IEC958 Optical Raw Playback Switch */

		for (z = 0; z < 2; z++) {
			SWITCH(icode, &ptr, tmp + 0, 8 + z, gpr + z);
			SWITCH_NEG(icode, &ptr, tmp + 1, gpr + z);
			SWITCH(icode, &ptr, tmp + 1, playback + SND_EMU10K1_PLAYBACK_CHANNELS +
z, tmp + 1);
			OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_TOSLINK_L + z), GPR(tmp + 0),
GPR(tmp + 1), C_00000000);
		}
		snd_emu10k1_init_stereo_onoff_control(controls + i++, "IEC958 Optical Raw
Playback Switch", gpr, 0);
		gpr += 2;
	}
Quoted 3 lines

the code above implements a switch for "raw" playback (e.g. ac3). at the first step, you can skip this switch and route wet signals like others.

OK, in a following experiment I will try to route the "Process FX Buses" directly to the SPDIF outputs using:
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_X_L + z), GPR(FX_Bus_Y +z), C_00000000, C_00000000);
and neglect the current routings.

Quoted 10 lines
Quoted 4 lines

3. Do I need to implement additional "Process FX Buses" (now there are 9 buses, indicated as GPR(0) - GPR(9), where GPR(8) and GPR(9) have the comment S/PDIF left/right)?

we might need more two FX buses for all 4 separate outputs (see below my comments).
GPR(8) and (9) are used for raw playback, so additionally we need more if 4 raw playbacks are needed, too.

Quoted 8 lines

the necessary changes would be to add controls to change other SPCS registers via mixer (and more "raw playback" switches if necessary).

basically, the routing can be controlled via a mixer control element. that is, to which FX bus and how much the signal is sent. on the current code, you cannot separate spdif #1 and #2, since both use the same center/lfe source. thus, we can define new FX channels for them and mix if neceessary.

I added SPCS3 on address 0x57, and increased the spdif_bits array form 3 to 4 locations in emu10k1.h. Further, SPCS3 was initialized in emu10k1_main.c. Is this sufficient to make it active and remove the sharing of SPCS2 for SPDIF2&3?

Quoted 19 lines

even with the current code, you can change the routing like the following:

SPDIF #0

	normal spdif playback
	% aplay -Dspdif ...

SPDIF #1
(adjust Wave Center Playback Volume
Wave LFE Playback Volume)
% aplay -Dcenter_lfe ...

SPDIF #2
(toggle Headphone Center Playback Switch,1
and Headphone LFE Playback Switch,1
adjust Headphone Playback Volume,1 in addition to the volumes for spdif#2) % aplay -Dcenter_lfe ...

Quoted 4 lines

SPDIF #3

	(adjust Wave Surround Playback Volume)
	% aplay -Drear ...

Ok, my preference is to have a direct rout towards the SPDIF outputs without amplitude or tone control. A switch to choose between either the original application with the LiveDrive and its routings/controls or four SPDIF outputs with or without further controls could be a solution.

Thanks,

Gerard

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#7 lore raw
In reply to Jaroslav Kysela

Hi,

In my attempt to address the four SPDIF output ports of the SBLive!, I made the following changes in the the emufx.c code. I did not to use the playback registers or SND_EMU10K1_PLAYBACK_CHANNELS (as far as possible) since I would like to omit volume and tone control.

if (emu->fx8010.extout_mask & ((1<<EXTOUT_TOSLINK_L)|(1<<EXTOUT_TOSLINK_R))) { /* IEC958 Optical Raw Playback Switch */

        for (z = 0; z < 2; z++) {
            SWITCH(icode, &ptr, tmp + 0, 8 + z, 1);
            SWITCH(icode, &ptr, tmp + 0, 8 + z, gpr + z);
            SWITCH_NEG(icode, &ptr, tmp + 1, gpr + z);
            SWITCH(icode, &ptr, tmp + 1, playback + SND_EMU10K1_PLAYBACK_CHANNELS + z, tmp + 1); OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_TOSLINK_L + z), GPR(tmp + 0), GPR(tmp + 1), C_00000000);
}

        snd_emu10k1_init_stereo_onoff_control(controls + i++, "IEC958 Optical Raw Playback Switch", gpr, 0); gpr += 2;
    }

    if (emu->fx8010.extout_mask & ((1<<EXTOUT_HEADPHONE_L)|(1<<EXTOUT_HEADPHONE_R))) { /* Headphone Playback Volume */

        for (z = 0; z < 2; z++) {
OP(icode, &ptr, iACC3, EXTOUT_HEADPHONE_L + z, GPR(z), C_00000000, C_00000000);
}
        snd_emu10k1_init_mono_onoff_control(controls + i++, "Headphone Center Playback Switch", gpr + 2, 0); controls[i-1].id.index = 1;
        snd_emu10k1_init_mono_onoff_control(controls + i++, "Headphone LFE Playback Switch", gpr + 3, 0); controls[i-1].id.index = 1;

        gpr += 4;
    }

    if (emu->fx8010.extout_mask & ((1<<EXTOUT_REAR_L)|(1<<EXTOUT_REAR_R)))
        for (z = 0; z < 2; z++)
            OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_REAR_L + z), GPR(4 + z), C_00000000, C_00000000);

    if (emu->fx8010.extout_mask & (1<<EXTOUT_CENTER)) {
            OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_CENTER), GPR(6), C_00000000, C_00000000);
}

    if (emu->fx8010.extout_mask & (1<<EXTOUT_LFE)) {
            OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_LFE), GPR(7), C_00000000, C_00000000);
}

With this code, I get the following result using aplay: "spdif" is routed to SPDIF output#0, "center_lfe"  --> SPDIF output#1, "front" --> SPDIF output#2 and "rear" --> SPDIF output#3. This holds when wav-file is send to one of them separately. When I send wav-files all of them simultaneously, there is a conflict between "spdif" and "center_lfe". The output ("spdif" / "center_lfe") that is first started is used. The wav-file to the other output is played, but there is the following message and no samples are send to the spdif output:

Playing WAVE 'Track072.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo ALSA lib setup.c:94:(snd_sctl_install) Cannot lock ctl elem
aplay: set_params:787: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: 100000
PERIOD_SIZE: 4410
PERIOD_BYTES: 17640
PERIODS: 5
BUFFER_TIME: 500000
BUFFER_SIZE: 22050
BUFFER_BYTES: 88200
TICK_TIME: 10000

It seems as if both "spdif" and "center_lfe" try to access the same registers. Is this the case? How can it be solved? Which GPRs contain the samples send to "spdif"?

Regards,

Gerard Janssen

------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf