Thank you for your donation!


Problem: Spotify Connect does not play audio on Moode 6.5.2
#1
Hi all

I had an issue on 6.5.2 and I am not sure if I am the only one seeing it... But for me it's identical on 2 separate RPI boxes. Spotify fails to play properly when I switch on it from my mobile Spotify app.
Activating debug for librespot, I have this:


Code:
[...]
[2020-06-04T15:30:45Z INFO  librespot_playback::player] <Into The Night> loaded
[2020-06-04T15:30:45Z INFO  librespot::player_event_handler] Running ["/var/local/www/commandw/spotevent.sh"] with environment variables {"TRACK_ID": "0rhyBUAgNXwdyvGVXSrLzc", "PLAYER_EVENT": "start"}
[2020-06-04T15:30:45Z DEBUG librespot_playback::player] command=Stop
[2020-06-04T15:30:45Z INFO  librespot::player_event_handler] Running ["/var/local/www/commandw/spotevent.sh"] with environment variables {"TRACK_ID": "0rhyBUAgNXwdyvGVXSrLzc", "PLAYER_EVENT": "stop"}
[...]

(Note the "Stop" command coming in right when the file should in fact start playing).

So immediately after the play event there's a Stop event. This happens every time I try to swtich, again on 2 boxes. No music is heard and the mobile device (Android in my case) sometimes continues showing that the file is playing, sometimes it just stops (time counter not incrementing) but in any case, after this the phone becomes desyncrhonized with the Moode box and even if I try again I end up in the same situation.

Clearing the Spotify credentials (from the UI) sometimes helps but just for a short while, this soon happens again.

What I did was to try and manually run the librespot command with all sorts of parameters and combinations, and my latest finding is that if I remove this parameter, everything runs perfectly:


Code:
--cache /var/local/www/spotify_cache


I have also modified the /var/www/inc/playerlib.php and removed this from the command line of librespot and all seems ok now across multiple restarts, no issues. However I don't know if removing this flag is problematic or not but it's a good enough workaround for me right now though so wanted to share it with others who may have this issue.

