User Tools

Site Tools


fluidcanvas_r2pi:raspberry_pi_os_installation_and_optimization

This is an old revision of the document!


Raspberry Pi OS Installation and Optimization

라즈베리파이 3B에 Raspberry Pi OS Desktop(64-bit)을 설치한 뒤 FluidSynth를 구동하기 위한 최적화를 실시한다. GUI가 자동으로 시작되지 않도록 하고 Wi-Fi를 이용한 SSH 접속만 허용한다. USB 오디오 출력장치는 Roland SC-D70 또는 Behringer UCA200을 사용한다.

추천하는 OS는 Raspberry Pi OS Lite (64bit)이다. OS 설치 후에는 다음과 같 패키지를 추가한다.

sudo apt update
sudo apt install fluidsynth alsa-utils
sudo apt install qsynth
sudo apt install jackd

설치 후 설정 변경

sudo raspi-config
  1. Systems Option → Boot / Auto Login에서 Console 선택
  2. Systems Option → Interface Options → SSH Enable ('ssh ID@192.168.1.100')
sudo systemctl disable lightdm   # GUI 서비스 끄기(복원 가능)
sudo systemctl set-default multi-user.target   # 부팅 목표를 콘솔로 설정

불필요한 서비스 끄기

sudo systemctl disable bluetooth
sudo systemctl disable avahi-daemon
sudo systemctl disable triggerhappy
sudo systemctl disable hciuart

boot time 확인

systemd-analyze
systemd-analyze blame

기타: gpu_mem=16, hmdi_force_hotplut=1

사운드 테스트

예전에 작성한 문서인 Music on Linux가 추억처럼 떠오른다!

파일의 단순 재생

SoundFont 패키지를 풀면 데모용으로 ogg 파일이 포함된 경우가 있다. 이를 재생하려면 ogg123과 같은 플레이어가 편리하다.

sudo apt install vorbis-tools

USB 오디오 기기를 연결한 뒤 aplay -l을 실행하여 '카드 번호'를 확인한다. 0번은 내장 헤드폰이다.

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 7/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: vc4hdmi [vc4-hdmi], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

USB 오디오 기기는 card 2번이다. 이를 통해서 ogg 파일을 재생해 보자.

ogg123 -d alsa -o dev:plughw:2,0 test.ogg

보다 간단하게는 다음과 같이 입력한다. 좌우 채널로 번갈아 핑크 노이즈가 재생될 것이다.

speaker-test -D plughw:2,0 -c2

MIDI test

먼저 .MID 파일을 재생해 보자.

fluidsynth -a alsa -o audio.alsa.device=plughw:2,0 ~/sf2/GeneralUser-GS.sf2 Dance.mid
FluidSynth runtime version 2.4.4
Copyright (C) 2000-2025 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of Creative Technology Ltd.

Type 'help' for help topics.

> fluidsynth: warning: Failed to set thread to high priority

경고문 권한 부족과 관련한 것이라서 테스트 단계에서는 별로 중요하지 않다. 경고 때문에 FluidSynth interactive shell('>')에 들어간 것이다.

1. 건반 입력을 FluidSynth로 보내기

(작성 예정)

2. 건반 입력을 USB MIDI interface에 연결된 외부 모듈로 보내기

(작성 예정)

fluidcanvas_r2pi/raspberry_pi_os_installation_and_optimization.1773573477.txt.gz · Last modified: by hyjeong