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 _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to