luci-app-airplay2: add audio buffer length setting

This commit is contained in:
lean 2020-03-29 23:03:57 +08:00
parent 51fc01f88c
commit c6f47f30df
5 changed files with 16 additions and 12 deletions

View File

@ -10,7 +10,7 @@ LUCI_TITLE:=Luci for Apple Airplay2 Receiver
LUCI_DEPENDS:=@TARGET_x86 +alsa-utils +kmod-sound-hda-core +kmod-sound-hda-codec-realtek +kmod-sound-hda-codec-via +kmod-sound-via82xx +kmod-sound-hda-intel +shairport-sync-openssl
LUCI_PKGARCH:=all
PKG_VERSION:=1
PKG_RELEASE:=6
PKG_RELEASE:=8
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -52,4 +52,7 @@ alsa_output_rate:value("88200", translate("88.2Khz"))
alsa_output_rate:value("176400", translate("176.4Khz"))
alsa_output_rate:value("352800", translate("352.8Khz"))
return m
alsa_buffer_length=s:option(Value, "alsa_buffer_length", translate("Alsa Buffer Length"))
alsa_buffer_length.default = "6615"
return m

View File

@ -54,3 +54,6 @@ msgstr "第 2 张声卡"
msgid "Alsa Output Rate"
msgstr "音频输出采样率"
msgid "Alsa Buffer Length"
msgstr "音频缓冲区长度"

View File

@ -1,12 +1,11 @@
config shairport-sync 'shairport_sync'
option respawn '1'
option output_backend 'alsa'
option mdns_backend 'avahi'
option alsa_output_rate '44100'
option port '5050'
option name 'AirPlay 2 On OpenWrt'
option auth '0'
option interpolation 'basic'
option port '5050'
option alsa_output_rate 'auto'
option alsa_buffer_length '6615'
option enabled '0'

View File

@ -48,9 +48,9 @@ start_instance() {
append_str "$cfg" "$conf_file" name "name"
append_str "$cfg" "$conf_file" password "password"
append_str "$cfg" "$conf_file" interpolation "interpolation"
append_str "$cfg" "$conf_file" output_backend "output_backend" "alsa"
append_str "$cfg" "$conf_file" mdns_backend "mdns_backend" "avahi"
append_num "$cfg" "$conf_file" port "port" 5050
append_str "$cfg" "$conf_file" output_backend "output_backend"
append_str "$cfg" "$conf_file" mdns_backend "mdns_backend"
append_num "$cfg" "$conf_file" port "port" "5050"
append_num "$cfg" "$conf_file" udp_port_base "udp_port_base"
append_num "$cfg" "$conf_file" udp_port_range "udp_port_range"
append_str "$cfg" "$conf_file" statistics "statistics"
@ -89,9 +89,8 @@ start_instance() {
echo -e "alsa =" >> $conf_file
echo -e "{" >> $conf_file
append_str "$cfg" "$conf_file" alsa_output_device "output_device"
append_str "$cfg" "$conf_file" alsa_mixer_control_name "mixer_control_name" ""
append_str "$cfg" "$conf_file" alsa_mixer_control_name "mixer_control_name"
append_str "$cfg" "$conf_file" alsa_mixer_device "mixer_device"
append_str "$cfg" "$conf_file" alsa_output_rate "output_rate" "44100"
append_num "$cfg" "$conf_file" alsa_latency_offset "audio_backend_latency_offset"
append_num "$cfg" "$conf_file" alsa_buffer_length "audio_backend_buffer_desired_length"
append_str "$cfg" "$conf_file" alsa_disable_synchronization "disable_synchronization"
@ -147,4 +146,4 @@ boot() {
amixer set Master 100%
amixer set PCM 100%
start
}
}