later edit: after a reboot also clear the Spotify credentials from the Audio Settings (that's an alias for "rm /var/local/www/spotify_cache/credentials.json"). This will not be created anymore once we remove the "--cache" parameter and it seems to me it causes the issue I have.

Hope that helps
adixor


Logs for one of my RPIs:


Code:
pi@moode-attic:~ $ sudo /var/www/command/sysinfo.sh

S Y S T E M   P A R A M E T E R S

moOde release           = 6.5.2 2020-05-03</li>
Raspbian OS             = 10.3
Linux kernel            = 4.19.115-v7l+ #1305
Platform                = Pi-4B 4GB v1.1
Architecture            = armv7l (32-bit)
System uptime           = up 4 minutes
Timezone                = Europe/Amsterdam
Current time            = 2020-06-04 17:40:01

Host name               = moode-attic
Ethernet address        = 192.168.1.41
Ethernet MAC            = dc:a6:32:62:fe:62
WLAN address            = unassigned
WLAN MAC                = no adapter
WLAN country            = NL

SoC identifier          = bcm2711
Core count              = 4
Kernel timer freq       = 100 Hz
SDCard freq             = 50 MHz
USB boot                = not available
Warranty                = OK

Root size               = 7.1G
Root used               = 39%
Root available          = 4.2G
Root expand             = expanded
Memory free             = 3262 MB
Memory used             = 273 MB
SoC temperature         = 61.3°C

CPU governor            = ondemand
Onboard WiFi            = Off
Onboard BT              = Off
HDMI output             = On
LED state               = 1,1
Eth addr wait           = On
Max USB current         = Off
USB (UAC2) fix          = Off
Pi-3B+ eth fix          = Off
SSH term server         = Off

PHP-FPM version         = 7.3.11
NGINX version           = 1.14.2
SQLite3 version         = 3.27.2
Hostapd version         = 2.8-devel
WiringPi version        = 2.50
RPi.GPIO version        = 0.7.0

A U D I O   P A R A M E T E R S

Audio device            = USB audio device
Interface               = USB
Mixer name              = Speaker
Hardware volume         = Controller detected
Max ALSA volume         = 70
Max MPD volume          = 100
Volume step limit       = 10
Audio source            = Local
Output device           = Local
Resume MPD              = No
Volume knob             = 0
Volume mute             = Unmuted
Saved MPD vol           = 0
Preamp volume           = 0
ALSA version            = 1.1.8-1+rpt1
SoX version             = 0.1.2-3

Bluetooth controller    = Off
Pairing agent           = Off
Airplay receiver        = Off
Spotify receiver        = On
Squeezelite             = Off
UPnP client             = Off
DLNA server             = Off
GPIO button handler     = Off
UPnP browser            = Off

Auto-shuffle            = Off
Autoplay                = Off
Rotary encoder          = Off
Encoder params          = 100 2 3 23 24
USB volume knob         = Off
Polarity inversion      = Off
Crossfeed               = Off
Crossfade               = Off
Parametric EQ           = Off
Graphic EQ              = Off
MPD httpd               = Off

A P P E A R A N C E   S E T T I N G S

Themes and backgrounds
----------------------
Theme                   = Lilium
Accent color            = Emerald
Alpha blend             = 1.0
Adaptive background     = No
Background image        = No
Cover backdrop          = No
Cover blur              = 20px
Cover scale             = 1.25

Library options
----------------------
Instant play action     = Clear/Play
Show tagview genres     = No
Show tagview covers     = Yes
Ellipsis limited text   = No
Albumview sort order    = by Artist
Tagview sort order      = by Artist
Compilation identifier  = Various Artists
Recently added          = 1 Month
Ignore articles         = a,an,the
UTF8 character filter   = No
Hi-res thumbs           = Auto
Cover search pri        = Embedded cover
Pixel ratio             = 1.5

Coverview screen saver
----------------------
CoverView auto-display  = Never
CoverView style         = Gradient (Radial)

Other options
----------------------
Font size               = Larger
Auto-shuffle filter     = None
Extra metadata          = track,disc,date,composer,encoded
Playback history        = Yes

M P D   S E T T I N G S

Version                 = 0.21.22
Volume control          = software
ALSA device             = hw:1
SoX resampling          = disabled
SoX quality             = very high
SoX multithreading      = off
DSD over PCM (DoP)      = no
Replaygain              = off
Replaygain preamp       = 0
Volume normalization    = No
Audio buffer            = 4096 (kb)
Output buffer size      = 131072 (kb)

B L U E T O O T H   S E T T I N G S

Bluetooth ver           = 5.50
Bluealsa ver            = 2.0.0
Speaker sharing         = No
Resume MPD              = No
PCM buffer time         = 500000 (μs)

A I R P L A Y   S E T T I N G S

Version                 = 3.3.6
Friendly name           = Moode Airplay
ALSA device             = hw:1
Interpolation           = soxr
Output bit depth        = S16
Output sample rate      = 44100
Session interruption    = no
Session timeout         = 120 (ms)
Latency offset          = 0.0 (secs)
Audio buffer            = 0.2 (secs)
Resume MPD              = No

S P O T I F Y   S E T T I N G S

Friendly name           = Attic
ALSA device             = plughw:1
Bit rate                = 320
Initial volume          = 100
Volume curve            = Logarithmic
Volume normalization    = No
Normalization pregain   = 0
Autoplay                = No
Resume MPD              = No

S Q U E E Z E L I T E   S E T T I N G S

Version                 = 1.8.7-1052 "DSD/SRC enabled"
Friendly name           = Moode
ALSA device             = hw:0
ALSA params             = 80:4::1
Output buffers          = 40000:100000
Task priority           = 45
Codec list              = flac,pcm,mp3,ogg,aac,alac,dsd
Other options           = -W -D 500 -R E -S /var/local
Resume MPD              = No

L O C A L   D I S P L A Y   S E T T I N G S

Local UI display        = On
Mouse cursor            = Off
Screen blank            = off Secs
Wake display on play    = Off
Brightness              = 255
Pixel aspect ratio      = Default
Rotate screen           = 0 Deg

M O O D E   S T A R T U P   L O G

20200604 173516 worker: -- Start
20200604 173516 worker: Successfully daemonized
20200604 173516 worker: Integrity check (warning: playerlib.php)
20200604 173516 worker: Integrity check (passed with warnings)
20200604 173516 worker: Session loaded
20200604 173516 worker: Debug logging (on)
20200604 173516 worker: Device raw: (0:ALSA|1:Device|i2s:none)
20200604 173516 worker: Device cfg: (USB audio device|1|1|Speaker|0)
20200604 173517 worker: ALSA volume set to (0%)
20200604 173517 worker: -- System
20200604 173518 worker: Host     (moode-attic)
20200604 173518 worker: moOde    (6.5.2 2020-05-03)
20200604 173518 worker: Raspbian (10.3)
20200604 173518 worker: Kernel   (4.19.115-v7l+ #1305)
20200604 173518 worker: Platform (Pi-4B 4GB v1.1)
20200604 173518 worker: ARM arch (armv7l, 32-bit kernel)
20200604 173518 worker: MPD ver  (0.21.22)
20200604 173518 worker: CPU gov  (ondemand)
20200604 173518 worker: USB boot not available
20200604 173518 worker: File system expanded
20200604 173518 worker: HDMI port on
20200604 173518 worker: File check (OK)
20200604 173518 worker: -- Network
20200604 173519 worker: eth0 exists
20200604 173519 worker: IP addr (192.168.1.41)
20200604 173519 worker: Netmask (255.255.255.0)
20200604 173519 worker: Gateway (192.168.1.1)
20200604 173519 worker: Pri DNS (192.168.1.2)
20200604 173519 worker: Domain  (None)
20200604 173519 worker: wlan0 does not exist
20200604 173519 worker: -- Audio
20200604 173519 worker: ALSA outputs unmuted
20200604 173519 worker: ALSA card number (1)
20200604 173519 worker: Audio output (USB audio device)
20200604 173519 worker: Audio formats (S16_LE)
20200604 173519 worker: ALSA mixer name (Speaker)
20200604 173519 worker: MPD volume control (software)
20200604 173519 worker: Hdwr volume controller exists
20200604 173519 worker: Max ALSA volume (70%)
20200604 173519 worker: Reset renderer active flags
20200604 173519 worker: -- MPD
20200604 173520 worker: MPD conf updated
20200604 173520 worker: MPD started
20200604 173520 openMpdSocket(): connection failed (1)
20200604 173520 openMpdSocket(): errorno: 111, Connection refused
20200604 173520 worker: MPD accepting connections
20200604 173520 worker: Configure MPD outputs
20200604 173520 worker: MPD output 1 ALSA default (on)
20200604 173520 worker: MPD output 2 ALSA crossfeed (off)
20200604 173520 worker: MPD output 3 ALSA parametric eq (off)
20200604 173520 worker: MPD output 4 ALSA graphic eq (off)
20200604 173520 worker: MPD output 5 ALSA polarity inversion (off)
20200604 173520 worker: MPD output 6 ALSA bluetooth (off)
20200604 173520 worker: MPD output 7 HTTP stream (off)
20200604 173520 worker: MPD crossfade (off)
20200604 173520 worker: -- Feature availability
20200604 173520 worker: Source select (available)
20200604 173520 worker: Source select (source: MPD)
20200604 173520 worker: Source select (output: USB audio device)
20200604 173521 worker: Bluetooth (available)
20200604 173521 worker: Airplay renderer (available)
20200604 173521 worker: Spotify renderer (available)
20200604 173521 worker: (librespot --name "Attic" --bitrate 320 --initial-volume 100 --disable-audio-cache --backend alsa --device "plughw:1" --onevent /var/local/www/commandw/spotevent.sh -v > /home/pi/librespot.txt 2>&1 &)
20200604 173521 worker: Spotify renderer (started)
20200604 173521 worker: Squeezelite renderer (available)
20200604 173521 worker: UPnP renderer (available)
20200604 173521 worker: DLNA server (available)
20200604 173521 worker: UPnP browser (available)
20200604 173521 worker: Audio scrobbler (available)
20200604 173521 worker: GPIO button handler (available)
20200604 173521 worker: -- Music sources
20200604 173521 worker: USB sources (none attached)
20200604 173521 sourceMount(): result=()
20200604 173521 worker: NAS and UPnP sources (mountall initiated)
20200604 173521 worker: -- Miscellaneous
20200604 173521 worker: USB volume knob (Off)
20200604 173521 worker: USB auto-mounter (udisks-glue)
20200604 173521 worker: LED0 (On)
20200604 173521 worker: LED1 (On)
20200604 173522 worker: Saved MPD vol level (0)
20200604 173522 worker: Preamp volume level (0)
20200604 173522 worker: MPD volume level (0) restored
20200604 173522 worker: ALSA volume level (70%)
20200604 173522 worker: Auto-play (Off)
20200604 173522 worker: LocalUI started
20200604 173522 worker: Maintenance interval (3 hrs)
20200604 173522 worker: Screen saver activation (Never)
20200604 173522 worker: Session permissions (OK)
20200604 173522 worker: Watchdog started
20200604 173522 worker: Ready
20200604 173530 loadLibrary(): Cache data returned to client, length (6496767)
20200604 173531 enhanceMetadata(): coverurl: (/coverart.php/NAS%2FMusic%2F%3Dcompilatii%2FDeep%20%26%20Chilled%20Euphoria%20disc%202%2F09%20-%20Humate%20-%20Love%20Stimulation%20%28Michael%20Woods%20Mix%29.mp3)
20200604 173531 enhanceMetadata(): Song file
20200604 173531 engine-mpd: Metadata returned to client: Size=(31)
Reply
#2
I've been sitting here alternating between the Spotify app on my iPad and the one on my Pixel3a phone, in both cases directing the stream to a stock moOde 6.5.2 player with the Spotify bitrate option set to 320kbps just as the setting you have.

Everything is working the way I expect it to.

Offhand our sysinfo.sh outputs are similar. Some differences: you're testing on an RPi4B, I'm on an Rpi3B+; you're using an Ethernet connection, I'm using WiFi; your audio device is USB but you have somewhat different parameters:

You

Code:
Audio device            = USB audio device
Interface               = USB
Mixer name              = Speaker
Hardware volume         = Controller detected


Me


Code:
Audio device        = USB audio device
Interface        = USB
Mixer name        = PCM
Hardware volume        = None


Candidly, I don't know if this difference is important to the Spotify renderer. What I do know is I couldn't repro your issue.

Regards,
Kent
Reply
#3
Thanks a lot Kent for trying! I have no idea if it's a librespot bug, or Spotify issue, or my mobile (Samsung Galaxy S9) Smile But I am happy with my workaround and it works. (I tested other bitrates as well, it's not that). Just for completeness, here's the other box I have, an RPI3 with an I2C board, also using Wired ethernet.

I do understand there is nothing you can do if you cannot replicate, and if there are no others impacted then the problem must be me Smile but at least if anybody else has this, they can try my fix.

Thanks everybody there for Moode and all your efforts!

adixor


Code:
S Y S T E M   P A R A M E T E R S

moOde release = 6.5.2 2020-05-03
Raspbian OS = 10.3
Linux kernel = 4.19.115-v7+ #1305
Platform = Pi-3B 1GB v1.2
Architecture = armv7l (32-bit)
System uptime = up 1 day, 3 hours, 4 minutes
Timezone = Europe/Amsterdam
Current time = 2020-06-05 20:43:23

Host name = moode-living
Ethernet address = 192.168.1.40
Ethernet MAC = b8:27:eb:3d:d3:5b
WLAN address = unassigned
WLAN MAC = no adapter
WLAN country = US

SoC identifier = bcm2837
Core count = 4
Kernel timer freq = 100 Hz
SDCard freq = 50 MHz
USB boot = not enabled
Warranty = OK

Root size = 7.1G
Root used = 39%
Root available = 4.2G
Root expand = expanded
Memory free = 296 MB
Memory used = 223 MB
SoC temperature = 48.9°C

CPU governor = ondemand
Onboard WiFi = Off
Onboard BT = Off
HDMI output = On
LED state = 1,1
Eth addr wait = On
Max USB current = Off
USB (UAC2) fix = Off
Pi-3B+ eth fix = Off
SSH term server = Off

PHP-FPM version = 7.3.11
NGINX version = 1.14.2
SQLite3 version = 3.27.2
Hostapd version = 2.8-devel
WiringPi version = 2.50
RPi.GPIO version = 0.7.0

A U D I O   P A R A M E T E R S

Audio device = HiFiBerry Digi(Digi+)
Interface = I2S
Mixer name = Digital
Hardware volume = None
Max ALSA volume = 100
Max MPD volume = 100
Volume step limit = 10
Audio source = Local
Output device = Local
Resume MPD = No
Volume knob = 0
Volume mute = Unmuted
Saved MPD vol = 0
Preamp volume = 0
ALSA version = 1.1.8-1+rpt1
SoX version = 0.1.2-3

Bluetooth controller = Off
Pairing agent = Off
Airplay receiver = Off
Spotify receiver = On
Squeezelite = Off
UPnP client = Off
DLNA server = Off
GPIO button handler = Off
UPnP browser = Off

Auto-shuffle = Off
Autoplay = Off
Rotary encoder = Off
Encoder params = 100 2 3 23 24
USB volume knob = Off
Polarity inversion = Off
Crossfeed = Off
Crossfade = Off
Parametric EQ = Off
Graphic EQ = Off
MPD httpd = Off

A P P E A R A N C E   S E T T I N G S

Themes and backgrounds
----------------------
Theme = Pure Black
Accent color = Grass
Alpha blend = 1.0
Adaptive background = No
Background image = No
Cover backdrop = No
Cover blur = 20px
Cover scale = 1.25

Library options
----------------------
Instant play action = Clear/Play
Show tagview genres = No
Show tagview covers = No
Ellipsis limited text = No
Albumview sort order = by Artist
Tagview sort order = by Artist
Compilation identifier = Various Artists
Recently added = 1 Month
Ignore articles = a,an,the
UTF8 character filter = No
Hi-res thumbs = Auto
Cover search pri = Embedded cover
Pixel ratio = 1.5

Coverview screen saver
----------------------
CoverView auto-display = Never
CoverView style = Gradient (Linear)

Other options
----------------------
Font size = Larger
Auto-shuffle filter = None
Extra metadata = track,disc,date,composer,encoded
Playback history = No

M P D   S E T T I N G S

Version = 0.21.22
Volume control = disabled
ALSA device = hw:0
SoX resampling = disabled
SoX quality = very high
SoX multithreading = off
DSD over PCM (DoP) = no
Replaygain = off
Replaygain preamp = 0
Volume normalization = No
Audio buffer = 4096 (kb)
Output buffer size = 131072 (kb)

B L U E T O O T H   S E T T I N G S

Bluetooth ver = 5.50
Bluealsa ver = 2.0.0
Speaker sharing = No
Resume MPD = No
PCM buffer time = 500000 (µs)

A I R P L A Y   S E T T I N G S

Version = 3.3.6
Friendly name = Moode Airplay
ALSA device = hw:0
Interpolation = soxr
Output bit depth = S16
Output sample rate = 44100
Session interruption = no
Session timeout = 120 (ms)
Latency offset = 0.0 (secs)
Audio buffer = 0.2 (secs)
Resume MPD = No

S P O T I F Y   S E T T I N G S

Friendly name = Living
ALSA device = plughw:0
Bit rate = 320
Initial volume = 80
Volume curve = Logarithmic
Volume normalization = No
Normalization pregain = 0
Autoplay = No
Resume MPD = No

S Q U E E Z E L I T E   S E T T I N G S

Version = 1.8.7-1052 "DSD/SRC enabled"
Friendly name = Moode
ALSA device = hw:0
ALSA params = 80:4::1
Output buffers = 40000:100000
Task priority = 45
Codec list = flac,pcm,mp3,ogg,aac,alac,dsd
Other options = -W -D 500 -R E -S /var/local
Resume MPD = No

L O C A L   D I S P L A Y   S E T T I N G S

Local UI display = On
Mouse cursor = On
Screen blank = 3600 Secs
Wake display on play = Off
Brightness = 255
Pixel aspect ratio = Default
Rotate screen = 0 Deg

M O O D E   S T A R T U P   L O G

20200604 173836 worker: -- Start
20200604 173837 worker: Successfully daemonized
20200604 173838 worker: Integrity check (warning: playerlib.php)
20200604 173838 worker: Integrity check (passed with warnings)
20200604 173838 worker: Session loaded
20200604 173838 worker: Debug logging (off)
20200604 173838 worker: Device raw: (0:sndrpihifiberry|1:empty|i2s:HiFiBerry Digi(Digi+))
20200604 173838 worker: Device cfg: (HiFiBerry Digi(Digi+)|0|0|Digital|none)
20200604 173838 worker: ALSA volume (None)
20200604 173838 worker: -- System
20200604 173841 moode.php: MPD connect failed: cmd=(playlist)
20200604 173843 worker: Host     (moode-living)
20200604 173843 worker: moOde    (6.5.2 2020-05-03)
20200604 173843 worker: Raspbian (10.3)
20200604 173843 worker: Kernel   (4.19.115-v7+ #1305)
20200604 173843 worker: Platform (Pi-3B 1GB v1.2)
20200604 173843 worker: ARM arch (armv7l, 32-bit kernel)
20200604 173843 worker: MPD ver  (0.21.22)
20200604 173843 worker: CPU gov  (ondemand)
20200604 173843 worker: USB boot not enabled yet
20200604 173843 worker: File system expanded
20200604 173844 worker: HDMI port on
20200604 173844 worker: File check (OK)
20200604 173844 worker: -- Network
20200604 173844 worker: eth0 exists
20200604 173845 worker: IP addr (192.168.1.40)
20200604 173845 worker: Netmask (255.255.255.0)
20200604 173845 worker: Gateway (192.168.1.1)
20200604 173845 worker: Pri DNS (192.168.1.1)
20200604 173845 worker: Domain  (192.168.1.2)
20200604 173845 worker: wlan0 does not exist
20200604 173845 worker: -- Audio
20200604 173845 worker: ALSA outputs unmuted
20200604 173845 worker: ALSA card number (0)
20200604 173845 worker: Audio output (I2S audio device)
20200604 173845 worker: Audio device (HiFiBerry Digi(Digi+))
20200604 173845 worker: Audio formats (S16_LE, S24_LE)
20200604 173846 worker: ALSA mixer name (Digital)
20200604 173846 worker: MPD volume control (disabled)
20200604 173846 worker: Hdwr volume controller not detected
20200604 173846 worker: Reset renderer active flags
20200604 173847 worker: -- MPD
20200604 173849 worker: MPD conf updated
20200604 173849 worker: MPD started
20200604 173850 worker: MPD accepting connections
20200604 173850 worker: Configure MPD outputs
20200604 173850 worker: MPD output 1 ALSA default (on)
20200604 173850 worker: MPD output 2 ALSA crossfeed (off)
20200604 173850 worker: MPD output 3 ALSA parametric eq (off)
20200604 173850 worker: MPD output 4 ALSA graphic eq (off)
20200604 173850 worker: MPD output 5 ALSA polarity inversion (off)
20200604 173850 worker: MPD output 6 ALSA bluetooth (off)
20200604 173850 worker: MPD output 7 HTTP stream (off)
20200604 173850 worker: MPD crossfade (off)
20200604 173850 worker: -- Feature availability
20200604 173850 worker: Source select (available)
20200604 173850 worker: Source select (source: MPD)
20200604 173850 worker: Source select (output: I2S audio device)
20200604 173850 worker: Bluetooth (available)
20200604 173850 worker: Airplay renderer (available)
20200604 173850 worker: Spotify renderer (available)
20200604 173850 worker: Spotify renderer (started)
20200604 173850 worker: Squeezelite renderer (available)
20200604 173850 worker: UPnP renderer (available)
20200604 173850 worker: DLNA server (available)
20200604 173850 worker: UPnP browser (available)
20200604 173850 worker: Audio scrobbler (available)
20200604 173850 worker: GPIO button handler (available)
20200604 173850 worker: -- Music sources
20200604 173911 worker: USB sources (none attached)
20200604 173912 worker: NAS and UPnP sources (mountall initiated)
20200604 173912 worker: -- Miscellaneous
20200604 173912 worker: USB volume knob (Off)
20200604 173912 worker: USB auto-mounter (udisks-glue)
20200604 173912 worker: LED0 (On)
20200604 173912 worker: LED1 (On)
20200604 173912 worker: Saved MPD vol level (0)
20200604 173912 worker: Preamp volume level (0)
20200604 173913 worker: MPD volume level (0) restored
20200604 173913 worker: ALSA volume level (None)
20200604 173913 worker: Auto-play (Off)
20200604 173913 worker: LocalUI started
20200604 173913 worker: Maintenance interval (3 hrs)
20200604 173913 worker: Screen saver activation (Never)
20200604 173913 worker: Session permissions (OK)
20200604 173913 worker: Watchdog started
20200604 173913 worker: Ready
20200605 204259 worker: Job spotify_clear_credentials
Reply
#4
Since you're not adverse to poking playerlib.php in the eye with a sharp stick, how about first being a little more subtle ( Tongue ) by  asking it to tell you what it's thinking.

Go a bit farther down to lines 2176-2177

Code:
               ' > /dev/null 2>&1 &';
               //' -v > /home/pi/librespot.txt 2>&1 &'; // r45a debug

and edit them to instead read


Code:
               //' > /dev/null 2>&1 &';
               ' -v > /home/pi/librespot.txt 2>&1 &'; // r45a debug

Save playerlib.php and restart moOde for good measure.

Now you can monitor the file /home/pi/librespot.txt while you try connecting and playing with your Spotify app. You'd need this information in any case to post an issue on the librespot repo. (Note there's a lot of output including possibly some error messages unrelated to your issue. We're looking specifically for messages that suggest unexpected stops/disconnects. Note also you'll probably want to reverse the change after testing.)

I neglected to add that I'm also successfully streaming to moOde/librespot from the Spotify Web app on my Linux laptop.

The preponderance (or, rather, lack) of evidence on my end suggests we're not dealing with a librespot bug but "never say never."

Perhaps unrelated, entering "Galaxy S9 Spotify problem" into my favorite search engine gets back a ton of hits.

Regards,
Kent
Reply
#5
Hi Kent

Thanks for that, I did enable the -v that so I was able to paste the librespot behaviour in the first post.

I'll try to find the time to revert to default and test the Spotify behaviour with an Ipad instead, this way I can at least point towards the Spotify on the Android as being a possible factor. I am also curious if the Stop comes from the device sending the Play command or internally from librespot somehow due to an error condition (it's not clear from the debug).

