morrolinux / mpradio

Morrolinux's Pirate radio (PiFmRDS / PiFmAdv implementation with Bluetooth and mp3 support) - Stream music to your car's FM radio or use it as a Bluetooth speaker via headphone jack
GNU General Public License v3.0
107 stars 17 forks source link

Not working on Pi Zero W #18

Closed donagrejja closed 6 years ago

donagrejja commented 6 years ago

Hi.

I'm having some issues with this on my Pi Zero W.

I've tried the 0.6 version both image download and the source download. Here mpradio seems to start and work properly but when pairing it doesn't let me pair anything into it. I can't find anything wrong in the config in the ready image.

I've also tried the git repo version and here it's also not working. Pairing works properly here but it's missing options for playing sound to the device. If i change the class to 0x240420 it appears as a car audio / multimedia unit but still doesn't present options for playing media to the devie. My phone doesn't stay connected when i've connected to the device either. mpradio is in status "dead" that is not run and pulseaudio is also not running and neither is the radio software.

Sorry to say but I have yet to find any version of this software that just works.

Any hints to what i'm doing wrong ? Or any information that you need to clarify things ?

Thanks.

morrolinux commented 6 years ago

Hello Due to lots of recent changes in pulseaudio's upstream, many things went wrong with this code, which relied on few components which changed interface (eg: bluez device name in PA's mixer, ect) So I still have to update the code to fix all of them (which apparently started to grow in number) and eventually publish a 0.7 ready-to-flash image to make sure it works anytime. As for the 0.6 image, it's tested to work with my bluetooth adapter, which only support legacy pairing mode, but not with more recent adapters. That problem should have been solved in the github's version as I later got a Pi Zero and started developing there as well. I'll update the code soon (scheduled this week), please stand by

2018-01-20 22:19 GMT+01:00 Stefan Andersson notifications@github.com:

Hi.

I'm having some issues with this on my Pi Zero.

I've tried the 0.6 version both image download and the source download. Here mpradio seems to start and work properly but when pairing it doesn't let me pair anything into it. I can't find anything wrong in the config in the ready image.

I've also tried the git repo version and here it's also not working. Pairing works properly here but it's missing options for playing sound to the device. If i change the class to 0x240420 it appears as a car audio / multimedia unit but still doesn't present options for playing media to the devie. My phone doesn't stay connected when i've connected to the device either. mpradio is in status "dead" that is not run and pulseaudio is also not running and neither is the radio software.

Sorry to say but I have yet to find any version of this software that just works.

Any hints to what i'm doing wrong ? Or any information that you need to clarify things ?

Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/morrolinux/mpradio/issues/18, or mute the thread https://github.com/notifications/unsubscribe-auth/ATWqbj5Vu83y_l-8oMFWFdlgrx_y4Zkdks5tMlhSgaJpZM4RllvK .

--

per il supporto tecnico rivolgersi a

Moreno Razzoli__ Avvertenze ai sensi del D.Lgs.196 del 30/06/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o files allegati, sono da considerarsi strettamente riservati. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nello stesso. Costituisce violazione ai principi dettati dal D.Lgs. 196/2003: trattenere il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo o utilizzarlo per finalità diverse. Qualora riceveste questo messaggio senza esserne il destinatario Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Grazie.

donagrejja commented 6 years ago

Thank you for your quick reply =)

donagrejja commented 6 years ago

Pulled the latest version from git on a fresh raspbian stretch lite installation now and for me it still doesn't work.

I can pair my samsung galaxy s7 with the pi but when i do it doesn't show any media output options on the paired device. Also the phone doesn't stay "connected" to the pi and mpradio doesn't spawn. seems like that since the script can't find any actual bluetooth device connected it doesn't spawn.

-- in case you need some info --

