This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] SK-AM62P-LP:如果连接了 USB 麦克风、则通过连接3.5毫米插孔的扬声器进行音频播放无法正常工作

Guru**** 2482225 points
Other Parts Discussed in Thread: AM62P

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1441542/sk-am62p-lp-audio-playback-through-3-5-mm-jack-connected-speaker-not-working-if-a-usb-microphone-is-connected

器件型号:SK-AM62P-LP
主题中讨论的其他器件:AM62P

工具与软件:

大家好、团队成员:

问题描述
通过3.5mm 插孔连接的扬声器进行音频播放时、我们遇到问题。 连接 USB 麦克风后、到扬声器的音频路由失败。 预编译映像上也会出现此问题: AM62Px_userdebug_10.00.00_eMMC .

重现步骤

  1. 在启动之前、通过3.5mm 音频插孔连接扬声器。
  2. 连接 USB 麦克风。
  3. 启动设备。
  4. 播放音频。
  5. 请注意、扬声器未发出任何音频。

预期的行为
即使连接了 USB 麦克风、音频也应通过3.5mm 扬声器播放。

实际行为
无法通过扬声器播放音频。

在中logcat、将记录以下错误消息:

11-21 08:23:52.704 303 1370 E tinyhal : pcm_open(out) failed: can't open device (0) for card (0):no such file or directory

e2e.ti.com/.../speaker_5F00_mic_5F00_issue.txt

tinypcminfo 如下所示:

am62p:/# tinypcminfo -d 0 -D 0
卡0器件0的信息:

PCM 输出:
无法打开卡0的设备0
PCM_HW_OPEN:无法打开设备"/dev/snd/pcmC0D0p 设备不存在。

PCM 输入:
访问:0x000009
格式[0]:0x000004
格式[1]:0x000001
格式名称:S16_LE、S24_3LE
子格式:0x000001
速率:最小值=44100Hz 最大值=192000Hz
通道:最小值为2、最大值为2
采样位:最小值=16最大值=24
期间大小:最小值=45最大值=192000
周期计数:最小值=2最大值=1024


am62p:/# tinypcminfo -d 0 -D 1.
卡1器件的信息0:

PCM 输出:
访问:0x000009
格式[0]:0x000444
格式[1]:0x000001
格式名称:S16_LE、S24_LE、S32_LE、S24_3LE
子格式:0x000001
速率:最小值=8000Hz 最大值=96000Hz
通道:最小值为2、最大值为2
采样位:最小值=16最大值=32
周期大小:最小值=4最大值=16384
周期计数:最小值=2最大值=32768

PCM 输入:
访问:0x000009
格式[0]:0x000444
格式[1]:0x000001
格式名称:S16_LE、S24_LE、S32_LE、S24_3LE
子格式:0x000001
速率:最小值=8000Hz 最大值=96000Hz
通道:最小值为2、最大值为2
采样位:最小值=16最大值=32
周期大小:最小值=4最大值=16384
周期计数:最小值=2最大值=32768

请求支持来解决此问题。

此致

