조건이 갖추어진 분들중 시간이 널널한 분들만 심심풀이로 하세요. 된다는 보장이 전혀 없습니다. 저는 잘 되는데, 설정이 moode audio와 모종의 관계를 이루고 있기 때문인 듯 합니다. 다만 애초 moode audio 설치되면서 그 녀석의 컴포넌트들 중 하나로 설치되어야 하는 것이 무슨일인지 설치가 안되어 제 자신이 직접 설치해야 했고 설정을 6의 첫 세줄대로 해야 했습니다. 제 나름대로 생각해보면, shairport-sync 만 단독으로 설치하실 분들은, 아래에도 언급했듯이, sudo systemctl disable shairport-sync 은 하지 말아야 할 듯 합니다.
===========
1. 폰이 마지스크 방식으로 루팅되어 있어야 합니다.
2. 다음 페이지에 있는 모듈을 플래싱해야 합니다.
https://forum.xda-developers.com/apps/magisk/module-airaudio-audio-mode-t3753580
3. 구글 플레이에서 다음 유료 앱을 설치해야 합니다.
https://play.google.com/store/apps/details?id=eu.airaudio&hl=ko
* 요 녀석 세팅:
세팅 -> 제네랄 세팅에서 시스템 오디오에 체크합니다.
세팅에서 에어 플레이에 체크합니다. 오디오 딜레이는 제 경우는 0.00도 잘 먹었습니다.
4. 라즈베리 파이에 DAC이 물려 있어야 합니다.
5. 라즈비안에 shairport-sync 최신 버전을 컴파일해 설치합니다.
----
sudo apt-get -y install autoconf libtool libdaemon-dev libasound2-dev libpopt-dev libconfig-dev \
avahi-daemon libavahi-client-dev libssl-dev libsoxr-dev
cd ~
sudo git clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync
sudo autoreconf -i -f
sudo ./configure --with-alsa --with-avahi --with-ssl=openssl --with-soxr --with-metadata --with-stdout --with-systemd
sudo make
sudo make install
sudo systemctl disable shairport-sync
cd ~
sudo rm -rf ./shairport-sync
sudo cp ./rel-stretch/usr/local/etc/shairport-sync.conf /usr/local/etc
---
* 다만 sudo systemctl disable shairport-sync 은 하지 말아 주세요. 요 명령은 shairport-sync 가 moode audio 시스템의 일부로서 기능하게 하기 위한 것으로 보이니 shairport-sync 만 설치하는 경우는 생략해야 할 것 같습니다. 생략하면 shairport-sync 는 시스템 서비스로서 부팅할 때 자동으로 시작됩니다. 부팅할 때 자동으로 시작되어야 하는게 맞죠. 물론 moode audio의 컴포넌트의 일부로 설치되도 부팅할때 자동으로 시작되겠지만 moode audio의 자동시작의 일부로 자동 시작하는 거겠죠.
6. 환경설정 파일을 편집합니다.
sudo /usr/local/etc/shairport-sync.conf
output_device 은 일단 그대로 둡니다.
output_rate 은 DAC이 지원하는 최대 샘플링 레이트로 합니다. 그렇게 하면 일괄적으로 그 샘플링 레이트로 업샘플됩니다.
output_format 은 DAC이 지원하는 최대 비트로 설정합니다. 요즘 USB DAC은 보통 S24나 S32이죠.
요렇게 하시고
sudo systemctl start shairport-sync.service 로 스타트 하세요.
그리고는 폰에서 에어 오디오를 실행해 에어 플레이 리시버가 잡히는지 확인하세요. 잡히면 터치하면 연결됩니다.
요 상태에서 폰에서 나는 모든 소리를 라즈베리파이에 연결된 DAC으로 보낼 수 있습니다.
* 잡히는데 소리는 안나면 output_device 의 코멘트 아웃을 해제하고 default 를 alsamixer 명령으로 확인하면 나오는 DAC 이름으로 변경하세요. 그런 후
sudo systemctl restart shairport-sync.service
로 서비스를 재시작하신 후 에어 플레이 리시버가 잡히고 소리가 나오는지 확인하세요.
---
// These are parameters for the "alsa" audio back end.
alsa =
{
// output_device = "default"; // the name of the alsa output device. Use "alsamixer" or "aplay" to find out the names of devices, mixers, etc.
// mixer_control_name = "PCM"; // the name of the mixer to use to adjust output volume. If not specified, volume in adjusted in software.
// mixer_device = "default"; // the mixer_device default is whatever the output_device is. Normally you wouldn't have to use this.
// can be 44100, 88200, 176400 or 352800, but the device must have the capability.
output_rate = 352800;
// can be "U8", "S8", "S16", "S24", "S24_3LE", "S24_3BE" or "S32", but the device must have the capability. Except where stated using (*LE or *BE), endianness matches that of the processor.
output_format = "S32";
---