RafaPolit / moode-spotify-connect-web

moOde OS - spotify-web-connect install instructions and required files.
MIT License
15 stars 4 forks source link

Tremendous static when playing #4

Closed inezgoessens closed 7 years ago

inezgoessens commented 7 years ago

Hey there, I follow your steps to the letter, and I can connect (occasionally - it keeps disappearing?) to the moode connect point. However, when I play something from spotify, it gives tremendous static (i can faintly hear my music) and I cannot change the volume (it's really loud no matter if I change the moode volume or the spotify volume) (i also tried using your softvol conf , but to no avail)

I have an Audioquest Dragonfly DAC and a Raspi3, I requested an authorization key from Spotify but for now I am using the one you provided. I have configured both scripts as startup services, these are the settings from spotify-connect-web.service:

Description=Spotify Connect Web After=network.target avahi-spotify-connect-multiuser.service [Service] ExecStart=/home/SpotifyConnect/spotify-connect-web/spotify-connect-web --playback_device softvol --bitrate 320 --name "moOde Connect" --key /home/SpotifyConnect/spotify-connect-web/spotify_appkey.key -m Master --mixer_device_index 0 Restart=always RestartSec=10 StartLimitInterval=30 StartLimitBurst=20

[Install] WantedBy=multi-user.target

I've no idea what I did wrong?

Inez

RafaPolit commented 7 years ago

Hello Inez,

The 'disappearing' issue may suggest connectivity problems. Do you have the RPi with WiFi or with Ethernet cable? If the former, try to connect with cable and see if that fixes the disappearing connection.

I think I should rewrite the tutorial with a single approach instead of the three variants which are probably not clear.

The static issue though is another thing. Just out of curiosity, if you play from the Moode interface a normal audio file, do you hear the same static or not?

What is the result of running the command:

sudo service spotify-connect-web status

Best regards, Rafa.

RafaPolit commented 7 years ago

Also, please include the results of these other two commands:

amixer controls
aplay -L
inezgoessens commented 7 years ago

Hey , I haven't tried with ethernet cable, I'll try that today. If I play from Moode, everything works smoothly and I experience no static nor any other audio problems.

amixer controls:

numid=3,iface=MIXER,name='PCM Playback Route' numid=2,iface=MIXER,name='PCM Playback Switch' numid=1,iface=MIXER,name='PCM Playback Volume' numid=5,iface=PCM,name='IEC958 Playback Con Mask' numid=4,iface=PCM,name='IEC958 Playback Default'

aplay -l

List of PLAYBACK Hardware Devices card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA] Subdevices: 8/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: v15 [AudioQuest DragonFly Black v1.5], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0

sudo service spotify-connect-web status:

the first few times I get this(with a red dot):

● spotify-connect-web.service Loaded: loaded (/lib/systemd/system/spotify-connect-web.service; enabled) Active: activating (auto-restart) (Result: exit-code) since Tue 2017-07-04 11:27:09 CEST; 6s ago Process: 5646 ExecStart=/home/SpotifyConnect/spotify-connect-web/spotify-connect-web --playback_device softvol --bitrate 320 --name moOde Connect --key /home/SpotifyConnect/spotify-connect-web/spotify_appkey.key -m Master --mixer_device_index 0 (code=exited, status=255) Main PID: 5646 (code=exited, status=255)

Jul 04 11:27:09 moode systemd[1]: spotify-connect-web.service: main process exited, code=exited, status=255/n/a Jul 04 11:27:09 moode systemd[1]: Unit spotify-connect-web.service entered failed state.

then, once I get this (with a green dot):

● spotify-connect-web.service Loaded: loaded (/lib/systemd/system/spotify-connect-web.service; enabled) Active: active (running) since Tue 2017-07-04 11:27:08 CEST; 863ms ago Main PID: 5646 (spotify-connect) CGroup: /system.slice/spotify-connect-web.service ├─5646 /home/SpotifyConnect/spotify-connect-web/spotify-connect-web --playback_device softvol --bitrate ... └─5648 /home/SpotifyConnect/spotify-connect-web/spotify-connect-web --playback_device softvol --bitrate ...