Thanks
adixor
Reply
#6
Based on my limited monitoring of the interchanges between my iPad Spotify app and the librespot renderer in moOde, this message means the Spotify app on your phone is commanding librespot to stop playing:

Code:
[2020-06-04T15:30:45Z DEBUG librespot_playback::player] command=Stop

The only commands I see being sent by my iPad Spotify app are Load, Play, Pause. As seen in your log entry for your Stop commands, the Pause command gets passed to spotevent.sh as the environmental variable PLAYER_EVENT: stop (not suprising).


YMMV.

Regards,
Kent
Reply
#7
(06-05-2020, 12:23 AM)TheOldPresbyope Wrote: I've been sitting here alternating between the Spotify app on my iPad and the one on my Pixel3a phone, in both cases directing the stream to a stock moOde 6.5.2 player with the Spotify bitrate option set to 320kbps just as the setting you have.

Everything is working the way I expect it to.

Offhand our sysinfo.sh outputs are similar. Some differences: you're testing on an RPi4B, I'm on an Rpi3B+; you're using an Ethernet connection, I'm using WiFi; your audio device is USB but you have somewhat different parameters:

You

Code:
Audio device            = USB audio device
Interface               = USB
Mixer name              = Speaker
Hardware volume         = Controller detected


Me


Code:
Audio device        = USB audio device
Interface        = USB
Mixer name        = PCM
Hardware volume        = None


