@fjvzrk, would you mind sharing your shairport-sync script to use buttons, please.
I have tried this script:
#!/bin/bash
# Configuration
SHAIRPORT_HOST="localhost"
SHAIRPORT_PORT="5000"
INPUT_DEVICE="/dev/input/event0" # Adjust this to your Beoplay A8's event device
# Function to send commands to shairport-sync
send_shairport_command() {
echo "$1" | nc "$SHAIRPORT_HOST" "$SHAIRPORT_PORT"
}
# Function to handle evtest output
handle_evtest_output() {
local line
while IFS= read -r line; do
if [[ "$line" =~ code\ 165\ \(KEY_PREVIOUSSONG\),\ value\ 1 ]]; then
send_shairport_command "player.previousitem"
elif [[ "$line" =~ code\ 163\ \(KEY_NEXTSONG\),\ value\ 1 ]]; then
send_shairport_command "player.nextitem"
elif [[ "$line" =~ code\ 164\ \(KEY_PLAYPAUSE\),\ value\ 1 ]]; then
send_shairport_command "player.toggle" # or player.pause or player.play, change as needed.
fi
done
}
# Start evtest and handle its output
evtest "$INPUT_DEVICE" | handle_evtest_output
But it returns this error message:
RTSP/1.0 400 Bad Request
Server: AirTunes/105.1