Pulseaudio实用命令(二)

//输出日志到文件
# pulseaudio -n --file=/etc/pulse/xxxx.pa  --log-level=4  --log-target=file:/sdcard/0001.log --log-time &

//列出音源输出(到speaker、headset端)
# pacmd -h //帮助
pacmd list-(modules|sinks|sources|clients|cards|samples)
pacmd set-(sink|source)-port NAME|#N PORT

# pacmd dump //dump系统配置
set-sink-volume sink.null 0x10000
set-sink-mute sink.null no
suspend-sink sink.null yes
set-sink-volume sink.deep_buffer 0x5000 //音量配置
set-sink-mute sink.deep_buffer no
suspend-sink sink.deep_buffer yes
set-card-profile droid_card.primary deep_buffer-primary //声卡配置
set-default-sink sink.deep_buffer //设备播放
set-default-source source.primary
....

# pacmd list-sinks //查看ports字段,就是外设通道

//切换扬声器通道
# pacmd set-sink-port 1 output-speaker
Or
# pacmd set-sink-port sink.deep_buffer output-speaker

//切换听筒通道
# pacmd set-sink-port 1 output-earpiece

//切换耳机通道
# pacmd set-sink-port 1 output-wired——headphone

//切换HDMI的speaker
# pacmd set-sink-port 1 output-aux_digital 

//设置音量
# pacmd set-sink-volume sink.deep_buffer 0x5000 

//播放wav
# paplay test.wav

 

你可能感兴趣的:(PulseAudio进阶)