GithubHelp home page GithubHelp logo

issue with bluetooth about raveberry HOT 24 CLOSED

mageunic avatar mageunic commented on June 2, 2024
issue with bluetooth

from raveberry.

Comments (24)

raveberry avatar raveberry commented on June 2, 2024

This might have to do with the fact that Raveberry uses system service to run pulseaudio. What is your output for PULSE_SERVER=127.0.0.1 pactl info and PULSE_SERVER=127.0.0.1 pactl list short sinks?
Also is the pulseaudio service running? (systemctl status pulseaudio)
Does analog output through the audio jack still work?

The first command should tell you the default output device (which is where sound should be transmitted to). The second one lists all available devices. Maybe they are in a format Raveberry does not recognize. You can change the output device with PULSE_SERVER=127.0.0.1 pactl set-default-sink <sink-number>.

The PULSE_SERVER=127.0.0.1 is needed so pactl knows to communicate with the system instance.

from raveberry.

mageunic avatar mageunic commented on June 2, 2024

for the following command line : PULSE_SERVER=127.0.0.1 pactl info
i get :
Server String: 127.0.0.1
Library protocol version: 32
Server protocol version: 32
Local : no
Customer index : 0
Tile Size: 65496
Username: pulse
Host name: raveberry
Server name : pulseaudio
Server version: 12.2
Default sample specification: s16le 2ch 44100Hz
Default channel plan: front-left,front-right
Default destination: alsa_output.platform-soc_audio.analog-mono
Default source: alsa_output.platform-soc_audio.analog-mono.monitor
Cookie: d959:145f

And for : PULSE_SERVER=127.0.0.1 pactl list short sinks , i get :
0 alsa_output.platform-soc_audio.analog-mono module-alsa-card.c s16le 1ch 44100Hz SUSPENDED

And I see that pulse audio is running

from raveberry.

raveberry avatar raveberry commented on June 2, 2024

Looks like your bluetooth device is not even connected, list short sinks should show something like:
4 bluez_sink.<addr>.a2dp_sink module-bluez5-device.c s16le 2ch 44100Hz SUSPENDED
Can you see your device when you scan in the settings page?
What does the page say if you try to connect?

Thanks to this issue I just found and fixed a bug where the pactl commands in Raveberry itself were not supplied with the PULSE_SERVER environment, I wonder how it ever worked before...
This new version (0.5.11) also adds the possibility to change your output device in the settings page.

Maybe this will help you with your problem.

from raveberry.

mageunic avatar mageunic commented on June 2, 2024

Yes, my Bluetooth speaker ( Bose 404+) is connected to my Pi :
bluetooth issue

bluetooth issue2

from raveberry.

mageunic avatar mageunic commented on June 2, 2024

I still have the same problem even with an update( 0.5.11) and a new installation and moreover the music is automatically deleted from the playlist.

from raveberry.

raveberry avatar raveberry commented on June 2, 2024

The weird thing is that your system is connected to the bluetooth device, but it does not show up in your pulseaudio devices.
Can you check, that the bluetooth module is loaded?
PULSE_SERVER=127.0.0.1 pactl load-module module-bluetooth-discover
Should return Failure: Module initialization failed
and an error like Module "module-bluetooth-discover" should be loaded once at most. should be logged to /var/log/syslog.
It might also be related to your full raspbian install. I only tested on the raspbian lite version, if I find time I will install the full version and try it there as well.

The error with your playlists getting deleted:
I assume they are not played at all, just skipped from top to bottem? This sometimes happens if mopidy has an error playing the song, so it continuously skips on to the next one. A simple restart of mopidy (sudo systemctl restart mopidy) or in the worst case a system reboot fixes this most of the time. This is most likely unrelated to the bluetooth issue. If it persists, please open a new issue with the logs from mopidy and daphne.

from raveberry.

mageunic avatar mageunic commented on June 2, 2024

Hi, I'll give you some screenshots :
bluetooth issue3
bluetooth issue4

For issue of playlist:
I plugged my audio cable in wrong and after a reboot everything's fine.

from raveberry.

raveberry avatar raveberry commented on June 2, 2024

This looks like the bluetooth module was loaded with the first command, as it did not raise an error there. This module should already be loaded however.
I just found out that Raveberry doesn't actually configure the pulseaudio system instance to load the bluetooth modules. Could you try adding the following lines to /etc/pulse/system.pa and reboot afterwards?

.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

I copied this from the default.pa which is only executed for user instances, but not the system service.

There is also another pulseaudio error in your syslog, but I'm not sure about its significance (the one about backend-ofono.c). Since your speaker worked before Raveberry installation, it should be possible to make it work.

from raveberry.

mageunic avatar mageunic commented on June 2, 2024

