Answered
0
0

Greetings,

We use FMOD Ex 4.44.52 through Autodesk Scaleform in our PS3 titles, and only support CELL_AUDIO_OUT_CODING_TYPE_LPCM. We’ve recently come to realize that audio is only ever playing in 2 channels, regardless of how many channels are available on the system. When we setup the PARAM.SFO and submit to Sony, we have been assuming we should be checking all LPCM types (7.1 LPCM, 5.1 LPCM, 2ch LPCM, as well as the downmixed versions).

The standard audio files we play are stereo or mono .ogg files.

Is there something we are initializing incorrectly, or not doing to upmix to support all available channels?

Here is how we initialize FMOD:

bool FxSoundFMOD::Initialize(const CellSpurs* pspurs)
{
    CellAudioOutConfiguration audioOutConfig;
    memset(&audioOutConfig, 0, sizeof(CellAudioOutConfiguration)); 

    // First, check for 8 ch or 6ch HDMI
    int channelsAvailable = cellAudioOutGetSoundAvailability(CELL_AUDIO_OUT_PRIMARY, CELL_AUDIO_OUT_CODING_TYPE_LPCM, CELL_AUDIO_OUT_FS_48KHZ, 0);
    audioOutConfig.encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;

    //if (channelsAvailable != 8 && channelsAvailable != 6)
    //{
        //// If there's no 8 ch or 6ch HDMI, check for DTS
        //channelsAvailable = cellAudioOutGetSoundAvailability(CELL_AUDIO_OUT_PRIMARY, CELL_AUDIO_OUT_CODING_TYPE_DTS, CELL_AUDIO_OUT_FS_48KHZ, 0);

        //if (channelsAvailable)
        //{
            // DTS
            //audioOutConfig.encoder = CELL_AUDIO_OUT_CODING_TYPE_DTS;
        //}
        //else
        //{
            // DTS not supported, check for DD support
            //channelsAvailable = cellAudioOutGetSoundAvailability(CELL_AUDIO_OUT_PRIMARY, CELL_AUDIO_OUT_CODING_TYPE_AC3, CELL_AUDIO_OUT_FS_48KHZ, 0);
            //if (channelsAvailable)
            //{
                // Dolby digital supported
                //audioOutConfig.encoder = CELL_AUDIO_OUT_CODING_TYPE_AC3;
            //}
            //else
            //{
                //channelsAvailable = cellAudioOutGetSoundAvailability(CELL_AUDIO_OUT_PRIMARY, CELL_AUDIO_OUT_CODING_TYPE_LPCM, CELL_AUDIO_OUT_FS_48KHZ, 0);
                //audioOutConfig.encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
            //}
        //}
    //}

    if (channelsAvailable != 8)
    {
        // Need to downmix
        if (channelsAvailable == 6)
        {
            audioOutConfig.channel   = 6;
            audioOutConfig.downMixer = CELL_AUDIO_OUT_DOWNMIXER_TYPE_B; // 8ch => 6ch downmix.
        }
        else
        {
            audioOutConfig.channel   = 2;
            audioOutConfig.downMixer = CELL_AUDIO_OUT_DOWNMIXER_TYPE_A; // 8ch => 2ch downmix.
        }
    }
    else
    {
        // No downmix required
        audioOutConfig.channel  = 8;
        audioOutConfig.downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE;
    }

    int res = cellAudioOutConfigure(CELL_AUDIO_OUT_PRIMARY, &audioOutConfig, NULL, 0);
    if (res != CELL_OK)
    {
        SF_DEBUG_ERROR1(1, "cellAudioOutConfigure: %x. No sound will be playing.\n", res);
        return false;
    }

    res = cellAudioInit();
    if (res != CELL_OK && res != CELL_AUDIO_ERROR_ALREADY_INIT)
    {
        SF_DEBUG_ERROR1(1, "cellAudioInit: %x. No sound will be playing.\n", res);
        return false;
    }

    CellAudioPortParam audioParam;
    UInt32 audioPort;

    // Audio port open
    audioParam.nChannel = CELL_AUDIO_PORT_8CH;
    audioParam.nBlock   = CELL_AUDIO_BLOCK_8;
    audioParam.attr     = 0;
    res = cellAudioPortOpen(&audioParam, &audioPort);
    if (res != CELL_OK)
    {
        SF_DEBUG_ERROR1(1, "cellAudioPortOpen: %x. No sound will be playing.\n", res);
        return false;
    }

    pFMODHeap = Memory::GetGlobalHeap()->CreateHeap("_FMOD_Heap", 0, 32);
    FMOD::Memory_Initialize(NULL, 0, FMOD_AllocCallback, FMOD_ReallocCallback, FMOD_FreeCallback);

    FMOD_RESULT result;
    result = FMOD::System_Create(&pFMOD);
    FMOD_ERRCHK(result);

    SF_ASSERT(pspurs);
    uint8_t sprus_priorities[] = {1, 1, 0, 0, 0, 0, 0, 0};
    FMOD_PS3_EXTRADRIVERDATA extradriverdata;
    memset(&extradriverdata, 0, sizeof(FMOD_PS3_EXTRADRIVERDATA));
    extradriverdata.spurs = const_cast<CellSpurs*>(pspurs);
    extradriverdata.cell_audio_initialized = 1;
    extradriverdata.cell_audio_port = audioPort;
    extradriverdata.spurs_taskset_priorities = sprus_priorities;

    result = pFMOD->init(64, FMOD_INIT_NORMAL, (void *)&extradriverdata);
    FMOD_ERRCHK(result);

    pSoundRenderer = *Sound::SoundRendererFMOD::CreateSoundRenderer();
    if (!pSoundRenderer->Initialize(pFMOD, true, false))
    {
        SF_DEBUG_ERROR(1, "Can not initialize sound system. No sound will be playing.\n");
        Finalize();
        return false;
    }

    Initialized = true;
    return true;
}
  • You must to post comments
Best Answer
0
0

For console related issues please write to support@fmod.com

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.