`root@raspberrypi:~# systemctl status simple-agent ● simple-agent.service - simple-agent service Loaded: loaded (/etc/systemd/system/simple-agent.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2018-01-22 09:51:38 UTC; 17min ago Main PID: 418 (simple-agent) CGroup: /system.slice/simple-agent.service └─418 /usr/bin/python /bin/simple-agent

Jan 22 09:51:38 raspberrypi systemd[1]: Started simple-agent service. Jan 22 09:51:38 raspberrypi bash[418]: mesg: ttyname failed: Inappropriate ioctl for device root@raspberrypi:~# systemctl status mpradio ● mpradio.service - Morrolinux Pirate Radio Loaded: loaded (/etc/systemd/system/mpradio.service; enabled; vendor preset: enabled) Active: inactive (dead) since Mon 2018-01-22 09:51:45 UTC; 17min ago Process: 421 ExecStart=/bin/bash -l -c /home/pi/mpradio (code=exited, status=0/SUCCESS) Main PID: 421 (code=exited, status=0/SUCCESS)

Jan 22 09:51:43 raspberrypi bash[421]: no frequency has been set. setting to default... Jan 22 09:51:43 raspberrypi bash[421]: 88.8 Jan 22 09:51:43 raspberrypi bash[421]: /pirateradio Jan 22 09:51:43 raspberrypi bash[421]: no bluetooth device provided, playing mp3s... Jan 22 09:51:43 raspberrypi sudo[451]: root : TTY=unknown ; PWD=/ ; USER=pi ; COMMAND=/bin/bash -c pulseaudio -D Jan 22 09:51:43 raspberrypi sudo[451]: pam_unix(sudo:session): session opened for user pi by (uid=0) Jan 22 09:51:44 raspberrypi pulseaudio[457]: Default and alternate sample rates are the same. Jan 22 09:51:44 raspberrypi pulseaudio[457]: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 Jan 22 09:51:44 raspberrypi pulseaudio[457]: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 Jan 22 09:51:44 raspberrypi sudo[451]: pam_unix(sudo:session): session closed for user pi root@raspberrypi:~# systemctl status bluetooth ● bluetooth.service - Bluetooth service Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2018-01-22 09:51:34 UTC; 17min ago Docs: man:bluetoothd(8) Main PID: 365 (bluetoothd) Status: "Running" CGroup: /system.slice/bluetooth.service └─365 /usr/lib/bluetooth/bluetoothd

Jan 22 09:51:34 raspberrypi systemd[1]: Started Bluetooth service. Jan 22 09:51:34 raspberrypi bluetoothd[365]: Starting SDP server Jan 22 09:51:34 raspberrypi bluetoothd[365]: Bluetooth management interface 1.14 initialized Jan 22 09:51:34 raspberrypi bluetoothd[365]: Failed to obtain handles for "Service Changed" characteristic Jan 22 09:51:34 raspberrypi bluetoothd[365]: Sap driver initialization failed. Jan 22 09:51:34 raspberrypi bluetoothd[365]: sap-server: Operation not permitted (1) Jan 22 09:51:44 raspberrypi bluetoothd[365]: Endpoint registered: sender=:1.20 path=/MediaEndpoint/A2DPSource Jan 22 09:51:45 raspberrypi bluetoothd[365]: Endpoint registered: sender=:1.20 path=/MediaEndpoint/A2DPSink Jan 22 09:51:45 raspberrypi bluetoothd[365]: Endpoint unregistered: sender=:1.20 path=/MediaEndpoint/A2DPSource Jan 22 09:51:45 raspberrypi bluetoothd[365]: Endpoint unregistered: sender=:1.20 path=/MediaEndpoint/A2DPSink `

morrolinux commented 6 years ago

I just committed the "big" update: if i didn't miss anything out, it should work. i got rid of pulseaudio which was one of the main sources of troubles to this project, and made some minor structural changes (yet to be documented)

2018-01-22 11:04 GMT+01:00 Stefan Andersson notifications@github.com:

Pulled the latest version from git on a fresh raspbian stretch lite installation now and for me it still doesn't work.

