Hallo,
i'd like to use my Pi2 as car pc. At the moement i got problems routing the sound from my phone via bluetooth through the pi to the DAC into the car speakers.
Playing the sound via the 3.5 jack is no problem.
I installed the A2DP like it is described here:
http://www.instructables.com/id/Turn-your-Raspberry-Pi-into-a-Portable-Bluetooth-A/?lang=de&ALLSTEPS
Whatt has to be changed, to rout the sound via the DAC ?
DAC is working. Playing mp3 from the pi is no prblem, only the bluetooth sound is a problem.
Date
Votes
6 comments
-
Chris Mullen You have to check with Daniel HiFiBerry support team but their products have there own analog sound output signal terminals/connectors.
By wanting bluetooth output from HiFiBerry products you would need to convert back into a digital signal, then transmit over the bluetooth protocol and have your car system convert the digital bluetooth signal back into analog again. -
vitalic The normal output is working. When i start a mp3 i can listen to it via audio jack or hdmi.
When the source is my phone an i play a mp3 via bluetooth to the pi, i can listen to it too via audio jack (didn't try hdmi).
But i want to rout the signal from a bluetooth source not to the jack or the hdmi. It should be play via the DAC output.
It must be an pulseaudio or alsa problem. -
vitalic solved
/var/lib/udev/bluetooth#!/bin/bash
AUDIOSINK="alsa_output.platform-sound.analog-stereo"
echo "Executing bluetooth script...|$ACTION|" >> /var/log/bluetooth_dev
ACTION=$(expr "$ACTION" : "\([a-zA-Z]\+\).*")
if [ "$ACTION" = "add" ]
then
# Turn off BT discover mode before connecting existing BT device to audio
hciconfig hci0 noscan
# Set volume level to 100 percent
amixer set Master 100%
pacmd set-sink-volume 0 65537
for dev in $(find /sys/devices/virtual/input/ -name input*)
do
if [ -f "$dev/name" ]
then
mac=$(cat "$dev/name" | sed 's/:/_/g')
bluez_dev=bluez_source.$mac
sleep 1
CONFIRM=<code>sudo -u pi pactl list short | grep $bluez_dev</code>
if [ ! -z "$CONFIRM" ]
then
echo "Setting bluez_source to: $bluez_dev" >> /var/log/bluetooth_dev
echo pactl load-module module-loopback source=$bluez_dev sink=$AUDIOSINK rate=44100 adjust_time=0 >>
/var/log/bluetooth_dev
sudo -u pi pactl load-module module-loopback source=$bluez_dev sink=$AUDIOSINK rate=44100 adjust_time=0
>> /var/log/bluetooth_dev
fi
fi
done
fi
if [ "$ACTION" = "remove" ]
then
# Turn on bluetooth discovery if device disconnects
sudo hciconfig hci0 piscan
fi
now i can stream music via bluetooth from my handy through the hifiberry dac -
HiFiBerry team Hi,
thank you for this information. Some users have reported high CPU load with PulseAudio and bluetooth. What is the CPU usage by PulseAudio in your setup?
Best regards
Daniel -
vitalic CPU usage is betwenn 15 - 17 % (Raspi 2) -
HiFiBerry team Thank you for the feedback.
Daniel
Please sign in to leave a comment.