Jul 04 11:27:08 moode systemd[1]: Starting spotify-connect-web.service... Jul 04 11:27:08 moode systemd[1]: Started spotify-connect-web.service.

after that, again a few times with the red and then once the green. ( I do enter the sudo command again and again to see whether the green one would show up again) So the way I see it, it restarts itself but doesn't stay on?

Thanks for the fast reply though I'd really love it if I can get my own music playing with moode AND spotify! That would be the best music server for me :D

LRobo commented 7 years ago

Hi,

First off BIG thanks to Rafa for his efforts, It made MoOde a wife acceptable option in a non Apple household!

Inez, I had the same problem using a Dragonfly v1.2. Lots of static and very quiet music but glad to say it's resolved and sounds great.

I'm no expert so it took some playing about, but it turned out to the be incorrect config.

Here's my startup param's

ExecStart=/spotify/spotify-connect-web/spotify-connect-web --playback_device default:DragonFly --bitrate 320 --name "moOde Connect" --key /spotify/spotify-connect-web/spotify_appkey.key -m PCM --mixer_device_index 1

The playback device to use comes from the command "aplay -L". The L must be a capital letter and you have to remove the "CARD=" part of the string. For example "default:CARD=DragonFly" becomes "default:DragonFly". Rafa tried to help saying...

Inside moOde Player libs, the same parameter passed to shairport sync -d in /var/www/inc/playerlib.php works perfectly for --playback_device!

But I'm not sure how to use it I'm afraid. Any clarification available on how to interrogate this please?

I had lots of options (just a sub set below) and using the wrong one gave me the static issues. I was trying to use "hw:DragonFly" as I thought this would be best for Bit perfect (no volume) playback but had lots of static as a result.

pi@moodePi:/etc $ aplay -L null Discard all samples (playback) or generate zero samples (capture) plugequal equal crossfeed ladspa default:CARD=DragonFly AudioQuest DragonFly, USB Audio Default Audio Device sysdefault:CARD=DragonFly AudioQuest DragonFly, USB Audio Default Audio Device front:CARD=DragonFly,DEV=0 AudioQuest DragonFly, USB Audio Front speakers surround21:CARD=DragonFly,DEV=0 AudioQuest DragonFly, USB Audio 2.1 Surround output to Front and Subwoofer speakers ... iec958:CARD=DragonFly,DEV=0 AudioQuest DragonFly, USB Audio IEC958 (S/PDIF) Digital Audio Output dmix:CARD=DragonFly,DEV=0 AudioQuest DragonFly, USB Audio Direct sample mixing device dsnoop:CARD=DragonFly,DEV=0 AudioQuest DragonFly, USB Audio Direct sample snooping device hw:CARD=DragonFly,DEV=0 AudioQuest DragonFly, USB Audio Direct hardware device without any conversions plughw:CARD=DragonFly,DEV=0 AudioQuest DragonFly, USB Audio Hardware device with all software conversions

The mixer device I use is --mixer_device_index 1

pi@moodePi:/etc $ amixer controls numid=3,iface=MIXER,name='PCM Playback Route' numid=2,iface=MIXER,name='PCM Playback Switch' numid=1,iface=MIXER,name='PCM Playback Volume' numid=5,iface=PCM,name='IEC958 Playback Con Mask' numid=4,iface=PCM,name='IEC958 Playback Default'

I might be wrong but I don't think there is a mixer setup by default (index 0) and you have to tweak some files for it to work in that way.

I'm now struggling to set up a HifiBerry Digi+ Pro card with Spotify connect on a pi - less hair every minute!

Hope this helps!

LRobo commented 7 years ago

Just an additional thought...

I didn't get a response from Spotify when I requested an app key. Not sure if/when their new API will support streaming rather than just music and playlist meta data.

Apart from the usual wireless networking issues, the disconnects might be down to a bug in MoOde which sometimes stopped WiFi working, this has been fixed by Tim so the lastest version should remove that as a possibility.