I can pair my samsung galaxy s7 with the pi but when i do it doesn't show any media output options on the paired device. Also the phone doesn't stay "connected" to the pi and mpradio doesn't spawn. seems like that since the script can't find any actual bluetooth device connected it doesn't spawn.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/morrolinux/mpradio/issues/18#issuecomment-359377151, or mute the thread https://github.com/notifications/unsubscribe-auth/ATWqbmcmyU1v8FMOU6p95siX_Zq2X_Qkks5tNF1LgaJpZM4RllvK .

--

per il supporto tecnico rivolgersi a

Moreno Razzoli__ Avvertenze ai sensi del D.Lgs.196 del 30/06/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o files allegati, sono da considerarsi strettamente riservati. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nello stesso. Costituisce violazione ai principi dettati dal D.Lgs. 196/2003: trattenere il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo o utilizzarlo per finalità diverse. Qualora riceveste questo messaggio senza esserne il destinatario Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Grazie.

donagrejja commented 6 years ago

I've tried the new commit with a freshly installed raspbian stretch lite.

Now it works to pair and see the audio options on the phone and also to play music.

However the sound is choppy so there might be some issues with settings in terms of performance ?

Thanks for the update =) Good job ! almost there ;)

morrolinux commented 6 years ago

Ok great! are you working on the Pi Zero W? I am testing it on that device and i see no trouble whatsoever: check the CPU usage with top or htop, should be <= 70% (a great improvement in performance since it was <= 95% with pulseaudio)

2018-01-22 14:41 GMT+01:00 Stefan Andersson notifications@github.com:

I've tried the new commit with a freshly installed raspbian stretch lite.

Now it works to pair and see the audio options on the phone and also to play music.

However the sound is choppy so there might be some issues with settings in terms of performance ?

Thanks for the update =) Good job ! almost there ;)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/morrolinux/mpradio/issues/18#issuecomment-359426186, or mute the thread https://github.com/notifications/unsubscribe-auth/ATWqbnynBLyqJM7yaK8ETuke2da3t7Ziks5tNJAKgaJpZM4RllvK .

--

per il supporto tecnico rivolgersi a

Moreno Razzoli__ Avvertenze ai sensi del D.Lgs.196 del 30/06/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o files allegati, sono da considerarsi strettamente riservati. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nello stesso. Costituisce violazione ai principi dettati dal D.Lgs. 196/2003: trattenere il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo o utilizzarlo per finalità diverse. Qualora riceveste questo messaggio senza esserne il destinatario Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Grazie.

donagrejja commented 6 years ago

Don't see any issue with the CPU usage actually now that I've chedked.

' Tasks: 106 total, 1 running, 105 sleeping, 0 stopped, 0 zombie %Cpu(s): 33.4 us, 15.8 sy, 0.0 ni, 50.2 id, 0.0 wa, 0.0 hi, 0.6 si, 0.0 st KiB Mem : 444532 total, 308080 free, 31972 used, 104480 buff/cache KiB Swap: 102396 total, 102396 free, 0 used. 361156 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1088 root 20 0 7404 2112 1840 S 24.4 0.5 0:34.04 pi_fm_rds 367 root 20 0 51412 5096 4572 S 6.2 1.1 0:17.51 bluealsa 1082 pi 20 0 4216 2600 2224 S 5.0 0.6 0:07.14 sox 926 root 20 0 0 0 0 S 3.8 0.0 0:05.36 kworker/u2:1 1090 root 20 0 0 0 0 S 3.4 0.0 0:03.49 kworker/u2:2 1043 root 20 0 8212 3288 2724 R 2.2 0.7 0:03.25 top 1081 pi 20 0 13900 2864 2532 S 0.6 0.6 0:00.98 arecord 172 root 20 0 0 0 0 S 0.3 0.0 0:01.12 brcmf_wdog/mmc1 362 root 0 -20 0 0 0 S 0.3 0.0 0:00.77 kworker/u3:2 613 pi 20 0 11636 4176 3416 S 0.3 0.9 0:01.13 sshd '

