OpenHarmony开发者论坛

标题: 请问OH5.0.2 usb头戴式耳机的音频策略配置 [打印本页]

作者: 哀骀它788    时间: 2025-3-13 16:12
标题: 请问OH5.0.2 usb头戴式耳机的音频策略配置
[md]### 【问题描述】usb头戴式耳机插入之后可以用命令查看到声卡,使用aplay命令指定usb声卡播放也没有问题,但是系统播放器播放音频,usb耳机还是没有声音

1.这是我的usb耳机配置


```
    <adapter name="usb" supportSelectScene="0">
        <pipes>
            <pipe name="usb_output" role="output">
                <paProp lib="libmodule-hdi-sink.z.so" role="sink" fixed_latency="1" render_in_idle_state="1" moduleName="Usb_arm_speaker"/>
                <streamProps>
                    <streamProp format="s16le" sampleRates="44100" channelLayout="CH_LAYOUT_STEREO" bufferSize="4096"/>
                </streamProps>
                <attributes>
                    <attribute name="preload" value="true"/>
                </attributes>
            </pipe>
            <pipe name="usb_input" role="input">
                <paProp lib="libmodule-hdi-source.z.so" role="source" moduleName="Usb_arm_mic"/>
                <streamProps>
                    <streamProp format="s16le" sampleRates="44100" channelLayout="CH_LAYOUT_STEREO" bufferSize="32768"/>
                </streamProps>
            </pipe>
        </pipes>
        <devices>
            <device name="Usb_Headset_Arm_Out" type="DEVICE_TYPE_USB_HEADSET" pin="PIN_OUT_USB_HEADSET" role="output" supportPipes="usb_output"/>
                        <device name="Usb_Headset_Arm_In" type="DEVICE_TYPE_USB_HEADSET" pin="PIN_IN_USB_HEADSET" role="input" supportPipes="usb_input"/>   
        </devices>
    </adapter>
```

2.这是日志报错

![image.png](https://forums-obs.openharmony.c ... be2bbyb6bjbtiev.png "image.png")
[/md]




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5