Hi, after rewrite line in /etc/pulse/system.pa and reboot. I can see my speaker in Output Device but when I select it, Output device changes back to alsa output.
bluetooth issue7

Currently, no sound is emitted from the Bluetooth speaker.

from raveberry.

raveberry avatar raveberry commented on June 2, 2024

Great, that looks like Raveberry now recognizes the speaker! I will add this to the installation process.
What do you mean by selecting: Do you click the bluez device and it instantly selects the first element in the dropdown afterwards, so you can't even set it as the output device?
This might just be a frontend issue, I just need specific info to fix it because I thought I already dealt with this.

There is a good chance that the rest is actually working. You can test it by opening your browsers's console (F12 usually) and running this code:

$.post('/ajax/settings/set_output_device/', {
	device: 'bluez_sink.2C_41_A1_96_40_7E.a2dp_sink',
}, function(response) {
	successToast(response);
}).fail(function(response) {
	errorToast(response.responseText);
});

This is exactly what the "Set Output Device" button would do if you could select the device, sending the request to the server. The string after device needs to match the element in the dropdown exactly.

As a side note: Don't paste random code into your console just because people tell you to. I know I'm not making a strong point here right after instructing you to do so, but not being careful there can cause serious harm. This time it's ok (I swear) since this is exactly the code that would have run anyway, just a general heads up.
(sorry for the unnecessary advice if you are experienced with this stuff, I just could not write this without a discaimer)

from raveberry.

mageunic avatar mageunic commented on June 2, 2024

it works !!!! ( with command in the console )

Yes I pay attention to the command that is sent to me I partially check what the command line consists of.
Thank you and great job
for output device : when i select my bluetooth speaker, it instantly selects the first element in the dropdown afterwards

from raveberry.

raveberry avatar raveberry commented on June 2, 2024

v0.6.3: The bluetooth module is now loaded by default and the device selection now works in chrome as well (I only tested it in firefox before).

Thanks for raising the issue. Bluetooth connectivity has been a problem for some time now, and I hope that this finally fixed it.

from raveberry.

mageunic avatar mageunic commented on June 2, 2024

I just reinstalled raspbian and raveberry and saw that the following lines are not present in /etc/pulse/system.pa :

.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

but the button SetOutput Device work correctly

from raveberry.

raveberry avatar raveberry commented on June 2, 2024

Does the audio output work for bluetooth or is it broken again?
When I tested it, it was sufficient to add this one line: load-module module-bluetooth-policy, which should be present.

from raveberry.

mageunic avatar mageunic commented on June 2, 2024

I have just tested and confirmed that your command line works on its own but it was not present before I modified the file.

from raveberry.

raveberry avatar raveberry commented on June 2, 2024

that's weird. can you paste the content of the file? Preferably in the state before you modified it.

from raveberry.

mageunic avatar mageunic commented on June 2, 2024

My /etc/pulse/system.pa without modification :

load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

.ifexists module-udev-detect.so
load-module module-udev-detect
.else

load-module module-detect
.endif

.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

load-module module-default-device-restore

load-module module-rescue-streams

load-module module-always-sink

load-module module-suspend-on-idle

.else

load-module module-detect
.endif

.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

load-module module-default-device-restore

load-module module-rescue-streams

load-module module-always-sink

load-module module-suspend-on-idle

load-module module-position-event-sounds
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
load-module module-bluetooth-discover

from raveberry.

raveberry avatar raveberry commented on June 2, 2024

So the bluetooth line was added during the Raveberry installation, but bluetooth playback did not work until you changed it?
Because it's right there at the end of the file.

from raveberry.

mageunic avatar mageunic commented on June 2, 2024

before I added the line : load-module module-bluetooth-policy ,the bluetooth transmission wasn't working.

from raveberry.

raveberry avatar raveberry commented on June 2, 2024

Alright, so this line was needed as well, apparently some bluetooth devices require different configuration. With 0.6.4, this line is also added during install.

from raveberry.

mageunic avatar mageunic commented on June 2, 2024

Hi, it's me again, I have updated raveberry on my RPI with the command line in README.md but the Bluetooth doesn't work anymore. i checked the file : /etc/pulse/system.pa and the line load-module module-bluetooth-policy is present. My Bluetooth speaker doesn't appear in Output device list.

from raveberry.

raveberry avatar raveberry commented on June 2, 2024

Maybe the stored device were reset with the update.
Were you able to connect the speaker: does it show up if you scan for devices?

from raveberry.

mageunic avatar mageunic commented on June 2, 2024

I have reboot my RPI today and it works. I don't know why it didn't work yesterday. Sorry for the inconvenience.... Thx for this fix

from raveberry.

raveberry avatar raveberry commented on June 2, 2024

Sometimes a reboot does magic. Great that it works again.

from raveberry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.