Candidly, I don't know if this difference is important to the Spotify renderer. What I do know is I couldn't repro your issue.

Regards,
Kent

Hey Guys. I'm new here. I had similar problems with synchronization between moode from rpi 4b and my spotify apk in android phone. Problem was in audio config-->MPD config. Later I had volume control "software" and DSD overPCM "YES". Synchronization was very poor, that doesn't working. Now I have volume control "disabled" and DSD over PCM "NO". It's play perfect!! Smile
Reply
#8
(06-08-2020, 09:14 PM)melsar Wrote:
(06-05-2020, 12:23 AM)TheOldPresbyope Wrote: I've been sitting here alternating between the Spotify app on my iPad and the one on my Pixel3a phone, in both cases directing the stream to a stock moOde 6.5.2 player with the Spotify bitrate option set to 320kbps just as the setting you have.

Everything is working the way I expect it to.

Offhand our sysinfo.sh outputs are similar. Some differences: you're testing on an RPi4B, I'm on an Rpi3B+; you're using an Ethernet connection, I'm using WiFi; your audio device is USB but you have somewhat different parameters:

You

Code:
Audio device            = USB audio device
Interface               = USB
Mixer name              = Speaker
Hardware volume         = Controller detected


Me


Code:
Audio device        = USB audio device
Interface        = USB
Mixer name        = PCM
Hardware volume        = None


