No kodi sound output if spotify-connect-web server is active

I installed the spotify-connect-web server using this tutorial:

I got sound over hdmi but if my spotify service is running I can’t get sound via kodi.
Now I found this in a forum:

the python fix worked like a charm for the DIGI as well. However since I started spotify my kodi does not have sound anymore via SPDIF.

My guess is that python is hogging the device. At least shutting down pythin and spotify frees up the device. Maybe I need a second pi then :slight_smile:

Later the solution:

Btw. the idea I got to solve my problem was to install and setup dmix in asound.conf. Dmix is usually setup correctly on analog devices (duh), but specifically not on digital devices (such as the DIGI/DIGI+). I gleaned the config from a German ubuntu support page at .asoundrc › Wiki › ubuntuusers.de.

This will mix the multiple inputs together.

Now I don’t know if creating this .asoundrc file and setting this dmixer plugin up would solve it for me.
I don’t want to mess up anything.
So first I want to ask: How is sound mixed on the vero2? Or is it solely handeled “inside”/via kodi?
Maybe someone could tell me this.
Also if my suggested solution would work or if anyone knows a better/easier way to archieve sound output in kodi while this spotify-connect-web server is running.

We use ALSA for sound on the Vero 2. You probably need to stop the Spotify service before playing back content in Kodi

Ok. Yes, that’s the whole point…I don’t want to stop and start the service everytime I stream music via spotify.
And isn’t there any implementation mixing the audio signals?
I’m wondering if alsa could even manage that since it’s the same hdmi device…

Could I somehow tell the spotify-connect-web server to “set the device free” if no music is being streamed?
Or tell kodi to somehow “overrule” the spotify service and put audio out?

Now I’m curious if folowing works: Set kodi to put audio out via audio jack, playback a video and get audio during spotify server is active and puting out audio via hdmi.

The developer shouldn’t lock the device for longer than is necessary.

Depending on how the plugin is developed and intended to work – it’s a server; there may not be an easy way for this to work.

dmix would theoretically work but then I think you would be limited to 2.0 PCM.

We have very similar issues currently on all devices with BTPlayer (the new Bluetooth streaming), which is one of the reasons why it isn’t considered near ready for a stable release yet.

Yeah…in the beginning it worked sometime it suddenly didn’t work anymore. Now I’m curious, I’ll try dis- and enabling the service again, then not connect smartphone or tablet via spotify app and just start a video.
Maybe I get sound, this way I would know that the disconnection thing with the app isn’t really working…Maybe I always have to kill the spotify app after streaming to vero =D…Spotify android app seems to stay active after just closing it.

I assume you’ll inform us in a future update if the btplayer feature is avaiable. If you guys get this to work, the spotify server is obsolete for me…how will the sound quality be? How many channels and what bitrate is planned?

I believe A2DP is limited to stereo (2 channels). Bitrate can vary per application. The maximum limit for stereo is 512Kbps.

When BTPlayer is available, you will hear :slight_smile:

Sam

About audio output from spotify-connect-web server, some people write that it can’t find the spdif on digi+, how about the spdif on Vero 2?

Thx,
Marcus

I recommend just trying it :slight_smile:

Sam

I would if I had one ;D Want to know as much as possible about the 2 (rpi3+digi+/vero 2) so I can decide which one to get…

I didn’t hear back from this user, but I’m happy to try the steps and check that they work on the Vero 2. If they don’t, I can look at fixing it.

I’ll try this tomorrow and report back.

Hello

Sorry about the late reply. I just tested this on my Vero 2. I had to use @trohn_javolta’s suggestion to hardcode the mixer volume.

I now see:

./spotify-connect-web.sh 
SpInit: 0
playback_volume: 1
public key: jAqi7NGkvTIO7ne6WoFS1QtKJ+Z8Sgwuw02Lr/TfuYycrGDxrZRvfm+ev4kNmLF744NReJaMIIGWmMCuBLTJUCyQZkvGym3K47rdJE+64vpesvuabQRbPSxGNQvz6WnK
device id: 688f1eb7-acc5-4b02-9cda-fcd9535ec4dd
remote name: TestConnect
account req: PREMIUM
device type: AUDIODONGLE

However I do not see the device on my iPhone, using the Spotify app. This is all I have:

Is there anything else I need to do?

Because the Vero 2 has two audio sinks (SPDIF and Analogue), it’s possible to leverage this to get two different streams at once:

**** List of PLAYBACK Hardware Devices ****
card 0: AMLM8AUDIO [AML-M8AUDIO], device 0: AML PCM dummy_codec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLM8AUDIO [AML-M8AUDIO], device 1: SPDIF PCM dit-hifi-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
  • Set up Kodi as SPDIF so you can keep passthrough. This should be the default anyway.
  • Get Spotify to use the dummy sink as follows:

./spotify-connect-web.sh --device "plughw:CARD=AMLM8AUDIO,DEV=0"

It should work. Let me know.

Sam

I don’t know why you can’t see a device in the spotify app either.
But overall I’m a bit confused. Looking into kodi audio settings, audio device is set to AML-M8AUDIO / Analogue by default. I don’t remember changing that.
What does this mean anyway? Are SPDIF and Analogue signals both comming out of the jack connector?
Also why is there no audio device that says hdmi in the first place?
Maybe you can explain in short.
What you explain also does not solve the issue I have described in my initial post or does it?
Since I have an AV Receiver I’m now thinking of connecting jack connector on vero2 with spdif connector on avr and playback spotify this way. I would always have to switch to right output on avr but if there’s no other way that would be ok.

There are two jacks, one is for analogue (3.5mm) and one is for passthrough. But the SoC has a dual-audio mechanism, so if you select one as SPDIF in Kodi, and one as Analog for Spotify, it will be fine.

I wasn’t able to test Spotify myself, but what it should let you do is use Kodi and Spotify without losing sound.

Sam

I could solve the problem on my raspberry pi 2 running kodi 17 with an usb dac. If you install spotify connect via the pre-built chroot then you get an old version of it. So I copied console_callback.py from GitHub - Fornoth/spotify-connect-web to /home/osmc/spotify-connect-web-chroot/usr/src/app/.

Now it works. I hope this will help you. On Vero it might be the same issue.

Yes, thats nice and easy. Thx a lot now spotify web server starts at boot and I don’t have to en and disable it all the time :+1:

Thanks for testing.

Now @olorin_75 has his answer too :wink:

Sam

I just did a complete reinstall of osmc on my vero2 and now I set up spotify connect server and I have the same issue =(
I guess you didn’t pursue this further and have an answer by any chance?

It’s a bug in the latest Spotify connect server I believe. An older version seems fine, and I have it working now. I didn’t look in to it beyond that.

I can also confirm that with the suggestions above, I’m able to stream music and use Kodi without having to reboot or restart any services.

Sam

Ok, and how did you get an older version?

Manually installed from here: GitHub - Fornoth/spotify-connect-web. There is a Docker file as well, which should work on the Vero 2.

I suspect the issue will be fixed upstream soon enough though.