morrolinux commented 6 years ago

From which source are you playing? have you tried playing from youtube? maybe it's just about to give it a minute to settle down.

2018-01-22 14:51 GMT+01:00 Stefan Andersson notifications@github.com:

Don't see any issue with the CPU usage actually now that I've chedked.

' Tasks: 106 total, 1 running, 105 sleeping, 0 stopped, 0 zombie %Cpu(s): 33.4 us, 15.8 sy, 0.0 ni, 50.2 id, 0.0 wa, 0.0 hi, 0.6 si, 0.0 st KiB Mem : 444532 total, 308080 free, 31972 used, 104480 buff/cache KiB Swap: 102396 total, 102396 free, 0 used. 361156 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1088 root 20 0 7404 2112 1840 S 24.4 0.5 0:34.04 pi_fm_rds 367 root 20 0 51412 5096 4572 S 6.2 1.1 0:17.51 bluealsa 1082 pi 20 0 4216 2600 2224 S 5.0 0.6 0:07.14 sox 926 root 20 0 0 0 0 S 3.8 0.0 0:05.36 kworker/u2:1 1090 root 20 0 0 0 0 S 3.4 0.0 0:03.49 kworker/u2:2 1043 root 20 0 8212 3288 2724 R 2.2 0.7 0:03.25 top 1081 pi 20 0 13900 2864 2532 S 0.6 0.6 0:00.98 arecord 172 root 20 0 0 0 0 S 0.3 0.0 0:01.12 brcmf_wdog/mmc1 362 root 0 -20 0 0 0 S 0.3 0.0 0:00.77 kworker/u3:2 613 pi 20 0 11636 4176 3416 S 0.3 0.9 0:01.13 sshd '

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/morrolinux/mpradio/issues/18#issuecomment-359428741, or mute the thread https://github.com/notifications/unsubscribe-auth/ATWqbnjGBY4vLb5O0OG85DFqkHtI4PjYks5tNJJcgaJpZM4RllvK .

--

per il supporto tecnico rivolgersi a

Moreno Razzoli__ Avvertenze ai sensi del D.Lgs.196 del 30/06/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o files allegati, sono da considerarsi strettamente riservati. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nello stesso. Costituisce violazione ai principi dettati dal D.Lgs. 196/2003: trattenere il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo o utilizzarlo per finalità diverse. Qualora riceveste questo messaggio senza esserne il destinatario Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Grazie.

donagrejja commented 6 years ago

I've tried with both mxplayer and youtube and it's the same.

But if you aren't experiencing these issues I don't know what it could be.

Possibly compability issues or such.

morrolinux commented 6 years ago

Dunno, maybe try with your cellphone and let me know :)

2018-01-22 14:59 GMT+01:00 Stefan Andersson notifications@github.com:

I've tried with both mxplayer and youtube and it's the same.

But if you aren't experiencing these issues I don't know what it could be.

Possibly compability issues or such.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/morrolinux/mpradio/issues/18#issuecomment-359430877, or mute the thread https://github.com/notifications/unsubscribe-auth/ATWqblAOu-x2j1qlUct2gty1dIG25cwSks5tNJRKgaJpZM4RllvK .

--

per il supporto tecnico rivolgersi a

Moreno Razzoli__ Avvertenze ai sensi del D.Lgs.196 del 30/06/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o files allegati, sono da considerarsi strettamente riservati. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nello stesso. Costituisce violazione ai principi dettati dal D.Lgs. 196/2003: trattenere il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo o utilizzarlo per finalità diverse. Qualora riceveste questo messaggio senza esserne il destinatario Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Grazie.

donagrejja commented 6 years ago

This was with my cellphone =) Samsung Galaxy S7

Tested with another cellphone now (Nexus 5) and the result is still the same.

Also tested with different Pi Zero W hardware and it's the same =)

donagrejja commented 6 years ago

Found the issue: https://github.com/raspberrypi/linux/issues/1402