Candidly, I don't know if this difference is important to the Spotify renderer. What I do know is I couldn't repro your issue.

Regards,
Kent

Hey Guys. I'm new here. I had similar problems with synchronization between moode from rpi 4b and my spotify apk in android phone. Problem was in audio config-->MPD config. Later I had volume control "software" and DSD overPCM "YES". Synchronization was very poor, that doesn't working. Now I have volume control "disabled" and DSD over PCM "NO". It's play perfect!! Smile
wrrr... I take it back. I was change that options one more and back, and I had the same problems. No synch
Reply
#9
(06-08-2020, 10:28 PM)melsar Wrote:
(06-08-2020, 09:14 PM)melsar Wrote:
(06-05-2020, 12:23 AM)TheOldPresbyope Wrote: I've been sitting here alternating between the Spotify app on my iPad and the one on my Pixel3a phone, in both cases directing the stream to a stock moOde 6.5.2 player with the Spotify bitrate option set to 320kbps just as the setting you have.

Everything is working the way I expect it to.

Offhand our sysinfo.sh outputs are similar. Some differences: you're testing on an RPi4B, I'm on an Rpi3B+; you're using an Ethernet connection, I'm using WiFi; your audio device is USB but you have somewhat different parameters:

You

Code:
Audio device            = USB audio device
Interface               = USB
Mixer name              = Speaker
Hardware volume         = Controller detected


