balena-io-experimental / balena-sound

Build a single or multi-room streamer for an existing audio device using a Raspberry Pi! Supports Bluetooth, Airplay and Spotify Connect
https://balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/
MIT License
2.44k stars 431 forks source link

UPnP music control is unstoppable #342

Open GuillaumeDen opened 4 years ago

GuillaumeDen commented 4 years ago

Desciption I succesfully installed balenaSound pretty quickly. The bluetooth connection and playing is functional (even if there is a big delay). Airplay is doing a great job and works like a charm.

But I am experiencing a very painful problem using UPnP : the music doesn't stop.

On my android phone (using BubbleUpnp or XCast produces the same problem) I start playing a music, and if I stop it or disconnect, the music restart and nothing is connected to my raspberry, so I can't even pause it. The only solution is to reboot/restart the device (or lower his volume but it's secretly playing 😅)

Do I have something special to do to correct this ?

Device information

Additional infos image The first line appeared once I clicked play, the second once I disconnected or clicked on stop.

JodyGoldberg commented 3 years ago

I've had a significant improvement in upnp stability by updating gmediarender from the original 0.0.7 in buster to https://github.com/hzeller/gmrender-resurrect which is packaged in ubuntu focal. It also appears to break spotify so I won't send a patch until that's resolved.

ytzeng1 commented 3 years ago

I've had a significant improvement in upnp stability by updating gmediarender from the original 0.0.7 in buster to https://github.com/hzeller/gmrender-resurrect which is packaged in ubuntu focal. It also appears to break spotify so I won't send a patch until that's resolved.

Any idea how to patch this on our own? I am not using spotify plugin anyway, thanks!

drew1kun commented 3 years ago

@JodyGoldberg, So I just changed the Dockerfile.template in accordance with the commit you linked above as follows:

...
FROM balenalib/%%BALENA_MACHINE_NAME%%-ubuntu:focal
...

But when doing balena push receiving this:

[Info]     Dashboard link: https://dashboard.balena-cloud.com/apps/1811465/devices
[Info]     Building on arm05
[Info]     Pulling previous images for caching purposes...
[Success]  Successfully pulled cache images
[main]     Step 1/6 : FROM balenalib/raspberry-pi-ubuntu:focal
[main]     pull access denied for balenalib/raspberry-pi-ubuntu, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
[Error]    Some services failed to build:
[Error]      Service: main
[Error]        Error: pull access denied for balenalib/raspberry-pi-ubuntu, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
[Info]     Built on arm05
[Error]    Not deploying release.
Remote build failed

Isn't it a publicly accessible docker image?

PS: I am on raspberry pi zero

EDIT Sorry, I checked the related issue and it says that there is no ubuntu-focal docker image for pi-zero... Trying the debian-bullseye instead, which has v0.0.9 of gmediarender (not sure though if it's a resurrect or not)... Will post here the results of testing... I really want this to work properly (as I cannot use Airplay or Spotify and bluetooth works really bad, audio stops, breaks, has lags etc... )

drew1kun commented 3 years ago

Ok, so using the gmrender 0.0.9 from debian-bullseye helps - the tracks become stoppable so it is cool, but the packets are still being lost from time to time.. I thought that maybe it is because my android device is on different VLAN, but I switched to the same vlan where my balena-sound is and it kinda helped, but just a little, so the sound played over upnp still sticks sometime. I hope this could be fixed in the future, maybe when the project officially switches to gmrender-resurrect hopefully...