讨论广场 问答详情
5.0音频系统适配
jialingzhang 2025-03-18 21:00:09
161 评论 分享

1、目前使用alsa进行适配。

(1)aplay,idl_render都可以播放。

(2)系统自带的音乐软件可以播放但没声音。

(3)使用amixcer -c 1 sset Master,0 unmute 50%后音乐软件有声音。

想请问下,这个设备默认就是静音状态么,在hdi里有处理声卡默认是否静音么。感谢支持。

信息如下:

Speaker默认未静音

# pactl list sinks                                                             
Sink #0
        State: SUSPENDED
        Name: Speaker
        Description: HDI sink is primary
        Driver: module_hdi_sink.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 2
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor Source: Speaker.monitor
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY 
        Properties:
                device.string = "primary"
                device.description = "HDI sink is primary"
                filePath = ""
                networkId = "LocalDevice"
                device.icon_name = "audio-card"
        Formats:
                pcm

Sink #1
        State: SUSPENDED
        Name: InnerCapturerSink
        Description: Null Output
        Driver: module_inner_capturer_sink.c
        Sample Specification: s16le 2ch 48000Hz
        Channel Map: front-left,front-right
        Owner Module: 3
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor Source: InnerCapturerSink.monitor
        Latency: 0 usec, configured 0 usec
        Flags: DECIBEL_VOLUME LATENCY 
        Properties:
                device.description = "Null Output"
                device.class = "capturer"
                device.string = "innercapturer"
                device.icon_name = "audio-card"
        Formats:
                pcm

适配的是card 1 

# aplay  -l                                                                    
**** List of PLAYBACK Hardware Devices ****
card 0: Loongson [HDA Loongson], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Loongson [HDA Loongson], device 7: HDMI 0 [HDMI 0 *]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Loongson_1 [HDA Loongson], device 0: CX20632 Analog [CX20632 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

开机后默认为静音状态,关闭Master静音后,有输出。

# amixer -c 1                                                                  
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 74
  Mono: Playback 0 [0%] [-74.00dB] [off]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 74
  Mono:
  Front Left: Playback 74 [100%] [0.00dB] [on]
  Front Right: Playback 74 [100%] [0.00dB] [on]
Simple mixer control 'Front Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 4
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Line Out',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 74
  Mono:
  Front Left: Playback 74 [100%] [0.00dB] [on]
  Front Right: Playback 74 [100%] [0.00dB] [on]
Simple mixer control 'Beep',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 7
  Mono: Playback 0 [0%] [-28.00dB] [off]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 80
  Front Left: Capture 0 [0%] [-74.00dB] [off]
  Front Right: Capture 0 [0%] [-74.00dB] [off]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Enabled'
Simple mixer control 'Loopback Mixing',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Rear Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 4
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]




 

161 评论 分享
写回答
全部评论(8)

这个应该去修改common.h文件去配置相对应的开关,可以参考device/board/hihope/rk3568/audio_alsa/下的内容,把你的Master设置成打开就ok吧

2025-03-19 09:33:57
引用:“您好,能详细说下,具体是设置哪块么”
具体操作应该是打开 Master 这个配置项开关,amixer -c 1 contents查一下 Master 的 numid,然后在common.h里面设置,参考rk3568(device/board/hihope/rk3568/audio_alsa/)下的相关内容,然后对应的.c文件再修改一下把Master设置成on(打开),尝试一下行不行。
2025-03-20 11:15:42
2025-03-20 09:52:15
您好,能详细说下,具体是设置哪块么
2025-03-20 09:52:15
  • audio_policy_config.xml中的buffer_size和period_size设置对声音质量有很大影响。如果这些值过大,可能导致缓冲区填满后没有及时更新,从而出现静音或无声的情况。检查并确保这些参数适中且与设备性能匹配。
2025-03-19 10:08:15
2025-03-20 14:44:31
引用:“请问5.0有没有适配案例呀,我现在虽然能播放但是不确定是否正常。目前和3568对比日志看,除了声卡默认静音了,没发现其他的异常。”
可以参考一下适配文档
audio (1).zip
下载
2025-03-20 14:44:31
2025-03-20 08:34:12
请问5.0有没有适配案例呀,我现在虽然能播放但是不确定是否正常。目前和3568对比日志看,除了声卡默认静音了,没发现其他的异常。
2025-03-20 08:34:12
2 楼

楼主你的hdmi可以正常播放吗

2025-03-19 09:47:36
2025-03-19 15:00:34
主线分支的补丁打到5.0下暂时未能播放。我看hdi里好像默认会speaker。
2025-03-19 15:00:34