The issue is with wifi and bluetooth enabled at the same time.

If i disable the built-in wifi it works =)

morrolinux commented 6 years ago

are you on raspbian full desktop or minimal (just CLI)?

2018-01-22 15:24 GMT+01:00 Stefan Andersson notifications@github.com:

Found the issue: raspberrypi/linux#1402 https://github.com/raspberrypi/linux/issues/1402

The issue is with wifi and bluetooth enabled at the same time.

If i disable the built-in wifi it works =)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/morrolinux/mpradio/issues/18#issuecomment-359437623, or mute the thread https://github.com/notifications/unsubscribe-auth/ATWqbnwIbLWniNCYVN3ugSgUodDOwbo_ks5tNJoXgaJpZM4RllvK .

--

per il supporto tecnico rivolgersi a

Moreno Razzoli__ Avvertenze ai sensi del D.Lgs.196 del 30/06/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o files allegati, sono da considerarsi strettamente riservati. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nello stesso. Costituisce violazione ai principi dettati dal D.Lgs. 196/2003: trattenere il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo o utilizzarlo per finalità diverse. Qualora riceveste questo messaggio senza esserne il destinatario Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Grazie.

donagrejja commented 6 years ago

the lite version. only CLI and no graphical interface.

donagrejja commented 6 years ago

closed the issue now because this is no fault of your code =) thanks alot !

morrolinux commented 6 years ago

Adding to known issues, thanks for pointing out :)

donagrejja commented 6 years ago

Just a hint on the install script.

'cp: cannot create regular file '/etc/pulse/daemon.conf': No such file or directory'

morrolinux commented 6 years ago

That's right. I forgot to remove all references to pulseaudio which is no longer being used. Probably will come more clear on the next code cleanup :)

2018-01-23 0:38 GMT+01:00 Stefan Andersson notifications@github.com:

Just a hint on the install script.

'cp: cannot create regular file '/etc/pulse/daemon.conf': No such file or directory'

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/morrolinux/mpradio/issues/18#issuecomment-359611930, or mute the thread https://github.com/notifications/unsubscribe-auth/ATWqbkN6EDqGwat4fsmgja-UVn3XYlFFks5tNRvugaJpZM4RllvK .

--

per il supporto tecnico rivolgersi a

Moreno Razzoli__ Avvertenze ai sensi del D.Lgs.196 del 30/06/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o files allegati, sono da considerarsi strettamente riservati. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nello stesso. Costituisce violazione ai principi dettati dal D.Lgs. 196/2003: trattenere il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo o utilizzarlo per finalità diverse. Qualora riceveste questo messaggio senza esserne il destinatario Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Grazie.

donagrejja commented 6 years ago

also i think the bt-setup service/scripts needs to be delayed or such.

when i added "After: bluetooth.service" it could actually run at least. But was unable to pair to the device.

' root@pi-radio:~# systemctl status bt-setup ● bt-setup.service - mpradio bluetooth init script Loaded: loaded (/etc/systemd/system/bt-setup.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2018-01-22 23:37:29 UTC; 3min 38s ago Process: 268 ExecStart=/bin/bash /bin/bt-setup.sh (code=exited, status=1/FAILURE) Main PID: 268 (code=exited, status=1/FAILURE)

Jan 22 23:37:26 pi-radio systemd[1]: Started mpradio bluetooth init script. Jan 22 23:37:29 pi-radio bash[268]: Can't get device info: No such device Jan 22 23:37:29 pi-radio systemd[1]: bt-setup.service: Main process exited, code=exited, status=1/FAILURE Jan 22 23:37:29 pi-radio systemd[1]: bt-setup.service: Unit entered failed state. Jan 22 23:37:29 pi-radio systemd[1]: bt-setup.service: Failed with result 'exit-code'. '

morrolinux commented 6 years ago

Thanks for pointing out! you could make a pull request for the service file if you wish. simple-agent.service is responsible for the pairing, and I would need further investigation, but to me it seems like it's the same issue as for bt-setup (adding After=bluetooth.service) let me know :)

