Skip to contentSkip to conversation

How to route "spdif" to an FXBUS of emu10k1

DISCUSSION Gerard Janssen 2 participants 4 messages Jan 8, 2003 – Jan 9, 2003

lore
Share & tools
lore
#0 lore raw

Hi,

By making slight changes in emufx.c, I could use all four spdif stereo channels of the sblive! that are present on the audio-ext connector. These spdif0..3 outputs can be accessed via: EXTOUT_TOSLINK_L,R ; EXTOUT_HEADPHONE_L,R ; EXTOUT_REAR_L,R and EXTOUT_CENTER,LFE. By re-routing "spdif", "front", "rear" and "center_lfe" to the respective outputs, four stereo signals (8 channels) can be simultaneously send to these outputs.

The "front", "rear" and "center_lfe" signals are alsmost perfectly synchronized (within a few samples) and the small delays are constant. However, the signal via "spdif" is not: its delay w.r.t. the other signals is about 60 samples and changes randomly every time the application is started.
The "spdif" signal is taken from GPR(8) and GPR(9) in emufx.c. As far as I could backtrace these signals come from etram, which probably is the cause of the random delay.

A solution might be to put the "spdif" also directly in two FXBUS registers (there are still 6 free FXBUS registers), as is done with the other signals. However, I don't know how to do this.

I would appreciate any help or suggestions in routing "spdif" to an FXBUS.

Thanks,

Gerard Janssen

**********************************************************************
Dr.ir. Gerard J.M. Janssen
Delft University of Technology
Faculty of Information Technology and Systems (ITS) Wireless Mobile Communications 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:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

#1 lore raw
Quoted 18 lines · Gerard Janssen

Hi,

By making slight changes in emufx.c, I could use all four spdif stereo channels of the sblive! that are present on the audio-ext connector. These spdif0..3 outputs can be accessed via: EXTOUT_TOSLINK_L,R ; EXTOUT_HEADPHONE_L,R ; EXTOUT_REAR_L,R and EXTOUT_CENTER,LFE. By re-routing "spdif", "front", "rear" and "center_lfe" to the respective outputs, four stereo signals (8 channels) can be simultaneously send to these outputs.

The "front", "rear" and "center_lfe" signals are alsmost perfectly synchronized (within a few samples) and the small delays are constant. However, the signal via "spdif" is not: its delay w.r.t. the other signals is about 60 samples and changes randomly every time the application is started.
The "spdif" signal is taken from GPR(8) and GPR(9) in emufx.c. As far as I could backtrace these signals come from etram, which probably is the cause of the random delay.

Quoted 5 lines

A solution might be to put the "spdif" also directly in two FXBUS registers (there are still 6 free FXBUS registers), as is done with the other signals. However, I don't know how to do this.

I would appreciate any help or suggestions in routing "spdif" to an FXBUS.

These steps are necessary:

1) remove the emufx PCM code (or the last two lines):

        /* 22: */ OP(icode, &ptr, iMACINT1, ETRAM_ADDR(ipcm->etram[0]), GPR(gpr + 8), GPR_DBAC, C_ffffffff);
        /* 23: */ OP(icode, &ptr, iMACINT1, ETRAM_ADDR(ipcm->etram[1]), GPR(gpr + 9), GPR_DBAC, C_ffffffff);

you can do it without modification of driver code itself (see SNDRV_EMU10K1_IOCTL_CODE_POKE and SNDRV_EMU10K1_IOCTL_CODE_PEEK ioctls)

2) replace these two lines in emufx:

        OP(icode, &ptr, iMACINT0, GPR(6), C_00000000, FXBUS(FXBUS_PCM_CENTER), C_00000004);
        OP(icode, &ptr, iMACINT0, GPR(7), C_00000000, FXBUS(FXBUS_PCM_LFE), C_00000004);

to

        OP(icode, &ptr, iMACINT0, GPR(6), C_00000000, FXBUS(8), C_00000004);
        OP(icode, &ptr, iMACINT0, GPR(7), C_00000000, FXBUS(9), C_00000004);

3) create a new "chn67" pcm in your .asoundrc:

