Changeset 82421 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Dec 5, 2019 2:08:43 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r82417 r82421 4231 4231 4232 4232 /** 4233 * @callback_method_impl{FNDBGFHANDLERDEV }4233 * @callback_method_impl{FNDBGFHANDLERDEV, hdastream} 4234 4234 */ 4235 4235 static DECLCALLBACK(void) hdaR3DbgInfoStream(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) … … 4245 4245 4246 4246 /** 4247 * @callback_method_impl{FNDBGFHANDLERDEV }4247 * @callback_method_impl{FNDBGFHANDLERDEV, hdabdle} 4248 4248 */ 4249 4249 static DECLCALLBACK(void) hdaR3DbgInfoBDLE(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) … … 4259 4259 4260 4260 /** 4261 * @callback_method_impl{FNDBGFHANDLERDEV }4261 * @callback_method_impl{FNDBGFHANDLERDEV, hdcnodes} 4262 4262 */ 4263 4263 static DECLCALLBACK(void) hdaR3DbgInfoCodecNodes(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) … … 4272 4272 4273 4273 /** 4274 * @callback_method_impl{FNDBGFHANDLERDEV }4274 * @callback_method_impl{FNDBGFHANDLERDEV, hdcselector} 4275 4275 */ 4276 4276 static DECLCALLBACK(void) hdaR3DbgInfoCodecSelector(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) … … 4285 4285 4286 4286 /** 4287 * @callback_method_impl{FNDBGFHANDLERDEV }4287 * @callback_method_impl{FNDBGFHANDLERDEV, hdamixer} 4288 4288 */ 4289 4289 static DECLCALLBACK(void) hdaR3DbgInfoMixer(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) -
trunk/src/VBox/Devices/Audio/DevHDA.h
r82417 r82421 68 68 69 69 /** @todo Make STAM values out of this? */ 70 typedef struct HDASTATED BGINFO70 typedef struct HDASTATEDEBUG 71 71 { 72 72 #ifdef DEBUG … … 98 98 * Defaults to VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH. */ 99 99 char szOutPath[RTPATH_MAX + 1]; 100 } HDASTATED BGINFO, *PHDASTATEDBGINFO;100 } HDASTATEDEBUG; 101 101 102 102 /** … … 192 192 /** Padding for alignment. */ 193 193 uint8_t au8Padding3[3]; 194 HDASTATEDBGINFO Dbg; 194 /** Debug stuff. */ 195 HDASTATEDEBUG Dbg; 195 196 196 197 /** PCI Region \#0: 16KB of MMIO stuff. */ -
trunk/src/VBox/Devices/Audio/HDACodec.cpp
r82417 r82421 2768 2768 }; 2769 2769 2770 #ifdef DEBUG 2771 typedef struct CODECDBGINFO 2770 2771 /** 2772 * CODEC debug info item printing state. 2773 */ 2774 typedef struct CODECDEBUG 2772 2775 { 2773 2776 /** DBGF info helpers. */ … … 2777 2780 /** Pointer to codec state. */ 2778 2781 PHDACODEC pThis; 2779 2780 } CODECDBGINFO, *PCODECDBGINFO; 2781 2782 #define CODECDBG_INDENT pInfo->uLevel++; 2783 #define CODECDBG_UNINDENT if (pInfo->uLevel) pInfo->uLevel--; 2784 2785 #define CODECDBG_PRINT(...) pInfo->pHlp->pfnPrintf(pInfo->pHlp, __VA_ARGS__) 2786 #define CODECDBG_PRINTI(...) codecDbgPrintf(pInfo, __VA_ARGS__) 2787 2788 static void codecDbgPrintfIndentV(PCODECDBGINFO pInfo, uint16_t uIndent, const char *pszFormat, va_list va) 2789 { 2790 char *pszValueFormat; 2791 if (RTStrAPrintfV(&pszValueFormat, pszFormat, va)) 2792 { 2793 pInfo->pHlp->pfnPrintf(pInfo->pHlp, "%*s%s", uIndent, "", pszValueFormat); 2794 RTStrFree(pszValueFormat); 2795 } 2796 } 2797 2798 static void codecDbgPrintf(PCODECDBGINFO pInfo, const char *pszFormat, ...) 2782 } CODECDEBUG; 2783 /** Pointer to the debug info item printing state for the codec. */ 2784 typedef CODECDEBUG *PCODECDEBUG; 2785 2786 #define CODECDBG_INDENT pInfo->uLevel++; 2787 #define CODECDBG_UNINDENT if (pInfo->uLevel) pInfo->uLevel--; 2788 2789 #define CODECDBG_PRINT(...) pInfo->pHlp->pfnPrintf(pInfo->pHlp, __VA_ARGS__) 2790 #define CODECDBG_PRINTI(...) codecDbgPrintf(pInfo, __VA_ARGS__) 2791 2792 /** Wrapper around DBGFINFOHLP::pfnPrintf that adds identation. */ 2793 static void codecDbgPrintf(PCODECDEBUG pInfo, const char *pszFormat, ...) 2799 2794 { 2800 2795 va_list va; 2801 2796 va_start(va, pszFormat); 2802 codecDbgPrintfIndentV(pInfo, pInfo->uLevel * 4, pszFormat,va);2797 pInfo->pHlp->pfnPrintf(pInfo->pHlp, "%*s%N", pInfo->uLevel * 4, "", pszFormat, &va); 2803 2798 va_end(va); 2804 2799 } 2805 2800 2806 /* Power state */2807 static void codecDbgPrintNodeRegF05(PCODECD BGINFOpInfo, uint32_t u32Reg)2801 /** Power state */ 2802 static void codecDbgPrintNodeRegF05(PCODECDEBUG pInfo, uint32_t u32Reg) 2808 2803 { 2809 2804 codecDbgPrintf(pInfo, "Power (F05): fReset=%RTbool, fStopOk=%RTbool, Set=%RU8, Act=%RU8\n", … … 2811 2806 } 2812 2807 2813 static void codecDbgPrintNodeRegA(PCODECD BGINFOpInfo, uint32_t u32Reg)2808 static void codecDbgPrintNodeRegA(PCODECDEBUG pInfo, uint32_t u32Reg) 2814 2809 { 2815 2810 codecDbgPrintf(pInfo, "RegA: %x\n", u32Reg); 2816 2811 } 2817 2812 2818 static void codecDbgPrintNodeRegF00(PCODECD BGINFOpInfo, uint32_t *paReg00)2813 static void codecDbgPrintNodeRegF00(PCODECDEBUG pInfo, uint32_t *paReg00) 2819 2814 { 2820 2815 codecDbgPrintf(pInfo, "Parameters (F00):\n"); … … 2841 2836 } 2842 2837 2843 static void codecDbgPrintNodeAmp(PCODECD BGINFOpInfo, uint32_t *paReg, uint8_t uIdx, uint8_t uDir)2844 { 2845 # define CODECDBG_AMP(reg, chan) \2846 codecDbgPrintf(pInfo, "Amp %RU8 %s %s: In=%RTbool, Out=%RTbool, Left=%RTbool, Right=%RTbool, Idx=%RU8, fMute=%RTbool, uGain=%RU8\n", \2847 uIdx, chan, uDir == AMPLIFIER_IN ? "In" : "Out", \2848 RT_BOOL(CODEC_SET_AMP_IS_IN_DIRECTION(reg)), RT_BOOL(CODEC_SET_AMP_IS_OUT_DIRECTION(reg)), \2849 RT_BOOL(CODEC_SET_AMP_IS_LEFT_SIDE(reg)), RT_BOOL(CODEC_SET_AMP_IS_RIGHT_SIDE(reg)), \2850 CODEC_SET_AMP_INDEX(reg), RT_BOOL(CODEC_SET_AMP_MUTE(reg)), CODEC_SET_AMP_GAIN(reg));2838 static void codecDbgPrintNodeAmp(PCODECDEBUG pInfo, uint32_t *paReg, uint8_t uIdx, uint8_t uDir) 2839 { 2840 # define CODECDBG_AMP(reg, chan) \ 2841 codecDbgPrintf(pInfo, "Amp %RU8 %s %s: In=%RTbool, Out=%RTbool, Left=%RTbool, Right=%RTbool, Idx=%RU8, fMute=%RTbool, uGain=%RU8\n", \ 2842 uIdx, chan, uDir == AMPLIFIER_IN ? "In" : "Out", \ 2843 RT_BOOL(CODEC_SET_AMP_IS_IN_DIRECTION(reg)), RT_BOOL(CODEC_SET_AMP_IS_OUT_DIRECTION(reg)), \ 2844 RT_BOOL(CODEC_SET_AMP_IS_LEFT_SIDE(reg)), RT_BOOL(CODEC_SET_AMP_IS_RIGHT_SIDE(reg)), \ 2845 CODEC_SET_AMP_INDEX(reg), RT_BOOL(CODEC_SET_AMP_MUTE(reg)), CODEC_SET_AMP_GAIN(reg)) 2851 2846 2852 2847 uint32_t regAmp = AMPLIFIER_REGISTER(paReg, uDir, AMPLIFIER_LEFT, uIdx); … … 2855 2850 CODECDBG_AMP(regAmp, "Right"); 2856 2851 2857 # undef CODECDBG_AMP2858 } 2859 2860 # if 0 /* unused */2861 static void codecDbgPrintNodeConnections(PCODECD BGINFOpInfo, PCODECNODE pNode)2852 # undef CODECDBG_AMP 2853 } 2854 2855 # if 0 /* unused */ 2856 static void codecDbgPrintNodeConnections(PCODECDEBUG pInfo, PCODECNODE pNode) 2862 2857 { 2863 2858 if (pNode->node.au32F00_param[0xE] == 0) /* Directly connected to HDA link. */ … … 2867 2862 } 2868 2863 } 2869 # endif2870 2871 static void codecDbgPrintNode(PCODECD BGINFOpInfo, PCODECNODE pNode, bool fRecursive)2864 # endif 2865 2866 static void codecDbgPrintNode(PCODECDEBUG pInfo, PCODECNODE pNode, bool fRecursive) 2872 2867 { 2873 2868 codecDbgPrintf(pInfo, "Node 0x%02x (%02RU8): ", pNode->node.uID, pNode->node.uID); … … 2928 2923 } 2929 2924 else if (hdaCodecIsPcbeepNode(pInfo->pThis, pNode->node.uID)) 2930 {2931 2925 CODECDBG_PRINT("PC BEEP\n"); 2932 }2933 2926 else if (hdaCodecIsSpdifOutNode(pInfo->pThis, pNode->node.uID)) 2934 {2935 2927 CODECDBG_PRINT("SPDIF OUT\n"); 2936 }2937 2928 else if (hdaCodecIsSpdifInNode(pInfo->pThis, pNode->node.uID)) 2938 {2939 2929 CODECDBG_PRINT("SPDIF IN\n"); 2940 }2941 2930 else if (hdaCodecIsDigInPinNode(pInfo->pThis, pNode->node.uID)) 2942 {2943 2931 CODECDBG_PRINT("DIGITAL IN PIN\n"); 2944 }2945 2932 else if (hdaCodecIsDigOutPinNode(pInfo->pThis, pNode->node.uID)) 2946 {2947 2933 CODECDBG_PRINT("DIGITAL OUT PIN\n"); 2948 }2949 2934 else if (hdaCodecIsCdNode(pInfo->pThis, pNode->node.uID)) 2950 {2951 2935 CODECDBG_PRINT("CD\n"); 2952 }2953 2936 else if (hdaCodecIsVolKnobNode(pInfo->pThis, pNode->node.uID)) 2954 {2955 2937 CODECDBG_PRINT("VOLUME KNOB\n"); 2956 }2957 2938 else if (hdaCodecIsReservedNode(pInfo->pThis, pNode->node.uID)) 2958 {2959 2939 CODECDBG_PRINT("RESERVED\n"); 2960 }2961 2940 else 2962 2941 CODECDBG_PRINT("UNKNOWN TYPE 0x%x\n", pNode->node.uID); … … 2964 2943 if (fRecursive) 2965 2944 { 2966 # define CODECDBG_PRINT_CONLIST_ENTRY(_aNode, _aEntry)\2967 if (cCnt >= _aEntry)\2968 {\2969 const uint8_t uID = RT_BYTE##_aEntry(_aNode->node.au32F02_param[0x0]); \2970 if (pNode->node.uID == uID)\2971 codecDbgPrintNode(pInfo, _aNode, false /* fRecursive */);\2972 }2945 # define CODECDBG_PRINT_CONLIST_ENTRY(_aNode, _aEntry) \ 2946 if (cCnt >= _aEntry) \ 2947 { \ 2948 const uint8_t uID = RT_BYTE##_aEntry(_aNode->node.au32F02_param[0x0]); \ 2949 if (pNode->node.uID == uID) \ 2950 codecDbgPrintNode(pInfo, _aNode, false /* fRecursive */); \ 2951 } 2973 2952 2974 2953 /* Slow recursion, but this is debug stuff anyway. */ … … 2991 2970 } 2992 2971 2993 # undef CODECDBG_PRINT_CONLIST_ENTRY2972 # undef CODECDBG_PRINT_CONLIST_ENTRY 2994 2973 } 2995 2974 } … … 3000 2979 pHlp->pfnPrintf(pHlp, "HDA LINK / INPUTS\n"); 3001 2980 3002 CODECD BGINFOdbgInfo;2981 CODECDEBUG dbgInfo; 3003 2982 dbgInfo.pHlp = pHlp; 3004 2983 dbgInfo.pThis = pThis; 3005 2984 dbgInfo.uLevel = 0; 3006 2985 3007 PCODECD BGINFOpInfo = &dbgInfo;2986 PCODECDEBUG pInfo = &dbgInfo; 3008 2987 3009 2988 CODECDBG_INDENT … … 3019 2998 } 3020 2999 3000 #ifdef DEBUG 3001 3021 3002 static DECLCALLBACK(void) codecDbgSelector(PHDACODEC pThis, PCDBGFINFOHLP pHlp, const char *pszArgs) 3022 3003 { 3023 3004 RT_NOREF(pThis, pHlp, pszArgs); 3024 3005 } 3025 #endif 3006 3007 #endif /* DEBUG */ 3026 3008 3027 3009 static DECLCALLBACK(int) codecLookup(PHDACODEC pThis, uint32_t cmd, uint64_t *puResp) … … 3251 3233 #ifdef DEBUG 3252 3234 pThis->pfnDbgSelector = codecDbgSelector; 3235 #endif 3253 3236 pThis->pfnDbgListNodes = codecDbgListNodes; 3254 #endif3255 3237 pThis->pfnLookup = codecLookup; 3256 3238
Note:
See TracChangeset
for help on using the changeset viewer.