2018-01-23 10:28 GMT+01:00 Stefan Andersson notifications@github.com:

also i think the bt-setup service/scripts needs to be delayed or such.

when i added "After: bluetooth.service" is could actually run at least. But was unable to pair to the device.

' root@pi-radio:~# systemctl status bt-setup ● bt-setup.service - mpradio bluetooth init script Loaded: loaded (/etc/systemd/system/bt-setup.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2018-01-22 23:37:29 UTC; 3min 38s ago Process: 268 ExecStart=/bin/bash /bin/bt-setup.sh (code=exited, status=1/FAILURE) Main PID: 268 (code=exited, status=1/FAILURE)

Jan 22 23:37:26 pi-radio systemd[1]: Started mpradio bluetooth init script. Jan 22 23:37:29 pi-radio bash[268]: Can't get device info: No such device Jan 22 23:37:29 pi-radio systemd[1]: bt-setup.service: Main process exited, code=exited, status=1/FAILURE Jan 22 23:37:29 pi-radio systemd[1]: bt-setup.service: Unit entered failed state. Jan 22 23:37:29 pi-radio systemd[1]: bt-setup.service: Failed with result 'exit-code'. '

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/morrolinux/mpradio/issues/18#issuecomment-359730981, or mute the thread https://github.com/notifications/unsubscribe-auth/ATWqbp_c13vd9A_ZdNt2cnI1adR7VBeCks5tNaYngaJpZM4RllvK .

--

per il supporto tecnico rivolgersi a

Moreno Razzoli__ Avvertenze ai sensi del D.Lgs.196 del 30/06/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o files allegati, sono da considerarsi strettamente riservati. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nello stesso. Costituisce violazione ai principi dettati dal D.Lgs. 196/2003: trattenere il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo o utilizzarlo per finalità diverse. Qualora riceveste questo messaggio senza esserne il destinatario Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Grazie.

donagrejja commented 6 years ago

In what order should they start ? should simple-agent start first and then bt-setup ? or the other way around ?

morrolinux commented 6 years ago

They don't really depend on each other, but they mutually depend on bluetooth service. I'm not home right now, therefore I cannot test. I suggest you to try adding After=bluetooth.service in both services and see if it works

2018-01-23 10:56 GMT+01:00 Stefan Andersson notifications@github.com:

In what order should they start ? should simple-agent start first and then bt-setup ? or the other way around ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/morrolinux/mpradio/issues/18#issuecomment-359738629, or mute the thread https://github.com/notifications/unsubscribe-auth/ATWqbssaqNSxHyTfvRM2zH3m3H0UjmKZks5tNazXgaJpZM4RllvK .

--

per il supporto tecnico rivolgersi a

Moreno Razzoli__ Avvertenze ai sensi del D.Lgs.196 del 30/06/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o files allegati, sono da considerarsi strettamente riservati. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nello stesso. Costituisce violazione ai principi dettati dal D.Lgs. 196/2003: trattenere il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo o utilizzarlo per finalità diverse. Qualora riceveste questo messaggio senza esserne il destinatario Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Grazie.

donagrejja commented 6 years ago

I'm at work also =) I'll test later.

donagrejja commented 6 years ago

There is still something fishy with the service startup.

It doesn't display as the hostname anymore it displays as "BCM43438A 37.4MHz Raspbe.." Also it still doesn't want to pair. It just says unable to pair.

Bluetoothctl says "connected: yes" and then "connected: no" and the phone says unable to communicate with device/ unable to pair.

donagrejja commented 6 years ago

For debugging purposes:

Controller reports this: Name: pi-radio Alias: pi-radio Class: 0x000000 Powered: yes Discoverable: yes Pairable: yes UUID: Headset AG (00001112-0000-1000-8000-00805f9b34fb) UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb) UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb) UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb) UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb) UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb) UUID: Handsfree Audio Gateway (0000111f-0000-1000-8000-00805f9b34fb) UUID: Headset (00001108-0000-1000-8000-00805f9b34fb) Modalias: usb:v1D6Bp0246d052B Discovering: no