pcm.chn67 {
        @args [ CARD ]
        @args.CARD {
                type string
        }
        type hooks
        slave.pcm {
                type hw
                card $CARD
                device 0
        }
        hooks.0 {
                type ctl_elems
                hook_args [
                        {
                                name "EMU10K1 PCM Send Volume"
                                index { @func private_pcm_subdevice }
                                lock true
                                value [ 0 0 0 0 255 0 0 0 0 255 0 0 ]
                        }
                        {
                                name "EMU10K1 PCM Send Routing"
                                index { @func private_pcm_subdevice }
                                lock true
                                value [ 0 1 2 3 8 9 0 1 8 9 0 1 ]
                        }
	}
}

Note: Send Routing is fxbus setup

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

#2 lore raw

Hi Jaroslav,

Many thanks for your reply. This realy solved my problem.

I have been able to implement a new PCM-stream and send it to empty FXBUS registers. However, I could not find .asoundcr (I am using SUSE 8.1 with ALSA_rc6). Where is it? In stead, I adapted alsa.conf, emu10k1.conf and added a pcm_new.conf in /usr/share/alsa/ and this worked.

After having done this, I am stuck with some questions. Why are there no "Send Routing" lines in the "front" and "rear" config files, since they are routed to FXBUS?
Why do the lines:

Quoted 1 line
       /* 22: */ OP(icode, &ptr, iMACINT1, ETRAM_ADDR(ipcm->etram[0]),

GPR(gpr + 8), GPR_DBAC, C_ffffffff);

Quoted 1 line
       /* 23: */ OP(icode, &ptr, iMACINT1, ETRAM_ADDR(ipcm->etram[1]),

GPR(gpr + 9), GPR_DBAC, C_ffffffff);
have to be removed?

With kind regards,

Gerard Janssen

Quoted 24 lines · Jaroslav Kysela
Quoted 22 lines · Gerard Janssen

Hi,

By making slight changes in emufx.c, I could use all four spdif stereo channels of the sblive! that are present on the audio-ext connector. These spdif0..3 outputs can be accessed via: EXTOUT_TOSLINK_L,R ; EXTOUT_HEADPHONE_L,R ; EXTOUT_REAR_L,R and EXTOUT_CENTER,LFE. By re-routing "spdif", "front", "rear" and "center_lfe" to the respective outputs, four stereo signals (8 channels) can be simultaneously send to these outputs.

The "front", "rear" and "center_lfe" signals are alsmost perfectly synchronized (within a few samples) and the small delays are constant. However, the signal via "spdif" is not: its delay w.r.t. the other signals is about 60 samples and changes randomly every time the application is started.
The "spdif" signal is taken from GPR(8) and GPR(9) in emufx.c. As far as I could backtrace these signals come from etram, which probably is the cause of the random delay.

A solution might be to put the "spdif" also directly in two FXBUS registers (there are still 6 free FXBUS registers), as is done with the other signals. However, I don't know how to do this.

Quoted 7 lines
Quoted 1 line

I would appreciate any help or suggestions in routing "spdif" to an FXBUS.

These steps are necessary:

1) remove the emufx PCM code (or the last two lines):

       /* 22: */ OP(icode, &ptr, iMACINT1, ETRAM_ADDR(ipcm->etram[0]),

GPR(gpr + 8), GPR_DBAC, C_ffffffff);

Quoted 1 line
       /* 23: */ OP(icode, &ptr, iMACINT1, ETRAM_ADDR(ipcm->etram[1]),

GPR(gpr + 9), GPR_DBAC, C_ffffffff);

Quoted 7 lines

you can do it without modification of driver code itself (see SNDRV_EMU10K1_IOCTL_CODE_POKE and SNDRV_EMU10K1_IOCTL_CODE_PEEK ioctls)

2) replace these two lines in emufx:

       OP(icode, &ptr, iMACINT0, GPR(6), C_00000000,

FXBUS(FXBUS_PCM_CENTER), C_00000004);

Quoted 1 line
       OP(icode, &ptr, iMACINT0, GPR(7), C_00000000,

FXBUS(FXBUS_PCM_LFE), C_00000004);

Quoted 48 lines

to

       OP(icode, &ptr, iMACINT0, GPR(6), C_00000000, FXBUS(8), C_00000004);
       OP(icode, &ptr, iMACINT0, GPR(7), C_00000000, FXBUS(9), C_00000004);

3) create a new "chn67" pcm in your .asoundrc:

pcm.chn67 {
       @args [ CARD ]
       @args.CARD {
               type string
       }
       type hooks
       slave.pcm {
               type hw
               card $CARD
               device 0
       }
       hooks.0 {
               type ctl_elems
               hook_args [
                       {
                               name "EMU10K1 PCM Send Volume"
                               index { @func private_pcm_subdevice }
                               lock true
                               value [ 0 0 0 0 255 0 0 0 0 255 0 0 ]
                       }
                       {
                               name "EMU10K1 PCM Send Routing"
                               index { @func private_pcm_subdevice }
                               lock true
                               value [ 0 1 2 3 8 9 0 1 8 9 0 1 ]
                       }
	}
}

Note: Send Routing is fxbus setup

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

Quoted 9 lines

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

**********************************************************************
Dr.ir. Gerard J.M. Janssen
Delft University of Technology
Faculty of Information Technology and Systems (ITS) Wireless Mobile Communications 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:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

#3 lore raw
Quoted 8 lines · Gerard Janssen

Hi Jaroslav,

Many thanks for your reply. This realy solved my problem.

I have been able to implement a new PCM-stream and send it to empty FXBUS registers. However, I could not find .asoundcr (I am using SUSE 8.1 with ALSA_rc6). Where is it? In stead, I adapted alsa.conf, emu10k1.conf and added a pcm_new.conf in /usr/share/alsa/ and this worked.

It's not necessary. The ~/.asoundrc file is also loaded, so you can store your local configuration there.

Quoted 9 lines

After having done this, I am stuck with some questions. Why are there no "Send Routing" lines in the "front" and "rear" config files, since they are routed to FXBUS?
Why do the lines:

Quoted 1 line
       /* 22: */ OP(icode, &ptr, iMACINT1, ETRAM_ADDR(ipcm->etram[0]),

GPR(gpr + 8), GPR_DBAC, C_ffffffff);

Quoted 1 line
       /* 23: */ OP(icode, &ptr, iMACINT1, ETRAM_ADDR(ipcm->etram[1]),

GPR(gpr + 9), GPR_DBAC, C_ffffffff);
have to be removed?

I've a bit overlooked the code. The simplest way is to initialize GPR(8) and GPR(9) after the direct PCM part over ETRAM, so the 22: and 23: lines can be replaced with

        OP(icode, &ptr, iMACINT0, GPR(8), C_00000000, FXBUS(8), C_00000004);
        OP(icode, &ptr, iMACINT0, GPR(9), C_00000000, FXBUS(9), C_00000004);

						Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com