Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: tcl_user5 on July 15, 2022, 03:51:37 PM

Title: [Solved] Blueman error in Pi-400, picore-13.0.3
Post by: tcl_user5 on July 15, 2022, 03:51:37 PM
I have installed Blueman on Pi-400 (picore-13.0.3). When I try to run it with blueman-manager, I am getting the following error and Bluetooth does not start.
"blueman-manager version 2.1.3 starting,
Stale PID, overwriting
Segmentation fault"

I have loaded the following bluetooth related extensions onboot:-
1) firmware-rpi-bt
2) blueman
3) bluez-tools
4) bluetooth-5.10.77-piCore-v71


Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: Juanito on July 16, 2022, 10:37:53 AM
Did you check bluetoothd was running?

Did you try starting blueman-manager/blueman-applet from a terminal window?

Do you see the same problem with piCore64?
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: tcl_user5 on July 17, 2022, 01:05:49 AM
(1) I tried bluetoothctl in terminal window. I got the message- trying to connect to bluetoothd but nothing happens subsequently.

(2) I had tried blueman-manager from terminal window. The reported error of ""blueman-manager version 2.1.3 starting, Stale PID, overwriting Segmentation fault" was received in response to the blueman-manager command.

(3) I tried piCore64. The same problem is NOT there. In response to blueman-manager, it asks whether bluetooth should be automatically turned on.
However, I am getting a different error (adapter not found) in piCore64 after saying yes to above question. Pl see attachment.
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: Juanito on July 17, 2022, 01:26:42 AM
It sounds like you need:
Code: [Select]
sudo /usr/local/etc/init.d/bluez start
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: tcl_user5 on July 17, 2022, 01:50:21 AM
(1) I have already done that at startup.

/usr/local/etc/init.d/bluez start
/usr/local/etc/init.d/dbus start

is included in /opt/bootsync.sh

(2) Does bluetooth have to be enabled by some setting in cmdline.txt or config.txt ? I feel so since I am getting the message of "No default controller available" on using bluetoothctl.
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: Juanito on July 17, 2022, 02:12:36 AM
You don’t need to start dbus, the bluez init.d will start it.

What does this give:
Code: [Select]
ps aux | grep blue
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: Juanito on July 17, 2022, 03:45:29 AM
Sorry - I'd forgotten that several bluetooth startup commands are required on piCore/piCore64.

The bluez extension info file gives details.

I used an old script (see attached) after loading bluez and blueman using an RPi4 running piCore64 and was able to pair with another device using blueman.
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: Paul_123 on July 18, 2022, 08:22:47 AM
That script should work.  There have been recent tweaks to the startup.   It is based on RaspiOS bluetooth.   Which is in this repo:  https://github.com/RPi-Distro/pi-bluetooth

Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: tcl_user5 on July 18, 2022, 08:55:10 AM
Hi Juanito,

(1) The script- bt_start.sh works properly on RPi-400 running PiCore64. Thanks for sharing the same.

