diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index cd1c540dcfb7acfe3fc312170bdc14b12db6ecdf..49d1cde10513f33ee80ac240a7178f2c0f2fe769 100755 --- a/board/phytium/common/debian-package-installer +++ b/board/phytium/common/debian-package-installer @@ -73,9 +73,9 @@ do_distrorfs_second_stage() { echo 'auth required pam_listfile.so onerr=succeed item=user sense=deny file=/etc/deniedusers' >> /etc/pam.d/lightdm # set the name of the sound output devices - echo 'update-sink-proplist 1 device.description=Headphone' >> /etc/pulse/default.pa + #echo 'update-sink-proplist 1 device.description=Headphone' >> /etc/pulse/default.pa echo 'update-sink-proplist 0 device.description=HDMI' >> /etc/pulse/default.pa - echo 'set-default-sink 1' >> /etc/pulse/default.pa + #echo 'set-default-sink 1' >> /etc/pulse/default.pa echo 'load-module module-switch-on-connect' >> /etc/pulse/default.pa # touch .desktop_firstrun diff --git a/configs/phytiumpi_desktop_defconfig b/configs/phytiumpi_desktop_defconfig index c2a564fd9863f81abfe21fe574944a6c5a5af062..8e59894b73e54fdb7c384bf68dca0df545f882e0 100644 --- a/configs/phytiumpi_desktop_defconfig +++ b/configs/phytiumpi_desktop_defconfig @@ -36,7 +36,7 @@ BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/phytium-linux-kernel.git" # kernel 5.10 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-5.10_v2.2" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="7b787a8c53e522e122d35912c830849321aa9ae4" BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/phytiumpi_firefly" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="phytium" diff --git a/configs/phytiumpi_linux_4.19.config b/configs/phytiumpi_linux_4.19.config index 037455b3d39c32cc483dade93103f7b7ada4e2e4..2c556ccc113b2acc149bd3025ae58c76f0a0b1b5 100644 --- a/configs/phytiumpi_linux_4.19.config +++ b/configs/phytiumpi_linux_4.19.config @@ -1,2 +1,2 @@ # kernel 4.19 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-4.19_v2.2" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="b96cb86c663b65a684cb5aed3a379a0598f775f7" diff --git a/package/phytium-desktop-tools/phytium-desktop-tools.mk b/package/phytium-desktop-tools/phytium-desktop-tools.mk index cac55ef2fc9e04820a36344275a761b18d13b887..01bfa5d22e7a88ce7187c2d0288aa67388b67dd9 100644 --- a/package/phytium-desktop-tools/phytium-desktop-tools.mk +++ b/package/phytium-desktop-tools/phytium-desktop-tools.mk @@ -16,14 +16,13 @@ define PHYTIUM_DESKTOP_TOOLS_INSTALL_TARGET_CMDS mkdir -p $(TARGET_DIR)/usr/share/desktop-base/profiles/xdg-config/xfce4/xfconf/xfce-perchannel-xml/ mkdir -p $(TARGET_DIR)/var/lib/alsa/ mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/ - mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/conf.d/simple-card/ - mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/conf.d/PMDK-I2S/ $(INSTALL) -m 777 -D $(@D)/dark.jpg $(TARGET_DIR)/usr/share/images/desktop-base/ $(INSTALL) -m 755 -D $(@D)/01_debian.conf $(TARGET_DIR)/usr/share/lightdm/lightdm-gtk-greeter.conf.d/ $(INSTALL) -m 755 -D $(@D)/xfce4-desktop.xml $(TARGET_DIR)/usr/share/desktop-base/profiles/xdg-config/xfce4/xfconf/xfce-perchannel-xml/ $(INSTALL) -m 644 -D $(@D)/asound.state $(TARGET_DIR)/var/lib/alsa/ - cp -rf $(@D)/Phytium/ $(TARGET_DIR)/usr/share/alsa/ucm2/ - $(INSTALL) -m 644 -D $(@D)/switch_to_headphone.sh $(TARGET_DIR)/usr/bin/ + cp -rf $(@D)/PMDK-I2S/ $(TARGET_DIR)/usr/share/alsa/ucm2/ + cp -rf $(@D)/phytium_pe220x-/ $(TARGET_DIR)/usr/share/alsa/ucm2/ + $(INSTALL) -m 755 -D $(@D)/switch_to_headphone.sh $(TARGET_DIR)/usr/bin/ $(INSTALL) -m 644 -D $(@D)/sound_output_device_switching.desktop $(TARGET_DIR)/usr/share/alsa/ucm2/ endef diff --git a/package/phytium-desktop-tools/src/Phytium/PMDK-I2S/HiFi.conf b/package/phytium-desktop-tools/src/PMDK-I2S/HiFi.conf similarity index 100% rename from package/phytium-desktop-tools/src/Phytium/PMDK-I2S/HiFi.conf rename to package/phytium-desktop-tools/src/PMDK-I2S/HiFi.conf diff --git a/package/phytium-desktop-tools/src/Phytium/PMDK-I2S/PMDK-I2S.conf b/package/phytium-desktop-tools/src/PMDK-I2S/PMDK-I2S.conf similarity index 100% rename from package/phytium-desktop-tools/src/Phytium/PMDK-I2S/PMDK-I2S.conf rename to package/phytium-desktop-tools/src/PMDK-I2S/PMDK-I2S.conf diff --git a/package/phytium-desktop-tools/src/Phytium/es8336/HiFi.conf b/package/phytium-desktop-tools/src/phytium_pe220x-/HiFi.conf similarity index 100% rename from package/phytium-desktop-tools/src/Phytium/es8336/HiFi.conf rename to package/phytium-desktop-tools/src/phytium_pe220x-/HiFi.conf diff --git a/package/phytium-desktop-tools/src/Phytium/es8336/es8336.conf b/package/phytium-desktop-tools/src/phytium_pe220x-/phytium_pe220x-.conf similarity index 100% rename from package/phytium-desktop-tools/src/Phytium/es8336/es8336.conf rename to package/phytium-desktop-tools/src/phytium_pe220x-/phytium_pe220x-.conf diff --git a/package/phytium-desktop-tools/src/switch_to_headphone.sh b/package/phytium-desktop-tools/src/switch_to_headphone.sh index 6b6902706350454e58e7a9d86e6e90c142b3e3fa..166e0d9eb8f2c33accdc36bf4678d6f0850f7473 100755 --- a/package/phytium-desktop-tools/src/switch_to_headphone.sh +++ b/package/phytium-desktop-tools/src/switch_to_headphone.sh @@ -5,15 +5,25 @@ # Copyright (c) 2024 Phytium Technology Co., Ltd. +FLAG=true + while true; do - FLAG="$(pactl list sinks | grep -oP '\[Out\] Headphones:.*?\bnot available\b' | grep -o 'not available')" - if pgrep -x pulseaudio > /dev/null - then - if [ -z "$FLAG" ]; then - pacmd set-default-sink 1 + HEADPHONE_AVAILABLE="$(pactl list cards | grep -oP '\[Out\] Headphones:.*?\b available\b' | grep -o 'not')" + if pgrep -x pulseaudio > /dev/null; then + if [ -z "$HEADPHONE_AVAILABLE" ]; then + pactl set-card-profile 1 HiFi + if [ "$FLAG" == true ]; then + pacmd update-sink-proplist alsa_output.platform-sound.HiFi__hw_phytiumpe220xi2_0__sink device.description=Headphone + pacmd set-default-sink alsa_output.platform-sound.HiFi__hw_phytiumpe220xi2_0__sink + + FLAG=false + fi + + elif [ -n "$HEADPHONE_AVAILABLE" ] && [ "$FLAG" == false ]; then + FLAG=true fi fi - sleep 2 + sleep 1 done