EHfive / pulseaudio-modules-bt

[Deprecated, see https://github.com/EHfive/pulseaudio-modules-bt/issues/154] Adds Sony LDAC, aptX, aptX HD, AAC codecs (A2DP Audio) support to PulseAudio on Linux
GNU General Public License v3.0
1.75k stars 86 forks source link

building on raspberry pi. Possibly a lot of missed stuff, tell me! #55

Closed orrpan closed 5 years ago

orrpan commented 5 years ago
# I don't know if you need to prepare headers, 
# I do it directly on fresh install and at new kernal
# use my script https://gist.github.com/orrpan/338fb6040e95630c7ee118370b02116f 
# better safe than sorry
wget https://gist.github.com/orrpan/338fb6040e95630c7ee118370b02116f/raw/daf85934a6e2e4d7868eecece854671a4eba0587/kernelprep.sh
chmod +x kernelprep.sh
sudo ./kernelprep.sh

sudo apt-get update

# might be better to build bluez, don't know
sudo apt-get install git make bluez cmake build-essential diffutils \
    gcc libfdk-aac-dev1 libass-dev libmp3lame-dev libopus-dev \
    libtheora-dev libvpx-dev libvorbis-dev libomxil-bellagio-dev \
    autoconf automake libtool checkinstall wget

# alot more most likely

# Remove old stuff
sudo apt-get remove libswresample-dev libswresample2 \
    libavcodec libswscale-dev libswscale4 libavutil55 \
    libavutil-dev ffmpeg pulseaudio

sudo apt-get autoremove -y

# Folder
mkdir ~/build
cd ~/build

# Install cmake
wget https://cmake.org/files/v3.13/cmake-3.13.3.tar.gz
tar xf cmake-3.13.3.tar.gz
cd cmake-3.13.3
./configure
make
# install not needed, since this is only used for this build

# bluez
wget www.kernel.org/pub/linux/bluetooth/bluez-5.50.tar.xz
tar xf bluez-5.50.tar.xz
cd bluez-5.50
./configure --prefix=/usr         \
            --sysconfdir=/etc     \
            --localstatedir=/var  \
            --enable-library      \
            --disable-systemd     &&
make -j4
sudo make install

sudo ln -svf ../libexec/bluetooth/bluetoothd /usr/sbin
sudo install -v -dm755 /etc/bluetooth
sudo install -v -m644 src/main.conf /etc/bluetooth/main.conf
sudo install -v -dm755 /usr/share/doc/bluez-5.50
sudo install -v -m644 doc/*.txt /usr/share/doc/bluez-5.50

sudo reboot 

## alot of codecs, all may not be needed
# sbc
cd ~/build
wget https://www.kernel.org/pub/linux/bluetooth/sbc-1.4.tar.xz
tar xf sbc-1.4.tar.xz
cd sbc-1.4
./configure
make -j4
sudo make install
sudo ldconfig

# soxr
cd ~/build
git clone git://git.code.sf.net/p/soxr/code soxr-code
cd soxr-code
./go
cd Release
sudo make install
sudo ldconfig

# faac
cd ~/build
git clone https://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
./autogen.sh
./configure --enable-shared --enable-static
make -j4
sudo make install
sudo ldconfig

# alac 
cd ~/build
git clone https://github.com/mikebrady/alac.git
cd alac
autoreconf -fi
./configure
make -j4
sudo make install
sudo ldconfig

# ldacBT
cd ~/build
git clone https://github.com/EHfive/ldacBT.git
cd ldacBT
git submodule update --init
mkdir build && cd build
../../cmake-3.13.3/bin/./cmake \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DINSTALL_LIBDIR=/usr/lib \
    -DLDAC_SOFT_FLOAT=OFF \
    ../
make -j4
sudo make install
sudo ldconfig

# Install x264
cd ~/build
git clone git://git.videolan.org/x264
cd x264
./configure --enable-static --enable-pic --enable-shared
make -j4
sudo make install
sudo ldconfig

# ffmpeg, this takes forever...
cd ~/build
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure --prefix=/usr --enable-gpl --enable-version3 --enable-nonfree \
    --disable-static --enable-shared --disable-debug --enable-avresample \
    --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame \
    --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx \
    --enable-libx264
make -j4
sudo make install
sudo ldconfig

# pulseaudio
cd ~/build
wget https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-12.2.tar.xz
tar xf pulseaudio-12.2.tar.xz
cd pulseaudio-12.2/
./configure --prefix=/usr        \
            --sysconfdir=/etc    \
            --localstatedir=/var \
            --disable-bluez4     \
            --disable-rpath
make -j4
sudo make install
sudo ldconfig
sudo rm -fv /etc/dbus-1/system.d/pulseaudio-system.conf
sudo sed -i '/load-module module-console-kit/s/^/#/' /etc/pulse/default.pa

# pulseaudio-modules-bt
cd ~/build
MODDIR=`pkg-config --variable=modlibexecdir libpulse`
sudo find $MODDIR -regex ".*\(bluez5\|bluetooth\).*\.so" -exec cp {} {}.bak \;

git clone https://github.com/EHfive/pulseaudio-modules-bt.git
cd pulseaudio-modules-bt
git submodule update --init

git -C pa/ checkout v`pkg-config libpulse --modversion|sed 's/[^0-9.]*\([0-9.]*\).*/\1/'`

mkdir build && cd build
# here we have our new cmake
../../cmake-3.13.3/bin/./cmake ..
make -j4
sudo make install
sudo ldconfig

I think thats about it, probally alot more. 
EHfive commented 5 years ago

All dependencies are listed in https://github.com/EHfive/pulseaudio-modules-bt#general-installation, but you have to found dependencies dependency.