📜 ⬆️ ⬇️

How I did the transfer of sound on the Raspberry Pi

Hello!

I recently needed the transfer of sound to the audio system through the raspberry, I want to share my experience in tuning.

Step 0. Preparation

We need:
')

Step 1. Installation

1. Go to the download section on the Malinki website and download Raspbian (Not Lite)

2. Unpack the archive

3. Format SD card:


4.1 Write to USB flash drive (Windows):


4.2 Write to USB flash drive (Mac / Linux):


5. We take out and insert the SD card into the computer and open a single partition (it should be called BOOT). Create an ssh file there.

6. Insert the SD card into the Raspberry Pi

Step 2. Configure

1. Find out the IP address of our Raspberry Pi

2. Connect to it via SSH. I prefer puty

3. Login, login: pi, password: raspberry

4. Register in the console this

sudo apt-get upgrade sudo apt-get install bluez pulseaudio-module-bluetooth python-gobject python-gobject-2 bluez-tools sudo usermod -a -G lp (   - pi) 

5. Registering this

 sudo nano /etc/bluetooth/audio.conf 

and get into a text editor. Under the caption [General] add this

 Enable=Source,Sink,Media,Socket 

Press Ctrl + O, Ctrl + X.

6. Further we register:

 sudo nano /etc/pulse/daemon.conf 

here we are looking for the string “resample-method = speex-float-3”. If not at the beginning of this line; - add it.

After that we enter

  resample-method = trivial 

Poke Ctrl + O Ctrl + X again

7. And again we prescribe:

 sudo nano /etc/bluetooth/main.conf 

Here we can change the device name to any other by editing the string "Name" if before this line there is # we remove it and edit the name we want, it should look something like this " Name= ".

Next we look for the string " Class " and if it is # we remove it before it, we do it so that it is like this

 Class=0x20041C 

8. Autostart

1. Create an OnBluetooth file (sudo nano /etc/init.d/OnBluetooth) in /etc/init.d/. Into it
write this:

 #!/bin/bash #Start systemctl service sudo systemctl start bluetooth sleep 1 #Start bluetoothctl with discoverable and pairable options echo -e 'power on\ndiscoverable on\npairable on \t \nquit' | bluetoothctl 

2. Write to Konosl

  chmod 755 /etc/init.d/OnBluetooth 

3. Write to console

  update-rc.d OnBluetooth enable 

9. Choose where the audio will be displayed. To do this, type sudo raspi-config , go to Advanced on Sound and choose which one we need. After that click finish. Done!

Step 3. Connecting

The bluetooth connection is working right away, now it's time to set up an internet connection.

For Windows:

Download and unpack the archive in a convenient place.
● Edit the audio.bat file:

  1. Your_IP change to your raspberry ip
  2. UserName change to login from raspberry pi
  3. Password change to password from login raspberry pi

● Run

Step 4. Verification.


Conclusion


I hope that at least someone this article was useful. Thanks for attention.

Source: https://habr.com/ru/post/427453/


All Articles