Changeset 59275 in vbox for trunk/src/VBox/Devices/Audio/DevIchHdaCodec.cpp
- Timestamp:
- Jan 7, 2016 11:57:56 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchHdaCodec.cpp
r59257 r59275 9 9 10 10 /* 11 * Copyright (C) 2006-201 5Oracle Corporation11 * Copyright (C) 2006-2016 Oracle Corporation 12 12 * 13 13 * This file is part of VirtualBox Open Source Edition (OSE), as … … 2607 2607 2608 2608 int rc; 2609 2610 2609 switch (enmSoundSource) 2611 2610 { 2612 2611 case PI_INDEX: 2613 rc = pThis->pfnOpenIn(pThis->pHDAState, "hda.in", PDMAUDIORECSOURCE_LINE_IN, pCfg);2612 rc = pThis->pfnOpenIn(pThis->pHDAState, "hda.in", PDMAUDIORECSOURCE_LINE_IN, pCfg); 2614 2613 break; 2615 2614 #ifdef VBOX_WITH_HDA_MIC_IN 2615 case MC_INDEX: 2616 rc = pThis->pfnOpenIn(pThis->pHDAState, "hda.mc", PDMAUDIORECSOURCE_MIC, pCfg); 2617 break; 2618 #endif 2616 2619 case PO_INDEX: 2617 2620 rc = pThis->pfnOpenOut(pThis->pHDAState, "hda.out", pCfg); 2618 2621 break; 2619 2622 2620 #ifdef VBOX_WITH_HDA_MIC_IN2621 case MC_INDEX:2622 rc = pThis->pfnOpenIn(pThis->pHDAState, "hda.mc", PDMAUDIORECSOURCE_MIC, pCfg);2623 break;2624 #endif2625 2623 default: 2626 2624 AssertMsgFailed(("Index %ld not implemented\n", enmSoundSource)); … … 2731 2729 pThis->paVerbs = &g_aCodecVerbs[0]; 2732 2730 pThis->cVerbs = RT_ELEMENTS(g_aCodecVerbs); 2731 2733 2732 pThis->pfnLookup = codecLookup; 2734 2733 #ifdef DEBUG … … 2747 2746 pThis->paNodes[1].afg.u32F20_param = CODEC_MAKE_F20(pThis->u16VendorId, pThis->u8BSKU, pThis->u8AssemblyId); 2748 2747 2749 /* 44.1 kHz. */ 2750 PDMAUDIOSTREAMCFG as; 2751 as.uHz = 44100; 2752 as.cChannels = 2; 2753 as.enmFormat = AUD_FMT_S16; 2754 as.enmEndianness = PDMAUDIOHOSTENDIANNESS; 2755 2756 pThis->paNodes[1].node.au32F00_param[0xA] = CODEC_F00_0A_16_BIT; 2757 2758 hdaCodecOpenStream(pThis, PI_INDEX, &as); 2759 hdaCodecOpenStream(pThis, PO_INDEX, &as); 2748 /* This codec uses a fixed setting (44.1 kHz, 16-bit signed, 2 channels). */ 2749 pThis->strmCfg.uHz = 44100; 2750 pThis->strmCfg.cChannels = 2; 2751 pThis->strmCfg.enmFormat = AUD_FMT_S16; 2752 pThis->strmCfg.enmEndianness = PDMAUDIOHOSTENDIANNESS; 2753 2754 hdaCodecOpenStream(pThis, PI_INDEX, &pThis->strmCfg); 2760 2755 #ifdef VBOX_WITH_HDA_MIC_IN 2761 hdaCodecOpenStream(pThis, MC_INDEX, & as);2756 hdaCodecOpenStream(pThis, MC_INDEX, &pThis->strmCfg); 2762 2757 #endif 2763 2764 pThis->paNodes[1].node.au32F00_param[0xA] |= CODEC_F00_0A_44_1KHZ; 2765 2766 uint8_t i; 2767 Assert(pThis->paNodes); 2768 Assert(pThis->pfnCodecNodeReset); 2769 2770 for (i = 0; i < pThis->cTotalNodes; ++i) 2758 hdaCodecOpenStream(pThis, PO_INDEX, &pThis->strmCfg); 2759 2760 /* Initialize the AFG node with the fixed setting. */ 2761 pThis->paNodes[1].node.au32F00_param[0xA] = CODEC_F00_0A_44_1KHZ | CODEC_F00_0A_16_BIT; 2762 2763 AssertPtr(pThis->paNodes); 2764 AssertPtr(pThis->pfnCodecNodeReset); 2765 2766 for (uint8_t i = 0; i < pThis->cTotalNodes; i++) 2771 2767 pThis->pfnCodecNodeReset(pThis, i, &pThis->paNodes[i]); 2772 2768 2773 hdaCodecToAudVolume(pThis, &pThis->paNodes[pThis->u8DacLineOut].dac.B_params, PDMAUDIOMIXERCTL_PCM);2769 hdaCodecToAudVolume(pThis, &pThis->paNodes[pThis->u8DacLineOut].dac.B_params, PDMAUDIOMIXERCTL_PCM); 2774 2770 hdaCodecToAudVolume(pThis, &pThis->paNodes[pThis->u8AdcVolsLineIn].adcvol.B_params, PDMAUDIOMIXERCTL_LINE_IN); 2775 2771
Note:
See TracChangeset
for help on using the changeset viewer.