HDMI/DP Audio support Under Linux

本文提供了一步一步的指南来解决 Ubuntu 10.10 系统中 NVIDIA 显卡 HDMI 音频输出的问题。从安装必要的专有驱动开始,到确认系统的 HDMI 音频设备,再到配置 ALSA 和 PulseAudio 设置,最后测试音频输出。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://ubuntuforums.org/showthread.php?t=1668737

  1. HOWTO: Ubuntu 10.10 Nvidia hdmi audio
  2. Although this information is present in this forum in bits and pieces a new nvidia hdmi audio thread pops up every couple days.

    So for simplicity sake here's my attempt and a very simple howto instead of editing re-editing and reposting old information.

    First make sure you have nvidia proprietary drivers installed. hdmi audio does not work with nouveau/opensource. Open a terminal. Applications -> Accessories ->Terminal.

    Now type:

    Code:
    cat /proc/driver/nvidia/version
    You should see something like this.
    Code:
    NVRM version: NVIDIA UNIX x86 Kernel Module  260.19.06  Mon Sep 13 06:35:06 PDT 2010
    GCC version:  gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)
    If not go install the nvidia proprietary driver via System -> Administration -> Additional Drivers.




    NVIDIA HDMI AUDIO Ubuntu 10.10

    Begin by reading this (it's ok if you don't understand it but you should be aware of this post): http://www.nvnews.net/vbulletin/show...20&postcount=7

    Step 1) To start confirm that your system can see your nvidia hdmi audio card. Type aplay -l in a terminal. You should see something like this.

    Code:
    aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 0: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 1: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 1: NVidia [HDA NVidia], device 7: NVIDIA HDMI [NVIDIA HDMI]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 1: NVidia [HDA NVidia], device 8: NVIDIA HDMI [NVIDIA HDMI]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 1: NVidia [HDA NVidia], device 9: NVIDIA HDMI [NVIDIA HDMI]
      Subdevices: 0/1
      Subdevice #0: subdevice #0
    If you do not see a nvidia sound device you need to upgrade to a properly patched alsa 1.0.23 or 2.6.35+ kernel. For the fact that it is often not required nowdays I'll leave that out of this howto. Follow this link to upgrade alsa https://wiki.ubuntu.com/Audio/Instal...aDriverModules


    Step 2) Confirm which device is responsible for hdmi audio.

    Open a terminal and type:

    Code:
    grep eld_valid /proc/asound/NVidia/eld*
    You'll see an output like this:

    Code:
    /proc/asound/NVidia/eld#0.0:eld_valid        0
    /proc/asound/NVidia/eld#1.0:eld_valid        0
    /proc/asound/NVidia/eld#2.0:eld_valid        0
    /proc/asound/NVidia/eld#3.0:eld_valid        1
    The line that returns eld_valid 1 is the device responsible for hdmi audio on your nvidia card and has recognized that there is a connection.

    If you don't receive a 1 for one of the devices you need to return to Step 1) and ensure you have a properly patched alsa 1.0.23 or 2.6.35+ kernel. This may also be the fault of the system not acquiring EDID data from your hdmi connection. Inability to acquire an EDID will also result in resolution issues so you should move onto resolving this issue before setting up hdmi audio. You can confirm your system has acquired an EDID from the connection by checking your /var/log/Xorg.0.log file.

    UPDATE: http://http.download.nvidia.com/XFre...dmi-audio.html
    According to the above:

    13.5. Verify Your ELD Is Valid
    To validate that the ALSA driver is aware of your monitor, check the eld files. Recall that older chipsets (ION and earlier) don’t support ELD reporting, and hence the ELD files will not exist. In this case, ALSA always assumes that all audio features are available
    Therefore if you don't receive any eld information you may just have an older card that doesn't support reporting. You will then have to manually test each device with aplay to determine which device is responsible for audio.

    eg.
    Code:
    aplay -D plughw:NVidia,3 /usr/share/sounds/alsa/Front_Center.wav
    aplay -D plughw:NVidia,7 /usr/share/sounds/alsa/Front_Center.wav
    aplay -D plughw:NVidia,8 /usr/share/sounds/alsa/Front_Center.wav
    aplay -D plughw:NVidia,9 /usr/share/sounds/alsa/Front_Center.wav
    Step 3) Use a probemask to enable the proper codec for hdmi:NVidia.

    eld#0.0=device 3 probe_mask=0x101
    eld#1.0=device 7 probe_mask=0x102
    eld#2.0=device 8 probe_mask=0x104
    eld#3.0=device 9 probe_mask=0x108

    Edit or create a /etc/modprobe.d/sound.conf file. Type the following in a terminal:

    Code:
    gksudo gedit /etc/modprobe.d/sound.conf
    add the proper options snd-hda-intel probe_mask line to this file (this example uses device 9)

    Code:
    options snd-hda-intel probe_mask=0x108
    Save the file and update the initramfs to make sure this change will be used upon reboot.

    Code:
    sudo update-initramfs -u


    UPDATE: see this post for more information on probe_masks.
    http://ubuntuforums.org/showpost.php...8&postcount=21


    Step 4)
    Edit your pulseaudio default.pa file. **Note if you do not have pulseaudio installed just add pcm.!default hdmi:NVidia to your /etc/asound.conf file remove any .asoundrc file and reboot as in this post http://ubuntuforums.org/showpost.php...2&postcount=11

    If you have pulseaudio installed continue with the following edit.

    Code:
    gksudo gedit /etc/pulse/default.pa
    Find the static alsa sink line:

    Code:
    ### Load audio drivers statically (it's probably better to not load
    ### these drivers manually, but instead use module-hal-detect --
    ### see below -- for doing this automatically)
    #load-module module-alsa-sink
    #load-module module-alsa-source device=hw:1,0
    #load-module module-oss device="/dev/dsp" sink_name=output source_name=input
    #load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
    #load-module module-null-sink
    #load-module module-pipe-sink
    Add load-module module-alsa-sink device=hdmi:NVidia to the end of the section:

    Code:
    ### Load audio drivers statically (it's probably better to not load
    ### these drivers manually, but instead use module-hal-detect --
    ### see below -- for doing this automatically)
    #load-module module-alsa-sink
    #load-module module-alsa-source device=hw:1,0
    #load-module module-oss device="/dev/dsp" sink_name=output source_name=input
    #load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
    #load-module module-null-sink
    #load-module module-pipe-sink
    load-module module-alsa-sink device=hdmi:NVidia
    Remove any local pulseaudio/alsa settings to ensure this new default.pa systemwide setting will be used. Type the following in a terminal.

    Code:
    rm -r ~/.pulse ~/.asound* ~/.pulse-cookie


    Step 5)
    Reboot the computer and you should now be able to use the standard hdmi audio connection or the hdmi device via hdmi:NVidia.

    If not try unmuting the device in alsamixer then test it again.

    Code:
    alsamixer
    MM denotes muted 00 is unmuted, m is the toggle, f6 to switch cards.

    To test the probemask after the reboot do the following:

    Code:
    aplay -Dhdmi:NVidia /usr/share/sounds/alsa/Front_Center.wav
    If you receive audio with the aplay command but not at your desktop your pulseaudio or local settings are probably incorrect.



    If you have problems with this probemask method you will have to resort to editing default.pa and possibly asound.conf listing the explicit card# and device # for your hdmi audio eg. hw:1,9 or hw:NVidia,9

    If anybody sees something wrong with this process let me know and I'll correct it asap.
    1. Last edited by tjones00; February 17th, 2011 at 09:45 AM.Reason: added alsa upgrade link, foolproof default.pa mod. eld failure information                                         

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!-- Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved. SPDX-License-Identifier: BSD-3-Clause-Clear --> <modules> <module name="default"> <mixPorts> <!-- based on role, mixport flags are identified as either input flags or output flags--> <!-- start of source mixports--> <mixPort name="low_latency_out" role="source" flags="FAST PRIMARY" maxOpenCount="2" maxActiveCount="2"> <!-- #ifndef OPLUS_FEATURE_PLAYBACK_24BIT // Jianfeng.Qiu@MULTIMEDIA.AUDIODRIVER.HAL, 2024/05/15, Modify for support playback with 24bits <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> #else /* OPLUS_FEATURE_PLAYBACK_24BIT */--> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_24_BIT" /> <!-- #endif OPLUS_FEATURE_PLAYBACK_24BIT --> </mixPort> <mixPort name="raw_out" role="source" flags="FAST RAW"> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_24_BIT" /> </mixPort> <mixPort name="haptics_out" role="source"> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO_HAPTIC_A" formatType="PCM" pcmType="INT_16_BIT" /> </mixPort> <mixPort name="deep_buffer_out" role="source" flags="DEEP_BUFFER"> <!-- #ifndef OPLUS_FEATURE_PLAYBACK_24BIT // Jianfeng.Qiu@MULTIMEDIA.AUDIODRIVER.HAL, 2024/05/15, Modify for support playback with 24bits <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="FIXED_Q_8_24" /> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_24_BIT" /> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_32_BIT" /> #else /* OPLUS_FEATURE_PLAYBACK_24BIT */ --> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_24_BIT" /> <!-- #endif OPLUS_FEATURE_PLAYBACK_24BIT --> </mixPort> <mixPort name="mmap_no_irq_out" role="source" flags="DIRECT MMAP_NOIRQ"> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="FIXED_Q_8_24" /> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_24_BIT" /> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_32_BIT" /> </mixPort> <mixPort name="hifi_playback" role="source"> </mixPort> <!-- #ifndef OPLUS_FEATURE_SPATIALIZER_AUDIO // Jianfeng.Qiu@MULTIMEDIA.AUDIODRIVER.HAL, 2024/05/15, disalbe aosp spatial output instead with oplus's <mixPort name="spatial_out" role="source" flags="SPATIALIZER"> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </mixPort> #else /* OPLUS_FEATURE_SPATIALIZER_AUDIO */ --> <mixPort name="spatializer" role="source" flags="SPATIALIZER"> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_24_BIT" /> </mixPort> <!-- #endif OPLUS_FEATURE_SPATIALIZER_AUDIO --> <mixPort name="direct_pcm_out" role="source" flags="DIRECT" recommendedMuteDurationMs="160"> <!-- #ifndef OPLUS_ARCH_EXTENDS --> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="FIXED_Q_8_24" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_24_BIT" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_32_BIT" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="FLOAT_32_BIT" /> <!-- #else /* OPLUS_ARCH_EXTENDS */ <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_2POINT1 LAYOUT_QUAD LAYOUT_PENTA LAYOUT_5POINT1 LAYOUT_6POINT1 LAYOUT_7POINT1" formatType="PCM" pcmType="INT_16_BIT" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_2POINT1 LAYOUT_QUAD LAYOUT_PENTA LAYOUT_5POINT1 LAYOUT_6POINT1 LAYOUT_7POINT1" formatType="PCM" pcmType="FIXED_Q_8_24" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_2POINT1 LAYOUT_QUAD LAYOUT_PENTA LAYOUT_5POINT1 LAYOUT_6POINT1 LAYOUT_7POINT1" formatType="PCM" pcmType="INT_24_BIT" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_2POINT1 LAYOUT_QUAD LAYOUT_PENTA LAYOUT_5POINT1 LAYOUT_6POINT1 LAYOUT_7POINT1" formatType="PCM" pcmType="INT_32_BIT" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_2POINT1 LAYOUT_QUAD LAYOUT_PENTA LAYOUT_5POINT1 LAYOUT_6POINT1 LAYOUT_7POINT1" formatType="PCM" pcmType="FLOAT_32_BIT" /> --> </mixPort> <mixPort name="compress_offload_out" role="source" flags="DIRECT COMPRESS_OFFLOAD NON_BLOCKING GAPLESS_OFFLOAD"> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO" formatType="NON_PCM" encoding="audio/mpeg" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO" formatType="NON_PCM" encoding="audio/flac" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_2POINT1 LAYOUT_QUAD LAYOUT_PENTA LAYOUT_5POINT1 LAYOUT_6POINT1 LAYOUT_7POINT1" formatType="NON_PCM" encoding="audio/alac" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO" formatType="NON_PCM" encoding="audio/x-ape" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO" formatType="NON_PCM" encoding="audio/mp4a.40.02" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO" formatType="NON_PCM" encoding="audio/mp4a.40.05" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO" formatType="NON_PCM" encoding="audio/mp4a.40.29" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO" formatType="NON_PCM" encoding="audio/vorbis" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_2POINT1 LAYOUT_QUAD LAYOUT_PENTA LAYOUT_5POINT1 LAYOUT_6POINT1 LAYOUT_7POINT1" formatType="NON_PCM" encoding="audio/x-ms-wma" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_2POINT1 LAYOUT_QUAD LAYOUT_PENTA LAYOUT_5POINT1 LAYOUT_6POINT1 LAYOUT_7POINT1" formatType="NON_PCM" encoding="audio/x-ms-wma.pro" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO" formatType="NON_PCM" encoding="audio/aac-adts.02" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO" formatType="NON_PCM" encoding="audio/aac-adts.05" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO" formatType="NON_PCM" encoding="audio/aac-adts.29" /> <profile samplingRates="8000 12000 16000 24000 48000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO" formatType="NON_PCM" encoding="audio/opus" /> </mixPort> <mixPort name="voice_tx" role="source"> <profile samplingRates="8000 16000 32000 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </mixPort> <mixPort name="voip_playback" role="source" flags="VOIP_RX"> <profile samplingRates="8000 16000 32000 48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </mixPort> <mixPort name="in_call_music" role="source" flags="INCALL_MUSIC"> <profile samplingRates="8000 16000 32000 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </mixPort> <!-- end of source mixports--> <!-- start of sink mixports--> <mixPort name="primary_in" role="sink" maxOpenCount="2" maxActiveCount="2"> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_FRONT_BACK" formatType="PCM" pcmType="INT_16_BIT" /> </mixPort> <!-- #ifndef OPLUS_BUG_STABILITY // Jianfeng.Qiu@MULTIMEDIA.AUDIODRIVER.HAL, 2024/05/15, Remove compress-input avoid camera record stop fail <mixPort name="compress_in" role="sink" flags="DIRECT"> <profile name="compress-capture-AAC-LC" samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO LAYOUT_FRONT_BACK" formatType="NON_PCM" encoding="audio/mp4a.40.02" /> <profile name="compress-capture-AAC-HE-V1" samplingRates="24000 32000 44100 48000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO LAYOUT_FRONT_BACK" formatType="NON_PCM" encoding="audio/aac-adts.05" /> <profile name="compress-capture-AAC-HE-V2" samplingRates="24000 32000 44100 48000" channelLayouts="LAYOUT_STEREO" formatType="NON_PCM" encoding="audio/aac-adts.29" /> </mixPort> #endif OPLUS_BUG_STABILITY --> <mixPort name="fast_input" role="sink" flags="FAST"> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_2POINT1 LAYOUT_2POINT0POINT2 LAYOUT_3POINT0POINT2 LAYOUT_5POINT1" channelMasks="INDEX_MASK_3" formatType="PCM" pcmType="INT_16_BIT" /> </mixPort> <mixPort name="fast_raw_input" role="sink" flags="FAST RAW"> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_2POINT1 LAYOUT_2POINT0POINT2 LAYOUT_3POINT0POINT2 LAYOUT_5POINT1" channelMasks="INDEX_MASK_3" formatType="PCM" pcmType="INT_16_BIT" /> </mixPort> <mixPort name="voip_record" role="sink" flags="VOIP_TX"> <profile samplingRates="8000 16000 32000 48000" channelLayouts="LAYOUT_MONO" formatType="PCM" pcmType="INT_16_BIT" /> </mixPort> <mixPort name="usb_surround_sound_input" role="sink"> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 88200 96000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_FRONT_BACK LAYOUT_5POINT1" channelMasks="INDEX_MASK_3 INDEX_MASK_4 INDEX_MASK_6 INDEX_MASK_8" formatType="PCM" pcmType="INT_16_BIT" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 88200 96000 176400 192000" channelLayouts="LAYOUT_5POINT1" channelMasks="INDEX_MASK_6 INDEX_MASK_8" formatType="PCM" pcmType="INT_32_BIT" /> <!-- #ifndef OPLUS_BUG_STABILITY // Jianfeng.Qiu@MULTIMEDIA.AUDIODRIVER.HAL, 2024/05/15, case:2588000, CR-3089619-gerrit-3904059-ps-3.patch fix USB Audio Peripheral Record Test issue <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 88200 96000 176400 192000" channelLayouts="LAYOUT_5POINT1" channelMasks="INDEX_MASK_6 INDEX_MASK_8" formatType="PCM" pcmType="FLOAT_32_BIT" /> #else /* OPLUS_BUG_STABILITY */ --> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 88200 96000 176400 192000" channelLayouts="LAYOUT_STEREO LAYOUT_5POINT1" channelMasks="INDEX_MASK_2 INDEX_MASK_6 INDEX_MASK_8" formatType="PCM" pcmType="FLOAT_32_BIT" /> <!-- #endif OPLUS_BUG_STABILITY --> </mixPort> <!-- #ifdef OPLUS_FEATURE_AEC_RECORD --> <!-- Jianfeng.Qiu@MULTIMEDIA.AUDIODRIVER.HAL, 2024/05/15, Add for 4ch aec --> <mixPort name="record_4ch_aec" role="sink"> <profile samplingRates="16000" channelLayouts="LAYOUT_2POINT0POINT2" formatType="PCM" pcmType="INT_16_BIT" /> </mixPort> <!-- #endif OPLUS_FEATURE_AEC_RECORD --> <!-- #ifdef OPLUS_FEATURE_OCAR_AUDIO --> <!-- Jianfeng.Qiu@MULTIMEDIA.AUDIODRIVER.HAL, 2024/05/15, Modify for support call record in ocar mode --> <!-- <mixPort name="voice_rx" role="sink"> --> <mixPort name="voice_rx" role="sink" maxOpenCount="2" maxActiveCount="2"> <!-- #endif OPLUS_FEATURE_OCAR_AUDIO --> <profile samplingRates="8000 16000 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </mixPort> <mixPort name="mmap_no_irq_in" role="sink" maxOpenCount="1" maxActiveCount="1" flags="MMAP_NOIRQ"> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_FRONT_BACK" channelMasks="INDEX_MASK_3" formatType="PCM" pcmType="INT_16_BIT" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_FRONT_BACK" channelMasks="INDEX_MASK_3" formatType="PCM" pcmType="INT_24_BIT" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_FRONT_BACK" channelMasks="INDEX_MASK_3" formatType="PCM" pcmType="FIXED_Q_8_24" /> </mixPort> <mixPort name="hotword_input" role="sink" flags="HW_HOTWORD"> <profile samplingRates="16000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </mixPort> <!-- end of sink mixports--> </mixPorts> <devicePorts> <!-- start of sink DEVICE PORT --> <devicePort tagName="earpiece" role="sink" attached="true" deviceType="OUT_SPEAKER_EARPIECE"> <profile samplingRates="48000" channelLayouts="LAYOUT_MONO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="speaker" role="sink" attached="true" defaultDevice="true" deviceType="OUT_SPEAKER"> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="wired_headset" deviceType="OUT_HEADSET" role="sink" connection="analog"> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="wired_headphones" deviceType="OUT_HEADPHONE" role="sink" connection="analog"> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="line_out" deviceType="OUT_DEVICE" role="sink" connection="analog"> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="bt_sco_out" deviceType="OUT_DEVICE" connection="bt-sco" role="sink"> <profile samplingRates="8000 48000" channelLayouts="LAYOUT_MONO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="bt_sco_headset" deviceType="OUT_HEADSET" connection="bt-sco" role="sink"> <profile samplingRates="8000 16000" channelLayouts="LAYOUT_MONO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="bt_sco_car_kit" deviceType="OUT_CARKIT" connection="bt-sco" role="sink"> <profile samplingRates="8000 16000" channelLayouts="LAYOUT_MONO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="telephony_tx" deviceType="OUT_TELEPHONY_TX" role="sink" attached="true"> <profile samplingRates="8000 16000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <!-- Todo check the sanity of below later w.r.t channel layouts --> <devicePort tagName="hdmi_out" deviceType="OUT_DEVICE" connection="hdmi" role="sink"> <profile samplingRates="8000 11025 16000 22050 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <!-- Todo check the sanity of below later w.r.t channel layouts --> <devicePort tagName="proxy_out" deviceType="OUT_AFE_PROXY" connection="virtual" role="sink"> <profile samplingRates="8000 11025 16000 22050 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <!-- OUT_DEVICE(ip-v4): Usage are not as per android expectation. Due to minimal use of device in regular use case, it is getting used for proxy device in playback usecase --> <devicePort tagName="ip_out" deviceType="OUT_DEVICE" connection="ip-v4" role="sink"> <profile samplingRates="8000 11025 16000 22050 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <!-- #ifdef OPLUS_BUG_STABILITY --> <!-- chenwenxiao@MULTIMEDIA.AUDIOSERVER.FRAMEWORK, 2024/08/08, Modify for link to window --> <!-- devicePort tagName="fm_out" deviceType="OUT_FM" role="sink" attached="true"> <profile samplingRates="48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort --> <!-- #endif OPLUS_BUG_STABILITY --> <devicePort tagName="bt_a2dp_out" deviceType="OUT_DEVICE" connection="bt-a2dp" role="sink" encodings="audio/x-sbc audio/mp4a.40 audio/aptx audio/vnd.qcom.aptx.hd audio/vnd.sony.ldac audio/x-celt audio/vnd.qcom.aptx.adaptive audio/vnd.qcom.aptx.twsp audio/x-lc3"> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="bt_a2dp_headphones" deviceType="OUT_HEADPHONE" connection="bt-a2dp" role="sink" encodings="audio/x-sbc audio/mp4a.40 audio/aptx audio/vnd.qcom.aptx.hd audio/vnd.sony.ldac audio/x-celt audio/vnd.qcom.aptx.adaptive audio/vnd.qcom.aptx.twsp audio/x-lc3"> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="bt_a2dp_speaker" deviceType="OUT_SPEAKER" connection="bt-a2dp" role="sink" encodings="audio/x-sbc audio/mp4a.40 audio/aptx audio/vnd.qcom.aptx.hd audio/vnd.sony.ldac audio/x-celt audio/vnd.qcom.aptx.adaptive audio/vnd.qcom.aptx.twsp audio/x-lc3"> <profile samplingRates="48000" channelLayouts="LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="bt_ble_headset" deviceType="OUT_HEADSET" connection="bt-le" role="sink" encodings="audio/x-lc3 audio/vnd.qcom.aptx.adaptive.r3 audio/vnd.qcom.aptx.adaptive.r4"> <profile samplingRates="8000 16000 32000 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="bt_ble_speaker" deviceType="OUT_SPEAKER" connection="bt-le" role="sink" encodings="audio/x-lc3 audio/vnd.qcom.aptx.adaptive.r3 audio/vnd.qcom.aptx.adaptive.r4"> <profile samplingRates="8000 16000 32000 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="bt_ble_broadcast" deviceType="OUT_BROADCAST" connection="bt-le" role="sink" encodings="audio/x-lc3"> <profile samplingRates="8000 16000 32000 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="usb_device_out" deviceType="OUT_DEVICE" connection="usb" role="sink"> <profile samplingRates="44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="usb_headset" deviceType="OUT_HEADSET" connection="usb" role="sink"> <profile samplingRates="44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <!-- end of sink DEVICE PORT --> <!-- start of source DEVICE PORT --> <devicePort tagName="built_in_mic" deviceType="IN_MICROPHONE" role="source" attached="true" defaultDevice="true" address="bottom"> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_FRONT_BACK" formatType="PCM" pcmType="INT_24_BIT" /> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_FRONT_BACK" formatType="PCM" pcmType="INT_16_BIT" /> <!-- To support compress offload capture such that client can query --> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_FRONT_BACK" formatType="NON_PCM" encoding="audio/mp4a.40.02" /> <profile samplingRates="24000 32000 44100 48000" channelLayouts="LAYOUT_STEREO LAYOUT_MONO LAYOUT_FRONT_BACK" formatType="NON_PCM" encoding="audio/aac-adts.05" /> <profile samplingRates="24000 32000 44100 48000" channelLayouts="LAYOUT_STEREO" formatType="NON_PCM" encoding="audio/aac-adts.29" /> </devicePort> <devicePort tagName="built_in_back_mic" deviceType="IN_MICROPHONE_BACK" role="source" attached="true" address="back"> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_FRONT_BACK" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <!-- #ifdef OPLUS_BUG_STABILITY --> <!-- chenwenxiao@MULTIMEDIA.AUDIOSERVER.FRAMEWORK, 2024/08/08, Modify for link to window --> <!-- <devicePort tagName="fm_tuner_mic" deviceType="IN_FM_TUNER" role="source" attached="true"> <profile samplingRates="48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> --> <!-- #endif OPLUS_BUG_STABILITY --> <devicePort tagName="wired_headset_mic" deviceType="IN_HEADSET" connection="analog" role="source"> <profile samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO LAYOUT_FRONT_BACK" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="proxy_input_device" deviceType="IN_AFE_PROXY" connection="virtual" role="source"> <profile samplingRates="8000 11025 16000 22050 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <!-- IN_DEVICE(ip-v4): Usage are not as per android expectation. Due to minimal use of device in regular use case, it is getting used for proxy device in record usecase --> <devicePort tagName="ip_input_device" deviceType="IN_DEVICE" connection="ip-v4" role="source"> <profile samplingRates="8000 11025 16000 22050 32000 44100 48000 64000 88200 96000 128000 176400 192000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="bt_sco_headset_mic" deviceType="IN_HEADSET" connection="bt-sco" role="source"> <profile samplingRates="8000 16000" channelLayouts="LAYOUT_MONO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="telephony_rx" deviceType="IN_TELEPHONY_RX" role="source" attached="true"> <profile samplingRates="8000 16000 48000" channelLayouts="LAYOUT_MONO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="usb_mic" deviceType="IN_DEVICE" connection="usb" role="source" > </devicePort> <devicePort tagName="usb_headset_mic" deviceType="IN_HEADSET" connection="usb" role="source" > </devicePort> <devicePort tagName="bt_a2dp_mic" deviceType="IN_DEVICE" connection="bt-a2dp" role="source" encodings="audio/x-lc3"> <profile samplingRates="44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="bt_le_mic" deviceType="IN_HEADSET" connection="bt-le" role="source" encodings="audio/x-lc3"> <profile samplingRates="8000 16000 24000 44100 48000" channelLayouts="LAYOUT_MONO LAYOUT_STEREO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <devicePort tagName="echo_reference_mic" deviceType="IN_ECHO_REFERENCE" role="source" attached="true"> <profile samplingRates="48000" channelLayouts="LAYOUT_MONO" formatType="PCM" pcmType="INT_16_BIT" /> </devicePort> <!-- end of source DEVICE PORT --> </devicePorts> <routes> <route type="mix" sink="earpiece" sources="low_latency_out,deep_buffer_out,direct_pcm_out,compress_offload_out,voip_playback,raw_out,mmap_no_irq_out,haptics_out,telephony_rx" /> <route type="mix" sink="speaker" sources="low_latency_out,deep_buffer_out,direct_pcm_out,compress_offload_out,voip_playback,raw_out,mmap_no_irq_out,haptics_out,telephony_rx,spatializer" /> <route type="mix" sink="wired_headset" sources="low_latency_out,deep_buffer_out,direct_pcm_out,compress_offload_out,voip_playback,raw_out,mmap_no_irq_out,haptics_out,telephony_rx,spatializer" /> <route type="mix" sink="wired_headphones" sources="low_latency_out,deep_buffer_out,direct_pcm_out,compress_offload_out,voip_playback,mmap_no_irq_out,haptics_out,telephony_rx,spatializer" /> <route type="mix" sink="usb_device_out" sources="low_latency_out,deep_buffer_out,direct_pcm_out,compress_offload_out,voip_playback,raw_out,mmap_no_irq_out,haptics_out,hifi_playback,telephony_rx,spatializer" /> <route type="mix" sink="usb_headset" sources="low_latency_out,deep_buffer_out,direct_pcm_out,compress_offload_out,voip_playback,raw_out,mmap_no_irq_out,haptics_out,hifi_playback,telephony_rx,spatializer" /> <route type="mix" sink="bt_sco_out" sources="low_latency_out,deep_buffer_out,direct_pcm_out,compress_offload_out,voip_playback,raw_out,haptics_out,telephony_rx" /> <route type="mix" sink="bt_sco_headset" sources="low_latency_out,deep_buffer_out,direct_pcm_out,compress_offload_out,voip_playback,raw_out,haptics_out,telephony_rx" /> <route type="mix" sink="bt_sco_car_kit" sources="low_latency_out,deep_buffer_out,direct_pcm_out,compress_offload_out,voip_playback,raw_out,haptics_out,telephony_rx" /> <route type="mix" sink="bt_a2dp_out" sources="low_latency_out,deep_buffer_out,direct_pcm_out,compress_offload_out,voip_playback,raw_out,mmap_no_irq_out,haptics_out,spatializer" /> <route type="mix" sink="bt_a2dp_headphones" sources="low_latency_out,deep_buffer_out,direct_pcm_out,compress_offload_out,voip_playback,raw_out,mmap_no_irq_out,haptics_out,spatializer" /> <route type="mix" sink="bt_a2dp_speaker" sources="low_latency_out,deep_buffer_out,direct_pcm_out,compress_offload_out,voip_playback,raw_out,mmap_no_irq_out,haptics_out" /> <route type="mix" sink="bt_ble_speaker" sources="low_latency_out,deep_buffer_out,direct_pcm_out,compress_offload_out,voip_ 以上文件路径:/odm/etc/audio/audio_module_config_primary.xml 一加13 Coloros15,安卓版本15,修改该文件,绕过安卓音频SRC实现系统全局自适应采样率(Dynamic sampling rates)、自适应位深(Bit_perfect)(保持音频文件原始位深,16bit文件不升级位深)、禁用升频和重采样,关闭所有音频音效(effect)以及影响音频质量无损输出的一切音频处理,最大程度上抑制并降低音频抖动(jitter)(最大化优化时钟管理和同步)、最大程度降低音频失真和噪声以及电源纹波和噪声,以输出输入最干净无污染最高质量的HIFI无损原始音频信号直出,输出修改过的完整文件
最新发布
08-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值