(2) However, the script does not work on the same device while running on Picore-13.0.3. It throws up an error of being unable to load the bluetooth module (modprobe: can't load bluetooth (kernel.tclocal/net/bluetooth/bluetooth.ko) : unknown symbol in module, or unknown parameter)

P.S- On PiCore64, after running the script, I was able to connect the RPi-400 to a bluetooth speaker. But unable to test audio ouput on the paired device as I was not getting any audio output in the RPi-400. While trying to play a video on Firefox, pavucontrol was relaying sound to "Dummy output". I am trying to fix the same (read suggestions of setting hdmi_drive = 2 in config.txt). So, I will update after testing audio output on the paired Bluetooth device.

Strangely, while running Picore-13.0.3, I was able to get audio output on the same RPi-400 device through attached speakers on a Samsung TV monitor connected using HDMI. The same setup was not giving audio output with PiCore64. I wonder why..
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: Juanito on July 18, 2022, 09:46:46 AM
It throws up an error of being unable to load the bluetooth module (modprobe: can't load bluetooth (kernel.tclocal/net/bluetooth/bluetooth.ko) : unknown symbol in module, or unknown parameter)

It looks like the bluetooth-KERNEL extension in piCore is missing a kernel module - "modinfo bluetooth" will give the dependencies, which you can modprobe one by one to find which one is missing.
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: Juanito on July 18, 2022, 12:09:58 PM
Ah - it looks like bluetooth-5.10.77-piCore-v7l is missing the following:
Code: [Select]
usr/local/lib/modules/5.10.77-piCore-v7/kernel/crypto/ecdh_generic.ko
usr/local/lib/modules/5.10.77-piCore-v7/kernel/crypto/ecc.ko
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: Juanito on July 19, 2022, 03:30:50 AM
Updated bluetooth-5.10.77-piCore-v7l posted.
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: tcl_user5 on July 19, 2022, 03:52:06 AM
I was able to fix the issue of no audio output ("Dummy output" in pavucontrol) in RPi-400 by changing the "dtoverlay=vc4-kms-v3d" setting in config.txt to "dtoverlay=vc4-fkms-v3d". Now, I am able to get audio output through HDMI when connecting to a Samsung TV monitor with speakers.

After running the bt_start.sh script shared by Juanito, Bluetooth pairs properly when running PiCore64. However, there is no audio output on the Bluetooth device (headphone). Audio output continues to be sent over HDMI after pairing.

Other users may kindly confirm whether they are able to get audio output on bluetooth device after pairing in RPi-400.

Either I am missing setting some parameter in config.txt or there is some issue in the way pavucontrol is interacting with Blueman in Picore64. I mention this issue since in TinyCorePure64, after pairing with bluetooth device, pavucontrol displays bluetooth device and inbuilt speaker modes out of which you can toggle any option. Similar option is not seen after bluetooth pairing in PiCore64.

Just to rule out any hardware issues, I checked using Raspberry Pi OS and sound works fine on HDMI output and Bluetooth devices on the same RPi-400 device with a toggle option similar to what I mentioned above.
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: Juanito on July 19, 2022, 05:36:47 AM
I believe the hdmi audio output depends on the order in which extensions are loaded - graphics-KERNEL would need to be loaded before the audio/bluetooth extensions.

Using dtoverlay=vc4-kms-v3d and an RPi4 running piCore64, audio will switch between the audio jack and bluetooth headphones without problems (see attached) - I don't have an hdmi connected audio device to test.

Edit: I managed to test hmdi audio - it works.
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: tcl_user5 on July 21, 2022, 05:05:40 AM
On Pi-400 running PiCore64, I am getting HDMI audio output (on TV monitor) properly. I am not getting audio output on paired bluetooth device.

In the playback tab of Pavucontrol, I am not able to toggle between HDMI and Bluetooth. Even when HDMI audio output is set to zero level or source in Pavucontrol changed to "Off", HDMI sound continues to play at the same audio level.

This makes me feel that I am missing some boot/configuration parameter which needs to be set for making audio work on bluetooth and audio is going to HDMI output by default.

I tried adding snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_a2dp=1 snd_bcm2835.enable_hdmi=1 to cmdline.txt. But it
has not helped. (I am not sure about snd_bcm2835.enable_a2dp being the right parameter, I used it similar to snd_bcm2835_hdmi and a2dp being the bluetooth sink). Kindly advise if these parameters need to be added in the first place for getting audio on bluetooth and whether they are correct.

I am also attaching my config.txt, cmdline.txt  just to ensure I am not missing anything basic. My onboot.lst is as follows
Code: [Select]
openssh.tcz
Xorg.tcz
aterm.tcz
wbar.tcz
flwm.tcz
firmware-rpi-bt.tcz
alsa.tcz
bluez.tcz
firefox.tcz
blueman.tcz
libpci.tcz
pavucontrol.tcz
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: Juanito on July 21, 2022, 10:49:50 AM
Did you check that the graphics-KERNEL extension is loaded before the audio/bluetooth extensions?

Are you using kms or fkms?

There might be a difference between the RPi4 and Pi-400, but using kms I am able to swap between hdmi and bluetooth audio without problems and without anything special in config.txt.

Edit: from your onboot.lst, you don’t appear to be loading graphics-KERNEL at all.
Title: Re: Blueman error in Pi-400, picore-13.0.3
Post by: tcl_user5 on July 23, 2022, 10:08:13 AM
I figured out that the issue of being unable to toggle between HDMI and Bluetooth audio was occurring due to a browser issue. Toggling does NOT work in Firefox Nightly 91.7.0 ESR (which I was consistently using) and audio is outputted only to HDMI. When I shifted to Epiphany, it started working.  I am now able to get audio on paired bluetooth headphones. I am attaching the screenshots with Epiphany (working) and Firefox Nightly (not working).

Its working even without loading graphics-KERNEL at onboot (or later) and even after commenting out dtoverlay=vc4-fkms-v3d-pi4 in config.txt.

Subsequently, I checked on x86_64. Toggling between audio streams works in newer versions of Firefox (102.0.1). So, it seems to be an issue with older Firefox versions. Wonder if there is any workaround for this..... Chromium based browsers like Brave also work properly .

Kindly mark the issue as solved.

Thanks @ Juanito for your patience in suggesting various checks. Important learning point was the need for running various startup commands to enable bluetooth in RPi
Title: Re: [Solved] Blueman error in Pi-400, picore-13.0.3
Post by: Rich on July 23, 2022, 12:11:55 PM
Hi tcl_user5
... Kindly mark the issue as solved. ...
Done. :)