Me


Code:
Audio device        = USB audio device
Interface        = USB
Mixer name        = PCM
Hardware volume        = None


Candidly, I don't know if this difference is important to the Spotify renderer. What I do know is I couldn't repro your issue.

Regards,
Kent

Hey Guys. I'm new here. I had similar problems with synchronization between moode from rpi 4b and my spotify apk in android phone. Problem was in audio config-->MPD config. Later I had volume control "software" and DSD overPCM "YES". Synchronization was very poor, that doesn't working. Now I have volume control "disabled" and DSD over PCM "NO". It's play perfect!! Smile
wrrr... I take it back. I was change that options one more and back, and I had the same problems. No synch

Tried those already (well at least the Volume setting to disabled) but it didn't help. I also have the settings you mention now on Disabled/NO and it works using my fix above. You could try enabling the -v keyword for librespot (see a message above from Kent on that) and give us the debug output to see if this is at least the same issue.
Reply
#10
(06-05-2020, 06:46 PM)adixor Wrote: Thanks a lot Kent for trying! I have no idea if it's a librespot bug, or Spotify issue, or my mobile (Samsung Galaxy S9) Smile But I am happy with my workaround and it works. (I tested other bitrates as well, it's not that). Just for completeness, here's the other box I have, an RPI3 with an I2C board, also using Wired ethernet.

I do understand there is nothing you can do if you cannot replicate, and if there are no others impacted then the problem must be me Smile but at least if anybody else has this, they can try my fix.

Thanks everybody there for Moode and all your efforts!

adixor

Fear not, you are not alone. I have the exact same problem.

Sometimes it works without a problem, but most of the time it doesn't. When I connect to moode/librespot using the android spotify app, it displays it as playing on moode. But no sound gets played. Then, when I pause, the phone displays that it isn't connected to moode any more.

When running moode's librespot with '-v', the exact same behaviour is shown as you described: 
Code:
[2020-07-22T15:25:15Z INFO  librespot_playback::player] Loading <Destino o casualidad> with Spotify URI <spotify:track:2sMxswHr9wX7kTUHULvJBJ>
[2020-07-22T15:25:15Z INFO  librespot_playback::player] <Destino o casualidad> loaded
[2020-07-22T15:25:15Z INFO  librespot::player_event_handler] Running ["/var/local/www/commandw/spotevent.sh"] with environment variables {"TRACK_ID": "2sMxswHr9wX7kTUHULvJBJ", "PLAYER_EVENT": "start"}
[2020-07-22T15:25:15Z INFO  librespot::player_event_handler] Running ["/var/local/www/commandw/spotevent.sh"] with environment variables {"PLAYER_EVENT": "stop", "TRACK_ID": "2sMxswHr9wX7kTUHULvJBJ"}

A 'stop' message comes right after the 'start' message.
This happens most of the times, although it works as intended occasionally.

I've upgraded from 6.5.2 to 6.7.0, but the problem happened before and after upgrading.
My current setup is:

Code:
S Y S T E M   P A R A M E T E R S

moOde release           = 6.7.0 2020-07-19
RaspiOS                 = 10.3
Linux kernel            = 5.4.51-v7+ #1325
Platform                = Pi-3B 1GB v1.2
Architecture            = armv7l (32-bit)
System uptime           = up 2 hours, 48 minutes
Timezone                = Europe/Berlin
Current time            = 2020-07-22 17:50:20