Biju Menon

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    还观察到模拟麦克风存在类似问题。 使用音频分离器通过3.5mm 音频插孔连接模拟麦克风和扬声器。 如果我通过麦克风录音并尝试播放一些音频、则音频播放失败。 它抛出:pcm_open (out)失败:  

    我在预编译器上尝试了这种 方法、似乎音频路由无法按预期工作。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Biju、您好!

    您使用哪种 SDK 对此进行测试? Linux/Android?

    此致、

    Suren

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我们在 Android 14上运行。 在最新的预编译中转载了此内容:

    dr-download.ti.com/.../AM62Px_userdebug_10.00.00_emmc.tgz

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    谢谢 Biju。

    我已将查询发送给我们的专家。 请期待尽快回复。

    我已经验证了它在 Linux SDK 上可以正常工作。

    此致、

    Suren

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    我想知道为什么我明天会检查,并尽快给你一个修复


    此致
    纪尧姆

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嘿  你有什么更新要分享吗?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    很抱歉耽误你的时间。

    你可以应用这个补丁,说我,如果它适合你,如果是,我们将把它集成到 Android 14分支。

    diff --git a/audio_hal_configuration.xml b/audio_hal_configuration.xml
    index abc01776b612..64a7ba81b8b0 100644
    --- a/audio_hal_configuration.xml
    +++ b/audio_hal_configuration.xml
    @@ -57,10 +57,10 @@ Note: not xml elements from TinyHAL are supported.
                 </path>
             </device>
     
    -        <stream type="pcm" dir="out" card="0" device="0" rate="44100">
    +        <stream cardname="AM62xSKEVM" type="pcm" dir="out" device="0" rate="44100">
             </stream>
     
    -        <stream type="pcm" dir="in" card="0" device="0" rate="44100" period_size="512" period_count="32">
    +        <stream cardname="AM62xSKEVM" type="pcm" dir="in" device="0" rate="44100" period_size="512" period_count="32">
             </stream>
     
     </audiohal>
    \ No newline at end of file


    纪尧姆

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 、感谢您分享补丁、但不幸的是、这不能解决问题、如果事先连接了 USB 麦克风、仍然无法通过扬声器播放音频。

    以下是 发生问题期间的 tinypcminfo:

    console:/# tinypcminfo -D 0 -d 0
    卡0器件0的信息:

    PCM 输出:
    无法打开卡0的设备0
    PCM_HW_OPEN:无法打开设备"/dev/snd/pcmC0D0p 设备不存在。

    PCM 输入:
    访问:0x000009
    格式[0]:0x000004
    格式[1]:0x000001
    格式名称:S16_LE、S24_3LE
    子格式:0x000001
    速率:最小值=44100Hz 最大值=192000Hz
    通道:最小值为2、最大值为2
    采样位:最小值=16最大值=24
    期间大小:最小值=45最大值=192000
    周期计数:最小值=2最大值=1024

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、  、请告诉我、如果您 对此有任何更新?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    卡0是您的 USB 设备、因此正常情况下不会有部件。

    正常与补丁奥迪 hal 使用卡名而不是卡 ID。
    我将使用网络摄像头重新测试微型、因为我使用 USB 耳机测试补丁。

    纪尧姆


  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我在我的摄像头上重现了您的问题、摄像头上有一个我在使用的麦克风。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我为您提供了一个新补丁、

    我测试在我的一侧, USB 网络摄像头与麦克风在引导与扬声器在插孔和这个补丁我有声音在扬声器。

    diff --git a/audio_hal_configuration.xml b/audio_hal_configuration.xml
    index abc01776b612..cc2d769a05d0 100644
    --- a/audio_hal_configuration.xml
    +++ b/audio_hal_configuration.xml
    @@ -11,7 +11,7 @@ Note: not xml elements from TinyHAL are supported.
         <!-- mixer element _must_ appear before any of the other definitions.
         The 'card' attribute is optional and sets the ALSA card number of the mixer
         device - if not given it defaults to 0 -->
    -        <mixer card="0">
    +        <mixer name="AM62xSKEVM">
             <!-- init element lists control settings required to initialize the
             hardware and driver. These settings are applied only once when primary HAL
             is first loaded during boot -->
    @@ -57,10 +57,10 @@ Note: not xml elements from TinyHAL are supported.
                 </path>
             </device>
     
    -        <stream type="pcm" dir="out" card="0" device="0" rate="44100">
    +        <stream cardname="AM62xSKEVM" type="pcm" dir="out" device="0" rate="44100">
             </stream>
     
    -        <stream type="pcm" dir="in" card="0" device="0" rate="44100" period_size="512" period_count="32">
    +        <stream cardname="AM62xSKEVM" type="pcm" dir="in" device="0" rate="44100" period_size="512" period_count="32">
             </stream>
     
     </audiohal>
    \ No newline at end of file



    纪尧姆

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、 、感谢您提供补丁。 这一功能按预期运行! 非常感谢您的努力。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我们还 尝试  使用 USB 声卡将音频路由完全转换到 USB [产品: Ugreen USB 音频适配器外部立体声声卡3.5mm 耳机麦克风]、它正是我们的预期。 以下是我们所做的更改:

    diff --git a/audio_hal_configuration.xml b/audio_hal_configuration.xml
    index 8d95e05..d2d6de8 100644
    --- a/audio_hal_configuration.xml
    +++ b/audio_hal_configuration.xml
    @@ -11,56 +11,37 @@ Note: not xml elements from TinyHAL are supported.
         <!-- mixer element _must_ appear before any of the other definitions.
         The 'card' attribute is optional and sets the ALSA card number of the mixer
         device - if not given it defaults to 0 -->
    -        <mixer name="AM62xSKEVM">
    +        <mixer name="Audio">
             <!-- init element lists control settings required to initialize the
             hardware and driver. These settings are applied only once when primary HAL
             is first loaded during boot -->
             <init>
                 <!-- playback -->
    -            <!-- jack out -->
    -            <ctl name="HP Playback Switch" val="1" />
    -            <ctl name="PCM Playback Volume" val="127" />
    -            <ctl name="HP DAC Playback Volume" val="118" />
    +            <ctl name="Headphone Playback Switch" val="1" />
    +            <ctl name="Headphone Playback Volume" val="100" />
     
    -            <!-- jack in -->
    -            <ctl name="Left PGA Mixer Mic3L Switch" val="1" />
    -            <ctl name="Left PGA Mixer Mic3R Switch" val="1" />
    -            <ctl name="Right PGA Mixer Mic3L Switch" val="1" />
    -            <ctl name="Right PGA Mixer Mic3R Switch" val="1" />
    -            <ctl name="PGA Capture Volume" val="60" />
    +            <!-- Record -->
    +            <ctl name="Mic Capture Switch" val="1" />
    +            <ctl name="Mic Capture Volume" val="100" />
             </init>
             </mixer>
     
             <!-- jack out -->
    -        <device name="headphone">
    +        <device name="usb">
                 <path name="on">
    -                <ctl name="HP Playback Switch" val="1" />
    +                <ctl name="Headphone Playback Switch" val="1" />
    +				<ctl name="Mic Capture Switch" val="1" />
                 </path>
                 <path name="off">
    -                <ctl name="HP Playback Switch" val="0" />
    +                <ctl name="Headphone Playback Switch" val="0" />
    +				<ctl name="Mic Capture Switch" val="0" />
                 </path>
             </device>
     
    -        <!-- jack in -->
    -        <device name="headset_in">
    -            <path name="on">
    -                <ctl name="Left PGA Mixer Mic3L Switch" val="1" />
    -                <ctl name="Left PGA Mixer Mic3R Switch" val="1" />
    -                <ctl name="Right PGA Mixer Mic3L Switch" val="1" />
    -                <ctl name="Right PGA Mixer Mic3R Switch" val="1" />
    -            </path>
    -            <path name="off">
    -                <ctl name="Left PGA Mixer Mic3L Switch" val="0" />
    -                <ctl name="Left PGA Mixer Mic3R Switch" val="0" />
    -                <ctl name="Right PGA Mixer Mic3L Switch" val="0" />
    -                <ctl name="Right PGA Mixer Mic3R Switch" val="0" />
    -            </path>
    -        </device>
    -
    -        <stream cardname="AM62xSKEVM" type="pcm" dir="out" device="0" rate="44100">
    +        <stream cardname="Audio" type="pcm" dir="out" device="0" rate="44100" >
             </stream>
     
    -        <stream cardname="AM62xSKEVM" type="pcm" dir="in" device="0" rate="44100" period_size="512" period_count="32">
    +        <stream cardname="Audio" type="pcm" dir="in" device="0" rate="48000" >
             </stream>
     
     </audiohal>
    diff --git a/audio_policy_configuration.xml b/audio_policy_configuration.xml
    index 62a6cbd..37c92a2 100644
    --- a/audio_policy_configuration.xml
    +++ b/audio_policy_configuration.xml
    @@ -56,18 +56,18 @@
                     </mixPort>
                     <mixPort name="primary input" role="sink">
                         <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
    -                             samplingRates="44100" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
    +                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
                     </mixPort>
                 </mixPorts>
                 <devicePorts>
                     <!-- Output devices declaration, i.e. Sink DEVICE PORT -->
    -                <devicePort tagName="Wired Headphones" type="AUDIO_DEVICE_OUT_WIRED_HEADPHONE" role="sink">
    +                <devicePort tagName="Wired Headphones" type="AUDIO_DEVICE_OUT_ALL_USB" role="sink">
                         <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
                                  samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                     </devicePort>
                     <devicePort tagName="Builtin Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source">
                         <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
    -                             samplingRates="44100" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
    +                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
                     </devicePort>
                 </devicePorts>
                 <!-- route declaration, i.e. list all available sources for a given sink -->
    

    将卡片名称为"音频"、来自:

    am62p:/ # cat /proc/asound/card0/id                                                                                                                                                                               
    Audio