morrolinux commented 6 years ago

"Class: 0x000000" makes me think something something could be misplaced... I don't know what's wrong, but none of this happened on my Pi Zero W, could you try to git clone and reinstall the latest version (I updated this afternoon) and see what happens? Configuration files should come back in place as well. After that, if you still have issues you could try do download and flash the full dd image I provided on my website. that's to make sure we are running on the exact same environment

2018-01-23 17:20 GMT+01:00 Stefan Andersson notifications@github.com:

For debugging purposes:

Controller reports this: Name: pi-radio Alias: pi-radio Class: 0x000000 Powered: yes Discoverable: yes Pairable: yes UUID: Headset AG (00001112-0000-1000-8000-00805f9b34fb) UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb) UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb) UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb) UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb) UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb) UUID: Handsfree Audio Gateway (0000111f-0000-1000-8000-00805f9b34fb) UUID: Headset (00001108-0000-1000-8000-00805f9b34fb) Modalias: usb:v1D6Bp0246d052B Discovering: no

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/morrolinux/mpradio/issues/18#issuecomment-359844397, or mute the thread https://github.com/notifications/unsubscribe-auth/ATWqbjJjB6UM0120wh4HkJyWAaTqR8uTks5tNgbOgaJpZM4RllvK .

--

per il supporto tecnico rivolgersi a

Moreno Razzoli__ Avvertenze ai sensi del D.Lgs.196 del 30/06/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o files allegati, sono da considerarsi strettamente riservati. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nello stesso. Costituisce violazione ai principi dettati dal D.Lgs. 196/2003: trattenere il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo o utilizzarlo per finalità diverse. Qualora riceveste questo messaggio senza esserne il destinatario Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Grazie.

donagrejja commented 6 years ago

I actually just did a fresh install for debugging purposes. this is where i got these results.

The name displays properly when I add After: bt-setup.service to simple-agent.service.

I'll do some more tests.

donagrejja commented 6 years ago

This change seems to have made it work. will test more.

/etc/systemd/system/bt-setup.service: After=bluetooth.service simple-agent.service

/usr/lib/udev/bluetooth:

#!/bin/bash
# at each BT connection/disconnection start/stop the service mpradio
function log {
        sudo echo "[$(date)]: $*" >> /var/log/bluetooth_dev
}
BTMAC=${NAME//\"/}
if [ $ACTION = "remove" ]
then
        log "Stop Played Connection " $BTMAC
        sudo systemctl stop mpradio-bt@$BTMAC
        killall mpradio && killall sox
        sudo systemctl start mpradio
elif [ $ACTION = "add" ]
then
        log "Start Played Connection " $BTMAC
        sed -i "s/^defaults.bluealsa.device.*$/defaults.bluealsa.device \"$BTMAC\"/g" /home/pi/.asoundrc
        sudo systemctl stop mpradio
        killall mpradio && killall sox
        sudo systemctl start bt-setup
        sudo systemctl start mpradio-bt@$BTMAC
else
        log "Other action " $ACTION
fi

--

seems like the initialization done in bt-setup.sh is needed every time you start the connection. like it was before defined in player.cc and then executed every time that mpradio was started.

but I have yet to confirm that it works 100%. can pair now though.

morrolinux commented 6 years ago

Damn I forgot bt-setup brings the bluetooth interface UP so it's required to start before anything else relying on bluetooth! are you sure about bt-setup needing to be executed when a BT client connects? ATM its only functions are to: 1) bring the BT interface up and visible (which is already, if someone just connected to it) 2) force udev to detect new (BT) events and launch /usr/lib/udev/bluetooth accordingly (which already happened if this is executing)

so I see no point in that. Thanks for the advice on the bt-setup service thought, I'm updating the code right now :)