Host name               = cupcake
Ethernet address        = 192.168.133.38
Ethernet MAC            = b8:27:eb:10:20:16
WLAN address            = unassigned
WLAN MAC                = no adapter
WLAN country            = US

SoC identifier          = bcm2837
Core count              = 4
Kernel timer freq       = 100 Hz
SDCard freq             = 50 MHz
USB boot                = not enabled
Warranty                = OK

Root size               = 29G
Root used               = 10%
Root available          = 26G
Root expand             = expanded
Memory free             = 93 MB
Memory used             = 91 MB
SoC temperature         = 53.2°C

CPU governor            = ondemand
Onboard WiFi            = Off
Onboard BT              = On
HDMI output             = Off
LED state               = 0,0
Eth addr wait           = On
Max USB current         = Off
USB (UAC2) fix          = Off
Pi-3B+ eth fix          = Off
SSH term server         = Off

PHP-FPM version         = 7.3.11
NGINX version           = 1.14.2
SQLite3 version         = 3.27.2
Hostapd version         = 2.8-devel
WiringPi version        = 2.50
RPi.GPIO version        = 0.7.0

A U D I O   P A R A M E T E R S

Audio device            = Allo Boss DAC
Interface               = I2S
Mixer name              = Digital
Hardware volume         = Controller detected
Max ALSA volume         = 90
Max MPD volume          = 100
Volume step limit       = 10
Audio source            = Local
Output device           = Local
Resume MPD              = No
Volume knob             = 86
Volume mute             = Unmuted
Saved MPD vol           = 0
Preamp volume           = 0
ALSA version            = 1.1.8-1+rpt1
SoX version             = 0.1.2-3

Bluetooth controller    = On
Pairing agent           = On
Airplay receiver        = Off
Spotify receiver        = On
Squeezelite             = Off
UPnP client             = Off
DLNA server             = Off
GPIO button handler     = Off
UPnP browser            = Off

Auto-shuffle            = Off
Autoplay                = Off
Rotary encoder          = Off
Encoder params          = 100 2 3 23 24
USB volume knob         = Off
Polarity inversion      = Off
Crossfeed               = Off
Crossfade               = Off
Parametric EQ           = Off
Graphic EQ              = Off
MPD httpd               = Off

A P P E A R A N C E   S E T T I N G S

Themes and backgrounds
----------------------
Theme                   = Default
Accent color            = Emerald
Alpha blend             = 1.0
Adaptive background     = No
Background image        = No
Cover backdrop          = No
Cover blur              = 20px
Cover scale             = 1.25

Library options
----------------------
Instant play action     = Add/Play
Show tagview genres     = Yes
Show tagview covers     = Yes
Show sample rate        = No
Ellipsis limited text   = No
Thumbnail columns       = 6/2 (Default)
Albumview sort order    = by Artist
Tagview sort order      = by Artist
Compilation identifier  = Various Artists
Recently added          = 1 Month
Ignore articles         = a,an,the
UTF8 character filter   = No
Hi-res thumbs           = Auto
Cover search pri        = Embedded cover
Pixel ratio             = 1

Coverview screen saver
----------------------
CoverView auto-display  = Never
CoverView style         = Gradient (Linear)

Other options
----------------------
Font size               = Normal
Auto-shuffle filter     = None
Extra metadata          = track,disc,date,composer,encoded
Playback history        = No
First use help          = y,y

M P D   S E T T I N G S

Version                 = 0.21.24
Volume control          = software
ALSA device             = hw:0
SoX resampling          = disabled
SoX quality             = very high
SoX multithreading      = off
DSD over PCM (DoP)      = no
Replaygain              = off
Replaygain preamp       = 0
Volume normalization    = Yes
Audio buffer            = 4096 (kb)
Output buffer size      = 131072 (kb)

B L U E T O O T H   S E T T I N G S

Bluetooth ver           = 5.50
Bluealsa ver            = v2.1.0
Speaker sharing         = Yes
Resume MPD              = No
PCM buffer time         = 500000 (μs)

A I R P L A Y   S E T T I N G S

Version                 = 3.3.6
Friendly name           = Moode Airplay
ALSA device             = hw:0
Interpolation           = soxr
Output bit depth        = S16
Output sample rate      = 44100
Session interruption    = no
Session timeout         = 120 (ms)
Latency offset          = 0.0 (secs)
Audio buffer            = 0.2 (secs)
Resume MPD              = No

S P O T I F Y   S E T T I N G S

Friendly name           = Cupcake
ALSA device             = plughw:0
Bit rate                = 320
Initial volume          = 90
Volume curve            = Logarithmic
Volume normalization    = Yes
Normalization pregain   = 0
Autoplay                = No
Resume MPD              = No

S Q U E E Z E L I T E   S E T T I N G S

Version                 = 1.8.7-1052 "DSD/SRC enabled"
Friendly name           = Moode
ALSA device             = hw:0
ALSA params             = 80:4::1
Output buffers          = 40000:100000
Task priority           = 45
Codec list              = flac,pcm,mp3,ogg,aac,alac,dsd
Other options           = -W -D 500 -R E -S /var/local
Resume MPD              = No

L O C A L   D I S P L A Y   S E T T I N G S

Local UI display        = Off
Mouse cursor            = On
Screen blank            = 600 Secs
Wake display on play    = Off
Brightness              = 255
Pixel aspect ratio      = Default
Rotate screen           = 0 Deg

M O O D E   S T A R T U P   L O G

