- Timestamp:
- Oct 27, 2010 8:31:55 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevCodec.cpp
r33400 r33482 1909 1909 AUD_register_card ("ICH0", &pState->card); 1910 1910 1911 /* @todo: AFG:f00[0xA] -> quemu's voices */ 1912 1911 /* 44.1 kHz */ 1913 1912 as.freq = 44100; 1914 1913 as.nchannels = 2; … … 1919 1918 AUDIO_FORMAT_SELECTOR((pState), Out, (base), (mult), div) = AUD_open_out(&(pState)->card, \ 1920 1919 AUDIO_FORMAT_SELECTOR(pState, Out, (base), (mult), (div)), name ".out", (pState), (out_callback), &(as)); \ 1921 Assert(AUDIO_FORMAT_SELECTOR(pState, Out, (base), (mult), (div))); \1922 1920 if (!AUDIO_FORMAT_SELECTOR(pState, Out, (base), (mult), (div))) \ 1923 1921 LogRel (("HDAcodec: WARNING: Unable to open PCM OUT(%s)!\n", name ".out")); \ 1924 1922 AUDIO_FORMAT_SELECTOR(pState, In, (base), (mult), (div)) = AUD_open_in(&(pState)->card, \ 1925 1923 AUDIO_FORMAT_SELECTOR(pState, In, (base), (mult), (div)), name ".in", (pState), (in_callback), &(as)); \ 1926 Assert(AUDIO_FORMAT_SELECTOR((pState), In, (base), (mult), (div))); \1927 1924 if (!AUDIO_FORMAT_SELECTOR(pState, In, (base), (mult), (div))) \ 1928 1925 LogRel (("HDAcodec: WARNING: Unable to open PCM IN(%s)!\n", name ".in")); \ 1929 1926 } while(0) 1927 #define IS_FORMAT_SUPPORTED_BY_HOST(pState, base, mult, div) (AUDIO_FORMAT_SELECTOR((pState), Out, (base), (mult), (div)) \ 1928 && AUDIO_FORMAT_SELECTOR((pState), In, (base), (mult), (div))) 1930 1929 1930 pState->pNodes[1].node.au32F00_param[0xA] = RT_BIT(17); /* 16-bit samples */ 1931 1931 SETUP_AUDIO_FORMAT(pState, AFMT_HZ_44_1K, AFMT_MULT_X1, AFMT_DIV_X1, "hda44_1", as, pi_callback, po_callback); 1932 pState->pNodes[1].node.au32F00_param[0xA] = RT_BIT(17)|RT_BIT(5);1932 pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_44_1K, AFMT_MULT_X1, AFMT_MULT_X1) ? RT_BIT(5) : 0; 1933 1933 1934 1934 #ifdef VBOX_WITH_AUDIO_FLEXIBLE_FORMAT 1935 1935 as.freq *= 2; /* 2 * 44.1kHz */ 1936 1936 SETUP_AUDIO_FORMAT(pState, AFMT_HZ_44_1K, AFMT_MULT_X2, AFMT_DIV_X1, "hda44_1_2x", as, pi_callback, po_callback); 1937 pState->pNodes[1].node.au32F00_param[0xA] |= RT_BIT(7);1937 pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_44_1K, AFMT_MULT_X2, AFMT_MULT_X1) ? RT_BIT(7) : 0; 1938 1938 1939 1939 as.freq *= 2; /* 4 * 44.1kHz */ 1940 1940 SETUP_AUDIO_FORMAT(pState, AFMT_HZ_44_1K, AFMT_MULT_X4, AFMT_DIV_X1, "hda44_1_4x", as, pi_callback, po_callback); 1941 pState->pNodes[1].node.au32F00_param[0xA] |= RT_BIT(9);1941 pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_44_1K, AFMT_MULT_X4, AFMT_MULT_X1) ? RT_BIT(9) : 0; 1942 1942 1943 1943 as.freq = 48000; 1944 1944 SETUP_AUDIO_FORMAT(pState, AFMT_HZ_48K, AFMT_MULT_X1, AFMT_DIV_X1, "hda48", as, pi_callback, po_callback); 1945 pState->pNodes[1].node.au32F00_param[0xA] |= RT_BIT(6);1945 pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_48K, AFMT_MULT_X1, AFMT_MULT_X1) ? RT_BIT(6) : 0; 1946 1946 1947 1947 # if 0 1948 1948 as.freq *= 2; /* 2 * 48kHz */ 1949 1949 SETUP_AUDIO_FORMAT(pState, AFMT_HZ_48K, AFMT_MULT_X2, AFMT_DIV_X1, "hda48_2x", as, pi_callback, po_callback); 1950 pState->pNodes[1].node.au32F00_param[0xA] |= RT_BIT(8);1950 pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_48K, AFMT_MULT_X2, AFMT_MULT_X1) ? RT_BIT(8) : 0; 1951 1951 1952 1952 as.freq *= 2; /* 4 * 48kHz */ 1953 1953 SETUP_AUDIO_FORMAT(pState, AFMT_HZ_48K, AFMT_MULT_X4, AFMT_DIV_X1, "hda48_4x", as, pi_callback, po_callback); 1954 pState->pNodes[1].node.au32F00_param[0xA] |= RT_BIT(10);1954 pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_48K, AFMT_MULT_X4, AFMT_MULT_X1) ? RT_BIT(10) : 0; 1955 1955 # endif 1956 1956 #endif 1957 1957 #undef SETUP_AUDIO_FORMAT 1958 #undef IS_FORMAT_SUPPORTED_BY_HOST 1958 1959 1959 1960 codecToAudVolume(&pState->pNodes[pState->u8DacLineOut].dac.B_params, AUD_MIXER_VOLUME);
Note:
See TracChangeset
for help on using the changeset viewer.