From f56935e48b3ffbd3f89930e64e9fc41b8c949032 Mon Sep 17 00:00:00 2001 From: Polish Hammer Date: Sat, 19 Apr 2025 17:14:53 +0200 Subject: [PATCH] How to setup radio --- ffmpeg.pref | 3 ++ manual_set_up_radio.txt | 101 ++++++++++++++++++++++++++++++++++++++++ pulseaudio.service | 11 +++++ 3 files changed, 115 insertions(+) create mode 100644 ffmpeg.pref create mode 100644 manual_set_up_radio.txt create mode 100644 pulseaudio.service diff --git a/ffmpeg.pref b/ffmpeg.pref new file mode 100644 index 0000000..eb72eeb --- /dev/null +++ b/ffmpeg.pref @@ -0,0 +1,3 @@ +Package: ffmpeg libavcodec-dev libavcodec59 libavdevice59 libavfilter8 libavformat-dev libavformat59 libavutil-dev libavutil57 libpostproc56 libswresample-dev libswresample4 libswscale-dev libswscale6 libavdevice-dev libavfilter-dev libpostproc-dev +Pin: origin deb.debian.org +Pin-Priority: 1001 diff --git a/manual_set_up_radio.txt b/manual_set_up_radio.txt new file mode 100644 index 0000000..6b825f9 --- /dev/null +++ b/manual_set_up_radio.txt @@ -0,0 +1,101 @@ +# === SYSTEM SETUP === +sudo apt update && sudo apt install -y \ + pulseaudio pulseaudio-utils pavucontrol \ + libgtk-3-dev gtk-3-examples \ + xauth dbus-x11 \ + samba + +# === SAMBA CONFIGURATION === +sudo nano /etc/samba/smb.conf +# Add at the end of the file: +# [RaspberryPiNAS] +# path = /home/pi/Public +# comment = Pi Share +# browseable = yes +# writeable = yes +# guest ok = no +# valid users = pi + +# Set permissions +chmod 755 /home/pi +mkdir -p /home/pi/Public +chmod 777 /home/pi/Public +chown -R pi:pi /home/pi/Public + +# Set Samba password for pi +sudo smbpasswd -a pi + +# Restart Samba +sudo systemctl restart smbd + +# === PULSEAUDIO SYSTEM-WIDE SERVICE === +sudo nano /etc/systemd/system/pulseaudio.service +# Paste this content: +# [Unit] +# Description=PulseAudio System-wide Daemon +# After=sound.target network.target +# +# [Service] +# Type=simple +# ExecStart=/usr/bin/pulseaudio --system --disallow-exit --disallow-module-loading=0 --daemonize=no +# Restart=always +# +# [Install] +# WantedBy=multi-user.target + +# === PULSEAUDIO MODULES FOR LEXICON LAMBDA USB === +sudo nano /etc/pulse/system.pa +# Comment out: +# load-module module-udev-detect +# load-module module-detect +# Add this at the bottom: +# load-module module-alsa-sink device=hw:1,0 sink_name=LambdaOutput sink_properties=device.description="Lexicon_Lambda_USB_Output" +# load-module module-alsa-source device=hw:1,0 source_name=LambdaInput source_properties=device.description="Lexicon_Lambda_USB_Input" +# load-module module-native-protocol-unix auth-anonymous=1 socket=/tmp/pulseaudio.socket + +# Set client default socket +sudo nano /etc/pulse/client.conf +# Add this line: +# default-server = unix:/tmp/pulseaudio.socket + +# Enable and start PulseAudio system-wide +sudo systemctl daemon-reload +sudo systemctl enable pulseaudio.service +sudo systemctl restart pulseaudio.service + +# === X11 & GUI FIXES FOR SSH/MOBAXTERM === +sudo nano /etc/ssh/sshd_config +# Ensure these lines are present: +# X11Forwarding yes +# X11UseLocalhost no +# XAuthLocation /usr/bin/xauth + +# Restart SSH +sudo systemctl restart ssh + +# Ensure xauth is installed +sudo apt install -y xauth + +# === BASHRC: MAKE GUI EXPORTS PERSISTENT === +nano ~/.bashrc +# Add this at the end: +# export GDK_BACKEND=x11 +# export LIBGL_ALWAYS_INDIRECT=1 +# export NO_AT_BRIDGE=1 +# export $(dbus-launch) + +# Reload bashrc immediately +source ~/.bashrc + +# === TESTING GUI === +# (Reconnect via MobaXterm SSH with X11 forwarding enabled before running below) + +# Run pavucontrol GUI +pavucontrol & + +# Optional: Test GTK GUI rendering +gtk3-demo & + +# Check audio devices +pactl list sinks short +pactl list sources short diff --git a/pulseaudio.service b/pulseaudio.service new file mode 100644 index 0000000..e8362dc --- /dev/null +++ b/pulseaudio.service @@ -0,0 +1,11 @@ +[Unit] +Description=PulseAudio System-wide Daemon +After=sound.target network.target + +[Service] +Type=simple +ExecStart=/usr/bin/pulseaudio --system --disallow-exit --disallow-module-loading=0 --daemonize=no +Restart=always + +[Install] +WantedBy=multi-user.target