20200722 150226 worker: -- Start
20200722 150226 worker: Successfully daemonized
20200722 150226 worker: Integrity check (passed)
20200722 150226 worker: Session loaded
20200722 150226 worker: Debug logging (off)
20200722 150226 worker: Device raw: (0:BossDAC|1:empty|2:empty|3:empty
20200722 150226 worker: Device i2s: (Allo Boss DAC)
20200722 150226 worker: Device mpd: (0:Allo Boss DAC)
20200722 150226 worker: Device ses: (0|Allo Boss DAC|HDMI|0%)
20200722 150227 worker: ALSA Digital volume set to (0%)
20200722 150227 worker: -- System
20200722 150228 worker: Host     (cupcake)
20200722 150228 worker: moOde    (6.7.0 2020-07-19)
20200722 150228 worker: RaspiOS  (10.3)
20200722 150228 worker: Kernel   (5.4.51-v7+ #1325)
20200722 150228 worker: Platform (Pi-3B 1GB v1.2)
20200722 150228 worker: ARM arch (armv7l, 32-bit kernel)
20200722 150228 worker: MPD ver  (0.21.24)
20200722 150228 worker: CPU gov  (ondemand)
20200722 150228 worker: USB boot not enabled yet
20200722 150229 worker: File system expanded
20200722 150229 worker: HDMI port off
20200722 150229 worker: File check (OK)
20200722 150229 worker: -- Network
20200722 150229 worker: eth0 exists
20200722 150230 worker: IP addr (192.168.133.38)
20200722 150230 worker: Netmask (255.255.255.0)
20200722 150230 worker: Gateway (192.168.133.1)
20200722 150230 worker: Pri DNS (192.168.133.1)
20200722 150230 worker: Domain  (fritz.box)
20200722 150230 worker: wlan0 does not exist
20200722 150230 worker: -- Audio
20200722 150231 worker: MPD conf updated
20200722 150231 worker: ALSA outputs unmuted
20200722 150231 worker: ALSA card number (0)
20200722 150231 worker: Audio output (Allo Boss DAC)
20200722 150231 worker: Audio formats (S16_LE, S24_LE, S32_LE)
20200722 150231 worker: ALSA mixer name (Digital)
20200722 150231 worker: MPD volume control (software)
20200722 150231 worker: Hdwr volume controller exists
20200722 150231 worker: Max ALSA volume (90%)
20200722 150231 worker: Reset renderer active flags
20200722 150231 worker: -- MPD
20200722 150232 worker: MPD started
20200722 150232 worker: MPD accepting connections
20200722 150232 worker: Configure MPD outputs
20200722 150232 worker: MPD output 1 ALSA default (on)
20200722 150232 worker: MPD output 2 ALSA crossfeed (off)
20200722 150232 worker: MPD output 3 ALSA parametric eq (off)
20200722 150232 worker: MPD output 4 ALSA graphic eq (off)
20200722 150232 worker: MPD output 5 ALSA polarity inversion (off)
20200722 150232 worker: MPD output 6 ALSA bluetooth (off)
20200722 150232 worker: MPD output 7 HTTP stream (off)
20200722 150232 worker: MPD crossfade (off)
20200722 150232 worker: -- Feature availability
20200722 150232 worker: Source select (available)
20200722 150232 worker: Source select (source: MPD)
20200722 150232 worker: Source select (output: Allo Boss DAC)
20200722 150232 worker: Bluetooth (available)
20200722 150232 worker: Bluetooth (started)
20200722 150238 worker: Bluetooth pairing agent (started)
20200722 150238 worker: Airplay renderer (available)
20200722 150238 worker: Spotify renderer (available)
20200722 150238 worker: Spotify renderer (started)
20200722 150238 worker: Squeezelite renderer (available)
20200722 150238 worker: UPnP renderer (available)
20200722 150238 worker: DLNA server (available)
20200722 150238 worker: UPnP browser (available)
20200722 150238 worker: Audio scrobbler (available)
20200722 150238 worker: GPIO button handler (available)
20200722 150238 worker: -- Music sources
20200722 150238 worker: USB sources (none attached)
20200722 150238 worker: NAS and UPnP sources (none configured)
20200722 150238 worker: -- Miscellaneous
20200722 150238 worker: USB volume knob (Off)
20200722 150238 worker: USB auto-mounter (udisks-glue)
20200722 150238 worker: LED0 (Off)
20200722 150238 worker: LED1 (Off)
20200722 150238 worker: Saved MPD vol level (0)
20200722 150238 worker: Preamp volume level (0)
20200722 150238 worker: MPD volume level (0) restored
20200722 150238 worker: ALSA Digital volume (90%)
20200722 150238 worker: Auto-play (Off)
20200722 150238 worker: Maintenance interval (3 hrs)
20200722 150238 worker: Screen saver activation (Never)
20200722 150238 worker: Session permissions (OK)
20200722 150238 worker: Watchdog started
20200722 150238 worker: Ready
20200722 150709 worker: Job sourcecfg
20200722 150709 sourceMount(): Mount error: (mount error(95): Operation not supported
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs))
20200722 150822 worker: Job sourcecfg
20200722 150854 worker: Job update_library
20200722 150854 thmcache: Start
20200722 150854 thmcache: Scanning: NAS, SDCARD, UPNP
20200722 151122 thmcache: Done: 847 album dirs processed
20200722 152120 worker: Job update_library done
20200722 171039 worker: Job spotifysvc
20200722 171313 worker: Job spotifysvc
20200722 172109 watchdog: LIBRESPOT restarted (check syslog for errors)
20200722 172146 watchdog: LIBRESPOT restarted (check syslog for errors)
20200722 172153 watchdog: LIBRESPOT restarted (check syslog for errors)
20200722 172301 watchdog: LIBRESPOT restarted (check syslog for errors)
20200722 173611 watchdog: LIBRESPOT restarted (check syslog for errors)
20200722 173738 watchdog: LIBRESPOT restarted (check syslog for errors)
Reply


Forum Jump: