Page 1 of 1
Audio not streaming?
Posted: Thu Feb 19, 2015 12:12 pm
by Heartland
So i am trying to create a bluetooth speaker with the speakers I've already got and a bluetooth adapter on my pi. However the pi and my phone is now connected, however I cant get any audio to play. Does anyone know why or can help me?
thanks
Re: Audio not streaming?
Posted: Thu Feb 19, 2015 3:45 pm
by tpylkko
If you don't know this it is easier to do this with wifi, and with wifi you can stream unpacked 24 bit hires audio, whereas with bluetooth your going to have to stream packed audio and it will not work out-of-the-box. Which OS are you using?
Re: Audio not streaming?
Posted: Thu Feb 19, 2015 6:49 pm
by Heartland
already brought the bluetooth adapter so im doing it by bluetooth. Raspbain is the one im using.
Re: Audio not streaming?
Posted: Thu Feb 19, 2015 7:14 pm
by tpylkko
Bluez 5. 28?
Re: Audio not streaming?
Posted: Thu Feb 19, 2015 7:16 pm
by Heartland
i dont know what you mean, sorry? i installed something along the line of "blueman"
Re: Audio not streaming?
Posted: Thu Feb 19, 2015 7:37 pm
by tpylkko
http://www.raspberrypi.org/forums/viewtopic.php?t=68779
pairing the device is only a part of the process.
See the thread on bluetooth audio streamin
Re: Audio not streaming?
Posted: Thu Feb 19, 2015 8:09 pm
by Heartland
i was following this project as well as a few others and have done all the steps to where audio should work. Thats where i realized something wasn't right.
Re: Audio not streaming?
Posted: Thu Feb 19, 2015 8:49 pm
by tpylkko
are your speakers connected to the pi via an amp that inputs on HDMI? or are you using the analog audio out? Or maybe even something else?
Re: Audio not streaming?
Posted: Thu Feb 19, 2015 10:29 pm
by Douglas6
Isolate the problem. Are you running PulseAudio systemwide? Can you play a local file with 'sudo paplay'? Does the phone show a 'use for media audio' under the paired device? With the phone connected and playing audio, does 'sudo pactl list sources' show the Bluetooth source? Do you have a udev rule (or other method) to load the loopback module? Does 'sudo pactl list modules' show the loaded loopback module? Does it show the proper source and sink?
Re: Audio not streaming?
Posted: Sat Feb 21, 2015 7:11 pm
by Heartland
Im using a 3.5mm audio connector. However i have tried plugging my apple headphones into the pi and i get no sound that way either.
When i typed
it returned:
Code: Select all
pi@raspberrypi ~ $ sudo pactl list sources
Source #0
State: SUSPENDED
Name: alsa_output.platform-bcm2835_AUD0.0.analog-stereo.monitor
Description: Monitor of bcm2835 ALSA Analog Stereo
Driver: module-alsa-card.c
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 4
Mute: no
Volume: 0: 100% 1: 100%
0: 0.00 dB 1: 0.00 dB
balance 0.00
Base Volume: 100%
0.00 dB
Monitor of Sink: alsa_output.platform-bcm2835_AUD0.0.analog-stereo
Latency: 0 usec, configured 0 usec
Flags: DECIBEL_VOLUME LATENCY
Properties:
device.description = "Monitor of bcm2835 ALSA Analog Stereo"
device.class = "monitor"
alsa.card = "0"
alsa.card_name = "bcm2835 ALSA"
alsa.long_card_name = "bcm2835 ALSA"
alsa.driver_name = "snd_bcm2835"
device.bus_path = "platform-bcm2835_AUD0.0"
sysfs.path = "/devices/platform/bcm2835_AUD0.0/sound/card0"
device.string = "0"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card"
Formats:
pcm
Source #1
State: SUSPENDED
Name: bluez_source.78_6C_1C_5A_CF_1D
Description: Ipod touch, Emma
Driver: module-bluetooth-device.c
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 25
Mute: no
Volume: 0: 100% 1: 100%
0: 0.00 dB 1: 0.00 dB
balance 0.00
Base Volume: 100%
0.00 dB
Monitor of Sink: n/a
Latency: 0 usec, configured 0 usec
Flags: HARDWARE DECIBEL_VOLUME LATENCY
Properties:
bluetooth.protocol = "a2dp_source"
device.description = "Ipod touch, Emma"
device.string = "78:6C:1C:5A:CF:1D"
device.api = "bluez"
device.class = "sound"
device.bus = "bluetooth"
device.form_factor = "portable"
bluez.path = "/org/bluez/2147/hci0/dev_78_6C_1C_5A_CF_1D"
bluez.class = "0x6a041c"
bluez.name = "Ipod touch, Emma"
device.icon_name = "multimedia-player-bluetooth"
Formats:
pcm
this is was while i was playing music.
Re: Audio not streaming?
Posted: Sat Feb 21, 2015 8:13 pm
by Douglas6
OK, good, you have a Bluetooth audio source. To connect that to your audio out, try
Code: Select all
sudo pactl load-module module-loopback source=bluez_source.78_6C_1C_5A_CF_1D sink=0
That should get the sound playing. To make that automatic, see this post:
http://www.raspberrypi.org/forums/viewt ... 13#p619713 and follow the instructions for setting up a udev rule, at the bottom of step 5 (the 'Finally (finally!)' step.)
Ignore the cron nonsense in that b.ramus post mentioned earlier.
Re: Audio not streaming?
Posted: Sat Feb 21, 2015 9:23 pm
by Heartland
[quote="Douglas6"]OK, good, you have a Bluetooth audio source. To connect that to your audio out, try
Code: Select all
sudo pactl load-module module-loopback source=bluez_source.78_6C_1C_5A_CF_1D sink=0
That should get the sound playing.
That doesnt work sorry.
Re: Audio not streaming?
Posted: Sat Feb 21, 2015 9:34 pm
by Douglas6
Does it return an error? What does 'sudo pactl list modules' show? Are you sure the phone is not paused? Your previous output showed 'SUSPENDED' like the phone was not playing audio.
Re: Audio not streaming?
Posted: Sun Feb 22, 2015 12:23 pm
by Heartland
returns
Code: Select all
Module #23
Name: module-bluetooth-device
Argument: address="78:6C:1C:5A:CF:1D" path=" /org/bluez/2149/hci0/dev_78_6C_1C_5A_CF_1D" profile="a2dp_source" auto_connect=no
Usage counter: 0
Properties:
module.author = "Joao Paulo Rechi Vita"
module.description = "Bluetooth audio sink and source"
module.version = "2.0"
I hope thats the right module, cant find a way to copy and paste something out of my remote desktop into my normal desktop on my laptop.
it doesn't return an error but a number which gets greater each time i run the command. Its not paused.
Re: Audio not streaming?
Posted: Sun Feb 22, 2015 2:56 pm
by Douglas6
You should be looking for a module-loopback module with the same number as that returned by the pactl load-module command. Mine looks like this
Code: Select all
Module #14
Name: module-loopback
Argument: source=bluez_source.AA_BB_CC_DD_EE_FF sink=0
Usage counter: n/a
Properties:
module.author = "Pierre-Louis Bossart"
module.description = "Loopback from source to sink"
module.version = "2.0"
Make sure the phone is trusted.
Code: Select all
sudo bluez-test-device trusted 78:6C:1C:5A:CF:1D
should return '1'. If it returns '0', do
Code: Select all
sudo bluez-test-device trusted 78:6C:1C:5A:CF:1D yes
Then disconnect your phone and re-connect.
Re: Audio not streaming?
Posted: Mon Feb 23, 2015 1:27 pm
by Heartland
ok i have that module and has made the phone trusted, but i still cant get it to play any music!
Re: Audio not streaming?
Posted: Mon Feb 23, 2015 1:45 pm
by Douglas6
OK, back to an earlier question. Does 'sudo paplay <local.wav>' work? You are using powered speakers, right? Check alsamixer to ensure that the volume is turned up. When you 'sudo pactl list sources', does the Bluetooth source show 'RUNNING' and not 'SUSPENDED'?
Re: Audio not streaming?
Posted: Mon Feb 23, 2015 10:12 pm
by Heartland
So I did the alsamixer and it was down on 0, so I turned it up to 100. I did this on both bars was this right? I don't have any local files on my pi and as I'm a newbie to the pi, I don't really get how to get them. And yeah it says suspended when is paused and when its playing.
Re: Audio not streaming?
Posted: Tue Feb 24, 2015 4:27 am
by Douglas6
There is a test file on the Pi. I think it's at /usr/share/sounds/alsa/Front_Center.wav (I don't have my Pi to hand).
Re: Audio not streaming?
Posted: Tue Feb 24, 2015 1:46 pm
by Heartland
ok. i don't know what that sound file is meant to sound like but all i can hear is a hissing sound when i play it, but that is an improvement when i just play songs from my phone to my speakers, over bluetooth. The hissing sound is only when the sound is playing as it stops when the sound is over.