SpotConnect
SpotConnect copied to clipboard
Spotify authentication results in Segmentation fault
Hi, first of all thanks a ton for this project. It does exactly what I've been looking for.
Everything works great when using it in ZeroConf mode but when I specify my Spotify (Premium) credentials it looks like it auths successfully initially but I also see quite a bit of:
[23:04:04.042] I PlainConnection.cpp:197: Closing socket...
[23:04:04.201] I Session.cpp:43: Received APHello response
[23:04:04.206] D Session.cpp:48: Received shannon keys
[23:04:04.290] E Session.cpp:95: Authorization declined
[23:04:04.291] E spotify.cpp:537: failed authentication, forcing ZeroConf
When I then try to play it segfaults. I tried both the shared libraries and static version of the linux x86_64 binaries. Just to make sure it wasn't something specific to my install I tried it on my arm Mac Mini as well and had the same results.
I might try to build from source and attach a debugger next. Here's the full log:
spotify@debian:~/spotraop# ./spotraop-linux-x86_64 -x config.xml -U <redacted> -P <redacted> -d all=sdebug
[23:04:03.203] main:1223 Starting spotraop version: v0.9.2 (Mar 5 2024 @ 14:38:15)
[23:04:03.205] Start:977 Binding to 192.168.7.142
[23:04:03.205] StartActiveRemote:859 DACP port: 46063
[23:04:03.239] AddRaopDevice:582 [0xb04d20]: adding renderer ([email protected]) with mac AAAA-9C370701
[23:04:03.239] raopcl_create:715 [0x70b2cc0090f0]: using ALAC coding
[23:04:03.245] I spotify.cpp:411: User/Password mode
[23:04:03.245] I spotify.cpp:429: Spotify client launched for Algernon+
[23:04:03.295] AddRaopDevice:582 [0xb05ac0]: adding renderer ([email protected]) with mac AAAA-4CA69ADD
[23:04:03.295] raopcl_create:715 [0x70b2cc013fe0]: using ALAC coding
[23:04:03.303] I spotify.cpp:411: User/Password mode
[23:04:03.303] I spotify.cpp:429: Spotify client launched for Office+
[23:04:03.310] AddRaopDevice:582 [0xb06860]: adding renderer ([email protected]) with mac AAAA-BC617E08
[23:04:03.310] raopcl_create:715 [0x70b2cc01df00]: using ALAC coding
[23:04:03.316] I spotify.cpp:411: User/Password mode
[23:04:03.316] I spotify.cpp:429: Spotify client launched for Living Room+
[23:04:03.344] AddRaopDevice:582 [0xb07600]: adding renderer ([email protected]) with mac AAAA-1C474B45
[23:04:03.344] raopcl_create:715 [0x70b2cc027e00]: using ALAC coding
[23:04:03.350] I spotify.cpp:411: User/Password mode
[23:04:03.350] I spotify.cpp:429: Spotify client launched for M4Max+
[23:04:03.354] AddRaopDevice:582 [0xb083a0]: adding renderer ([email protected]) with mac AAAA-6DFD2B8E
[23:04:03.354] raopcl_create:715 [0x70b2cc031d70]: using ALAC coding
[23:04:03.360] I spotify.cpp:411: User/Password mode
[23:04:03.360] I spotify.cpp:429: Spotify client launched for Dining Room+
[23:04:03.374] AddRaopDevice:524 [0xb09140]: AppleTV with no authentication key, create one using '-l' option
[23:04:03.374] AddRaopDevice:582 [0xb09140]: adding renderer ([email protected]) with mac AAAA-8115F015
[23:04:03.374] raopcl_create:715 [0x70b2cc03bc90]: using ALAC coding
[23:04:03.380] I spotify.cpp:411: User/Password mode
[23:04:03.380] I spotify.cpp:429: Spotify client launched for ATV+
[23:04:03.436] AddRaopDevice:582 [0xb09ee0]: adding renderer ([email protected]) with mac AAAA-E0D590A9
[23:04:03.436] raopcl_create:715 [0x70b2cc045bd0]: using ALAC coding
[23:04:03.447] AddRaopDevice:582 [0xb0ac80]: adding renderer ([email protected]) with mac AAAA-E76E6829
[23:04:03.447] raopcl_create:715 [0x70b2cc04fb50]: using ALAC coding
[23:04:03.451] I spotify.cpp:411: User/Password mode
[23:04:03.451] I spotify.cpp:429: Spotify client launched for Garage+
[23:04:03.459] I spotify.cpp:411: User/Password mode
[23:04:03.459] I spotify.cpp:429: Spotify client launched for Vikingur+
[23:04:03.468] D Session.cpp:67: Connecting with AP <ap-gew1.spotify.com:4070>
[23:04:03.487] AddRaopDevice:582 [0xb0ba20]: adding renderer ([email protected]) with mac AAAA-7AD30356
[23:04:03.487] raopcl_create:715 [0x70b2cc059a40]: using ALAC coding
[23:04:03.495] I spotify.cpp:411: User/Password mode
[23:04:03.495] I spotify.cpp:429: Spotify client launched for Bedroom+
[23:04:03.505] AddRaopDevice:524 [0xb0c7c0]: AppleTV with no authentication key, create one using '-l' option
[23:04:03.505] AddRaopDevice:582 [0xb0c7c0]: adding renderer ([email protected]) with mac AAAA-4B49E319
[23:04:03.505] raopcl_create:715 [0x70b2cc063980]: using ALAC coding
[23:04:03.511] I spotify.cpp:411: User/Password mode
[23:04:03.511] I spotify.cpp:429: Spotify client launched for Bedroom-ATV+
[23:04:03.512] D PlainConnection.cpp:101: Connected to spotify server
[23:04:03.518] D Session.cpp:67: Connecting with AP <ap-gew1.spotify.com:4070>
[23:04:03.535] D Session.cpp:67: Connecting with AP <ap-gew1.spotify.com:4070>
[23:04:03.559] AddRaopDevice:582 [0xb0d560]: adding renderer ([email protected]) with mac AAAA-DFEA478A
[23:04:03.559] raopcl_create:715 [0x70b2cc06d8c0]: using ALAC coding
[23:04:03.561] I Session.cpp:43: Received APHello response
[23:04:03.562] D PlainConnection.cpp:101: Connected to spotify server
[23:04:03.577] I spotify.cpp:411: User/Password mode
[23:04:03.577] I spotify.cpp:429: Spotify client launched for Stefnir+
[23:04:03.577] D Session.cpp:67: Connecting with AP <ap-gew1.spotify.com:4070>
[23:04:03.582] D Session.cpp:48: Received shannon keys
[23:04:03.583] D PlainConnection.cpp:101: Connected to spotify server
[23:04:03.592] D Session.cpp:67: Connecting with AP <ap-gew1.spotify.com:4070>
[23:04:03.601] D Session.cpp:67: Connecting with AP <ap-gew1.spotify.com:4070>
[23:04:03.619] AddRaopDevice:582 [0xb0e300]: adding renderer ([email protected]) with mac AAAA-32BB1C19
[23:04:03.619] raopcl_create:715 [0x70b2cc077810]: using ALAC coding
[23:04:03.624] D PlainConnection.cpp:101: Connected to spotify server
[23:04:03.627] I spotify.cpp:411: User/Password mode
[23:04:03.627] I spotify.cpp:429: Spotify client launched for Kitchen+
[23:04:03.627] I Session.cpp:43: Received APHello response
[23:04:03.637] D PlainConnection.cpp:101: Connected to spotify server
[23:04:03.640] D Session.cpp:48: Received shannon keys
[23:04:03.643] I Session.cpp:43: Received APHello response
[23:04:03.647] D PlainConnection.cpp:101: Connected to spotify server
[23:04:03.658] D Session.cpp:48: Received shannon keys
[23:04:03.676] E Session.cpp:95: Authorization declined
[23:04:03.676] E spotify.cpp:537: failed authentication, forcing ZeroConf
[23:04:03.677] I BellHTTPServer.cpp:194: Server listening on port 0
[23:04:03.677] I spotify.cpp:387: ZeroConf mode (port 34007)
[23:04:03.678] I MDNSService.cpp:195: using built-in mDNS for Algernon+
[23:04:03.678] I PlainConnection.cpp:197: Closing socket...
[23:04:03.678] I Session.cpp:43: Received APHello response
[23:04:03.682] D Session.cpp:67: Connecting with AP <ap-gew1.spotify.com:4070>
[23:04:03.683] D Session.cpp:67: Connecting with AP <ap-gew1.spotify.com:4070>
[23:04:03.688] D Session.cpp:48: Received shannon keys
[23:04:03.690] I Session.cpp:43: Received APHello response
[23:04:03.699] D Session.cpp:48: Received shannon keys
[23:04:03.702] I Session.cpp:43: Received APHello response
[23:04:03.709] D Session.cpp:48: Received shannon keys
[23:04:03.724] E Session.cpp:95: Authorization declined
[23:04:03.725] E spotify.cpp:537: failed authentication, forcing ZeroConf
[23:04:03.725] I BellHTTPServer.cpp:194: Server listening on port 0
[23:04:03.725] I spotify.cpp:387: ZeroConf mode (port 43347)
[23:04:03.725] I MDNSService.cpp:195: using built-in mDNS for Office+
[23:04:03.725] I PlainConnection.cpp:197: Closing socket...
[23:04:03.726] D PlainConnection.cpp:101: Connected to spotify server
[23:04:03.726] D PlainConnection.cpp:101: Connected to spotify server
[23:04:03.727] D Session.cpp:67: Connecting with AP <ap-gew1.spotify.com:4070>
[23:04:03.732] D Session.cpp:67: Connecting with AP <ap-gew1.spotify.com:4070>
[23:04:03.744] E Session.cpp:95: Authorization declined
[23:04:03.744] E spotify.cpp:537: failed authentication, forcing ZeroConf
[23:04:03.744] I BellHTTPServer.cpp:194: Server listening on port 0
[23:04:03.745] I spotify.cpp:387: ZeroConf mode (port 40279)
[23:04:03.745] I MDNSService.cpp:195: using built-in mDNS for Living Room+
[23:04:03.745] I PlainConnection.cpp:197: Closing socket...
[23:04:03.769] E Session.cpp:95: Authorization declined
[23:04:03.769] E spotify.cpp:537: failed authentication, forcing ZeroConf
[23:04:03.770] I BellHTTPServer.cpp:194: Server listening on port 0
[23:04:03.770] I spotify.cpp:387: ZeroConf mode (port 33823)
[23:04:03.770] I MDNSService.cpp:195: using built-in mDNS for M4Max+
[23:04:03.771] I PlainConnection.cpp:197: Closing socket...
[23:04:03.773] D PlainConnection.cpp:101: Connected to spotify server
[23:04:03.777] D PlainConnection.cpp:101: Connected to spotify server
[23:04:03.783] I Session.cpp:43: Received APHello response
[23:04:03.789] D Session.cpp:48: Received shannon keys
[23:04:03.789] E Session.cpp:95: Authorization declined
[23:04:03.789] E spotify.cpp:537: failed authentication, forcing ZeroConf
[23:04:03.789] I BellHTTPServer.cpp:194: Server listening on port 0
[23:04:03.790] I spotify.cpp:387: ZeroConf mode (port 32771)
[23:04:03.790] I MDNSService.cpp:195: using built-in mDNS for Dining Room+
[23:04:03.790] I PlainConnection.cpp:197: Closing socket...
[23:04:03.802] D Session.cpp:67: Connecting with AP <ap-gew1.spotify.com:4070>
[23:04:03.805] E Session.cpp:95: Authorization declined
[23:04:03.805] E spotify.cpp:537: failed authentication, forcing ZeroConf
[23:04:03.805] I BellHTTPServer.cpp:194: Server listening on port 0
[23:04:03.805] I spotify.cpp:387: ZeroConf mode (port 36133)
[23:04:03.805] I MDNSService.cpp:195: using built-in mDNS for ATV+
[23:04:03.806] I PlainConnection.cpp:197: Closing socket...
[23:04:03.827] I Session.cpp:43: Received APHello response
[23:04:03.833] D Session.cpp:48: Received shannon keys
[23:04:03.836] I Session.cpp:43: Received APHello response
[23:04:03.838] mDNSsearchCallback:396 [0xb04d20]: changed ip:port 192.168.7.152:7000
[23:04:03.842] D Session.cpp:48: Received shannon keys
[23:04:03.850] D PlainConnection.cpp:101: Connected to spotify server
[23:04:03.853] D Session.cpp:67: Connecting with AP <ap-gew1.spotify.com:4070>
[23:04:03.872] E Session.cpp:95: Authorization declined
[23:04:03.873] E spotify.cpp:537: failed authentication, forcing ZeroConf
[23:04:03.873] I BellHTTPServer.cpp:194: Server listening on port 0
[23:04:03.873] I spotify.cpp:387: ZeroConf mode (port 34313)
[23:04:03.873] I MDNSService.cpp:195: using built-in mDNS for Vikingur+
[23:04:03.874] I PlainConnection.cpp:197: Closing socket...
[23:04:03.898] D PlainConnection.cpp:101: Connected to spotify server
[23:04:03.901] I Session.cpp:43: Received APHello response
[23:04:03.909] D Session.cpp:48: Received shannon keys
[23:04:03.911] E Session.cpp:95: Authorization declined
[23:04:03.911] E spotify.cpp:537: failed authentication, forcing ZeroConf
[23:04:03.911] I BellHTTPServer.cpp:194: Server listening on port 0
[23:04:03.912] I spotify.cpp:387: ZeroConf mode (port 35371)
[23:04:03.912] I MDNSService.cpp:195: using built-in mDNS for Bedroom-ATV+
[23:04:03.912] I PlainConnection.cpp:197: Closing socket...
[23:04:03.925] E Session.cpp:95: Authorization declined
[23:04:03.925] E spotify.cpp:537: failed authentication, forcing ZeroConf
[23:04:03.926] I BellHTTPServer.cpp:194: Server listening on port 0
[23:04:03.926] I spotify.cpp:387: ZeroConf mode (port 40171)
[23:04:03.926] I MDNSService.cpp:195: using built-in mDNS for Bedroom+
[23:04:03.927] I PlainConnection.cpp:197: Closing socket...
[23:04:03.951] I Session.cpp:43: Received APHello response
[23:04:03.958] D Session.cpp:48: Received shannon keys
[23:04:03.959] mDNSsearchCallback:396 [0xb04d20]: changed ip:port 192.168.7.49:7000
[23:04:03.992] E Session.cpp:95: Authorization declined
[23:04:03.992] E spotify.cpp:537: failed authentication, forcing ZeroConf
[23:04:03.992] I BellHTTPServer.cpp:194: Server listening on port 0
[23:04:03.993] I spotify.cpp:387: ZeroConf mode (port 34689)
[23:04:03.993] I MDNSService.cpp:195: using built-in mDNS for Stefnir+
[23:04:03.993] I PlainConnection.cpp:197: Closing socket...
[23:04:04.041] E Session.cpp:95: Authorization declined
[23:04:04.041] E spotify.cpp:537: failed authentication, forcing ZeroConf
[23:04:04.041] I BellHTTPServer.cpp:194: Server listening on port 0
[23:04:04.041] I spotify.cpp:387: ZeroConf mode (port 43911)
[23:04:04.042] I MDNSService.cpp:195: using built-in mDNS for Kitchen+
[23:04:04.042] I PlainConnection.cpp:197: Closing socket...
[23:04:04.201] I Session.cpp:43: Received APHello response
[23:04:04.206] D Session.cpp:48: Received shannon keys
[23:04:04.290] E Session.cpp:95: Authorization declined
[23:04:04.291] E spotify.cpp:537: failed authentication, forcing ZeroConf
[23:04:04.291] I BellHTTPServer.cpp:194: Server listening on port 0
[23:04:04.291] I spotify.cpp:387: ZeroConf mode (port 45523)
[23:04:04.292] I MDNSService.cpp:195: using built-in mDNS for Garage+
[23:04:04.292] I PlainConnection.cpp:197: Closing socket...
[23:04:11.310] mDNSsearchCallback:396 [0xb04d20]: changed ip:port 192.168.7.152:7000
[23:04:12.793] I spotify.cpp:429: Spotify client launched for Garage+
[23:04:13.009] D Session.cpp:67: Connecting with AP <ap-gew1.spotify.com:4070>
[23:04:13.053] D PlainConnection.cpp:101: Connected to spotify server
[23:04:13.102] I Session.cpp:43: Received APHello response
[23:04:13.108] D Session.cpp:48: Received shannon keys
[23:04:13.172] D Session.cpp:87: Authorization successful
[23:04:13.173] I MercurySession.cpp:42: Received packet, command: 4
[23:04:13.173] D TimeProvider.cpp:15: Time synced with spotify servers
[23:04:13.173] I MercurySession.cpp:42: Received packet, command: 2
[23:04:13.173] I MercurySession.cpp:42: Received packet, command: 118
[23:04:13.173] I MercurySession.cpp:42: Received packet, command: 27
[23:04:13.173] D MercurySession.cpp:251: Executing Mercury Request, type SUB
[23:04:13.173] D MercurySession.cpp:153: Received country code IS
[23:04:13.173] I MercurySession.cpp:42: Received packet, command: 80
[23:04:13.174] I MercurySession.cpp:42: Received packet, command: 31
[23:04:13.174] I MercurySession.cpp:42: Received packet, command: 105
[23:04:13.216] I MercurySession.cpp:42: Received packet, command: 181
[23:04:13.273] I AccessKeyFetcher.cpp:99: Access token expired, fetching new one... 294
[23:04:13.300] I MercurySession.cpp:42: Received packet, command: 74
[23:04:13.300] I MercurySession.cpp:42: Received packet, command: 179
[23:04:13.300] D MercurySession.cpp:174: Received mercury packet
[23:04:13.300] D MercurySession.cpp:251: Executing Mercury Request, type SEND
[23:04:13.300] D SpircHandler.cpp:61: Sent kMessageTypeHello!
[23:04:13.384] I MercurySession.cpp:42: Received packet, command: 178
[23:04:13.384] D MercurySession.cpp:174: Received mercury packet
[23:04:13.468] I MercurySession.cpp:42: Received packet, command: 181
[23:04:13.468] I MercurySession.cpp:42: Received packet, command: 181
[23:04:13.468] D SpircHandler.cpp:69: Received subscription response
[23:04:13.469] D SpircHandler.cpp:132: Notify frame
[23:04:13.469] D SpircHandler.cpp:69: Received subscription response
[23:04:13.469] D SpircHandler.cpp:132: Notify frame
[23:04:13.512] I MercurySession.cpp:42: Received packet, command: 181
[23:04:13.512] D SpircHandler.cpp:69: Received subscription response
[23:04:13.512] D SpircHandler.cpp:179: Load frame 9!
Segmentation fault