inezgoessens commented 7 years ago

Hey LRobo thanks for the tips! If I enter aplay -L, I get a bit of a longer list:

null Discard all samples (playback) or generate zero samples (capture) plugequal equal crossfeed ladspa softvol default:CARD=ALSA bcm2835 ALSA, bcm2835 ALSA Default Audio Device sysdefault:CARD=ALSA bcm2835 ALSA, bcm2835 ALSA Default Audio Device dmix:CARD=ALSA,DEV=0 bcm2835 ALSA, bcm2835 ALSA Direct sample mixing device dmix:CARD=ALSA,DEV=1 bcm2835 ALSA, bcm2835 IEC958/HDMI Direct sample mixing device dsnoop:CARD=ALSA,DEV=0 bcm2835 ALSA, bcm2835 ALSA Direct sample snooping device dsnoop:CARD=ALSA,DEV=1 bcm2835 ALSA, bcm2835 IEC958/HDMI Direct sample snooping device hw:CARD=ALSA,DEV=0 bcm2835 ALSA, bcm2835 ALSA Direct hardware device without any conversions hw:CARD=ALSA,DEV=1 bcm2835 ALSA, bcm2835 IEC958/HDMI Direct hardware device without any conversions plughw:CARD=ALSA,DEV=0 bcm2835 ALSA, bcm2835 ALSA Hardware device with all software conversions plughw:CARD=ALSA,DEV=1 bcm2835 ALSA, bcm2835 IEC958/HDMI Hardware device with all software conversions default:CARD=v15 AudioQuest DragonFly Black v1.5, USB Audio Default Audio Device sysdefault:CARD=v15 AudioQuest DragonFly Black v1.5, USB Audio Default Audio Device front:CARD=v15,DEV=0 AudioQuest DragonFly Black v1.5, USB Audio Front speakers surround21:CARD=v15,DEV=0 AudioQuest DragonFly Black v1.5, USB Audio 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=v15,DEV=0 AudioQuest DragonFly Black v1.5, USB Audio 4.0 Surround output to Front and Rear speakers surround41:CARD=v15,DEV=0 AudioQuest DragonFly Black v1.5, USB Audio 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=v15,DEV=0 AudioQuest DragonFly Black v1.5, USB Audio 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=v15,DEV=0 AudioQuest DragonFly Black v1.5, USB Audio 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=v15,DEV=0 AudioQuest DragonFly Black v1.5, USB Audio 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers iec958:CARD=v15,DEV=0 AudioQuest DragonFly Black v1.5, USB Audio IEC958 (S/PDIF) Digital Audio Output dmix:CARD=v15,DEV=0 AudioQuest DragonFly Black v1.5, USB Audio Direct sample mixing device dsnoop:CARD=v15,DEV=0 AudioQuest DragonFly Black v1.5, USB Audio Direct sample snooping device hw:CARD=v15,DEV=0 AudioQuest DragonFly Black v1.5, USB Audio Direct hardware device without any conversions plughw:CARD=v15,DEV=0 AudioQuest DragonFly Black v1.5, USB Audio Hardware device with all software conversions

am I correct in thinking I should use the bold entry, default:CARD=v15? So, default:v15?

inezgoessens commented 7 years ago

I used default:CARD=v15, put in the ethernet cable and it works!!

Something worth mentioning, the spotify connect point didnt appear in Spotify (for windows) until I started it in Administrator mode!! hadn't thought that would be an issue!!

Many thanks to you Rafa, this is amazing!! thanks to LRobo for the tip to find the correct parameters, and ofcourse thanks to Tim for Moode!! Amazing 💃

RafaPolit commented 7 years ago

Great to see this resolved! Thanks LRobo for helping out. That is the great thing about the open source community.

Maybe we can make a list of 'known to have worked' configurations with each DAC? That could solve some headaches and frustrations in the future!

Thanks both for taking the time to comment and document your findings.

Best regards, Rafa.