Closed enduity closed 7 years ago
Well, 1) All the needed software to run mpradio is installed as dependency during the install via the installation script install.sh (which you have to run with sudo for it to work proprely) 2) simple-agent too, is installed via the installer (in a tweaked version to allow every connection) so you don't need to install anything else 3) simple-agent is up and running as a systemd service (read the info in the main page of this repo) 4) you don't launch ./mpradio manually except for debugging (because of user swapping issues) 5) it is true that the bluetooth device has to be passed via parameter, but pulseaudio uses another convention for the name of the bluetooth audio sources, therefore, simply indicating the bluetooth address won't work (you can read pulseaudio documentation or bluetooth script in the install folder to see how it's implemented)
6) last but not least, I updated the repo yesterday night, i suggest you to clean what you did before (even a reinstall of raspbian minimal is fine) and install fresh clean. That should work out of the box, without needing to launch anything from terminal.
So, I did a fresh raspbian lite install like you said, and installed it again. Still no bluetooth. I did find out how to pass my device on to it, and then it works, but it doesn't work itself. Still says it couldn't rewind.
Good! We made one step forward. 1) are you aware the first connection always fails (see known issues section ) 2) What is the output of tail -f /var/logs/bluetooth_dev when you connect/disconnect your phone? Try to follow the log realtime and see what happens. If new lines do not appear, it might be necessary to reload udev: "systemctl force-reload udev systemd-udevd-control.socket systemd-udevd-kernel.socket"
1) Yes 2) It looks fine, but is remove and add supposed to be backwards? Also, analyzing the code, I don't get where the $ACTION variable is coming from. Granted, I just may be bad at bash.
I'm not a big udev expert myself, but it seems to be some kind of environment variable provided to the executed script by the specified kernel rule... anyways it's just the variable that stores the add or remove string needed for the bluetooth script to take action. I think it's no problem with the order, maybe you first see "disconnected" from the previous session and then "connected" from the current one. have you tried running the command line for udev refresh? did it sort any effect?
I did the refresh, no change. It seems that it gets connected, and then immediately the remove call is executed. Sometimes my pc still shows Connected without music but sometimes it just Disconnects ("Paired"). It's just this on a loop:
pi@raspberrypi:~/mpradio-master/install $ sudo tail -f /var/log/bluetooth_dev
Executing bluetooth script...|add|
BT connected
BT bluez_source.18_5E_0F_19_ED_75.a2dp_source
Setting bluez_source to: bluez_source.18_5E_0F_19_ED_75.a2dp_source
Executing bluetooth script...|remove|
Executing bluetooth script...|add|
BT connected
BT bluez_source.18_5E_0F_19_ED_75.a2dp_source
Setting bluez_source to: bluez_source.18_5E_0F_19_ED_75.a2dp_source
Executing bluetooth script...|remove|
Executing bluetooth script...|add|
BT connected
BT bluez_source.18_5E_0F_19_ED_75.a2dp_source
Setting bluez_source to: bluez_source.18_5E_0F_19_ED_75.a2dp_source
Executing bluetooth script...|remove|
Executing bluetooth script...|add|
BT connected
BT bluez_source.18_5E_0F_19_ED_75.a2dp_source
Setting bluez_source to: bluez_source.18_5E_0F_19_ED_75.a2dp_source
Executing bluetooth script...|remove|
Executing bluetooth script...|add|
BT connected
BT bluez_source.18_5E_0F_19_ED_75.a2dp_source
Setting bluez_source to: bluez_source.18_5E_0F_19_ED_75.a2dp_source
Executing bluetooth script...|remove|
Executing bluetooth script...|add|
BT connected
BT bluez_source.18_5E_0F_19_ED_75.a2dp_source
Setting bluez_source to: bluez_source.18_5E_0F_19_ED_75.a2dp_source
Executing bluetooth script...|remove|
I'm trying to reproduce this issue without luck. I guess if you are right, and the remove action is launched too early when the device is stil connected, that might be a good explaination of your pi's behaviour. Can you debug this more precisely? (check all the variables content and condition results by echoing them etc...) that'd be helpful.
Bluetoothctl outputs this every connection:
Nothing really on dmesg except for the bluetooth device being setup as input every connection:
[ 916.173178] input: 18:5E:0F:19:ED:75 as /devices/virtual/input/input0
I really don't know where to look, since all the scripts seem to be working fine. What actually says if the device disconnects or disconnects it? The bluetoothctl output seems weird because the UUID seems to be tied to two Bluetooth LE devices connected to each other, but my computer doesn't have Bluetooth LE.
Hi. sorry for the late response. What about just echoing the bluetooth script variables to stdin?
pulseaudio was being killed upon mpradio restart, should be fixed now.
I first installed the DD image, but that didn't work at all. So I uninstalled mpradio and installed it from this repo. And MP3 works. But Bluetooth doesn't. I had to install some Bluetooth stuff (notably pi-bluetooth) for Bluetooth to work at all and then make my own simple-agent using a python script I found that replicates it (there was no simple-agent.sh). But it still doesn't work. I get an error, after running mpradio: