epoupon / lms

Lightweight Music Server. Access your self-hosted music using a web interface.
http://lms-demo.poupon.dev
GNU General Public License v3.0
1.08k stars 59 forks source link

Pressing "play" in airsonic API also starts playing in web player #333

Open lluki opened 1 year ago

lluki commented 1 year ago

Let me first say thanks for this cool project, it looks really well made!

There seems to a session confusion when having a web player open and using an app on the same phone.

Repro

I'm using a pixel7, firefox as browser, LMS installed using docker (epoupon/lms latest f2f0ceeca6ff 4 days ago).

I open the web player on firefox on my android phone, play a song, hit "pause" in the middle. Then i open the app, click on "play" in the app. The app starts playing, as expected. Also the web player starts playing (unexpected). Hence two songs are playing at the same time. It's not necessarily the same song.

Logs

192.168.178.54 - - [2023-Aug-31 20:10:02.029] "POST /?wtd=jkdF3z6mPCxGyy1p HTTP/1.1" 200 0
[2023-Aug-31 20:10:02.138] 1 - [info] "Wt: session created (#sessions = 3)"
[2023-Aug-31 20:10:02.138] 1 [/ fbqxyWDPaffPOzoK] [info] "WEnvironment: UserAgent: Mozilla/5.0 (Android 13; Mobile; rv:109.0) Gecko/116.0 Firefox/116.0"
[2023-Aug-31 20:10:02.138] 1 [/ fbqxyWDPaffPOzoK] [info] "Wt: Not serving this: request of type 'resource' in a brand new session (probably coming from an old session)"
[2023-Aug-31 20:10:02.138] 1 - [info] "WebController: Removing session fbqxyWDPaffPOzoK"
[2023-Aug-31 20:10:02.138] 1 [/ fbqxyWDPaffPOzoK] [info] "Wt: session destroyed (#sessions = 2)"
192.168.178.54 - - [2023-Aug-31 20:10:02.138] "GET /release/?wtd=jkdf3z6mpcxgyy1p&request=resource&resource=o1bs0x14&ver=1&trackid=1179&size=128 HTTP/1.1" 200 45
[2023-Aug-31 20:10:04.071] 1 - [info] "Wt: session created (#sessions = 3)"
[2023-Aug-31 20:10:04.071] 1 [/ uLoIwbqPiBJvcVTM] [info] "WEnvironment: UserAgent: Mozilla/5.0 (Android 13; Mobile; rv:109.0) Gecko/116.0 Firefox/116.0"
[2023-Aug-31 20:10:04.071] 1 [/ uLoIwbqPiBJvcVTM] [info] "Wt: Not serving this: request of type 'resource' in a brand new session (probably coming from an old session)"
[2023-Aug-31 20:10:04.071] 1 - [info] "WebController: Removing session uLoIwbqPiBJvcVTM"
[2023-Aug-31 20:10:04.071] 1 [/ uLoIwbqPiBJvcVTM] [info] "Wt: session destroyed (#sessions = 2)"
192.168.178.54 - - [2023-Aug-31 20:10:04.071] "GET /release/?wtd=jkdf3z6mpcxgyy1p&request=resource&resource=o1bs0x14&ver=1&trackid=1179&size=128 HTTP/1.1" 200 45

<--- at this point i hit "pause" in the browser and switching to the substreamer app

[mp3 @ 0x7fc9d1d069c0] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fc9d1d069c0] Could not find codec parameters for stream 1 (Video: mjpeg, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
84.254.89.207 - - [2023-Aug-31 20:10:14.143] "GET /rest/getCoverArt.view?u=admin&p=PASSWORD&v=1.13.0&c=substreamer&f=json&size=200&id=tr-239 HTTP/1.1" 200 10890
[mp3 @ 0x7fc9d23df000] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fc9d23df000] Could not find codec parameters for stream 1 (Video: mjpeg, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
84.254.89.207 - - [2023-Aug-31 20:10:14.154] "GET /rest/getCoverArt.view?u=admin&p=PASSWORD&v=1.13.0&c=substreamer&f=json&size=200&id=tr-240 HTTP/1.1" 200 10890
[mp3 @ 0x7fc9d23defc0] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fc9d23defc0] Could not find codec parameters for stream 1 (Video: mjpeg, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mp3 @ 0x7fc9d1d06380] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fc9d1d06380] Could not find codec parameters for stream 1 (Video: mjpeg, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
84.254.89.207 - - [2023-Aug-31 20:10:14.212] "GET /rest/getCoverArt.view?u=admin&p=PASSWORD&v=1.13.0&c=substreamer&f=json&size=200&id=tr-241 HTTP/1.1" 200 10890
84.254.89.207 - - [2023-Aug-31 20:10:14.216] "GET /rest/getCoverArt.view?u=admin&p=PASSWORD&v=1.13.0&c=substreamer&f=json&size=200&id=tr-238 HTTP/1.1" 200 10890
[2023-Aug-31 20:10:15.667] 1 - [info] "Wt: session created (#sessions = 3)"
[2023-Aug-31 20:10:15.667] 1 [/ FjVRN5KgyUtg0nrT] [info] "WEnvironment: UserAgent: Mozilla/5.0 (Android 13; Mobile; rv:109.0) Gecko/116.0 Firefox/116.0"
[2023-Aug-31 20:10:15.667] 1 [/ FjVRN5KgyUtg0nrT] [info] "Wt: Not serving this: request of type 'resource' in a brand new session (probably coming from an old session)"
[2023-Aug-31 20:10:15.667] 1 - [info] "WebController: Removing session FjVRN5KgyUtg0nrT"
[2023-Aug-31 20:10:15.667] 1 [/ FjVRN5KgyUtg0nrT] [info] "Wt: session destroyed (#sessions = 2)"
192.168.178.54 - - [2023-Aug-31 20:10:15.667] "GET /release/?wtd=jkdf3z6mpcxgyy1p&request=resource&resource=o1bs0x14&ver=1&trackid=1179&size=128 HTTP/1.1" 200 45
[mp3 @ 0x7fc9d1d06340] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fc9d1d06340] Could not find codec parameters for stream 1 (Video: mjpeg, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
84.254.89.207 - - [2023-Aug-31 20:10:16.891] "GET /rest/getCoverArt.view?u=admin&p=PASSWORD&v=1.13.0&c=substreamer&f=json&size=500&id=tr-238 HTTP/1.1" 200 44163
[mp3 @ 0x7fc9d1d06a00] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fc9d1d06a00] Could not find codec parameters for stream 1 (Video: mjpeg, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
84.254.89.207 - - [2023-Aug-31 20:10:17.369] "GET /rest/getCoverArt.view?u=admin&p=PASSWORD&v=1.13.0&c=substreamer&f=json&size=500&id=tr-239 HTTP/1.1" 200 44163
[mp3 @ 0x7fc9d23df000] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fc9d23df000] Could not find codec parameters for stream 1 (Video: mjpeg, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
84.254.89.207 - - [2023-Aug-31 20:10:17.875] "GET /rest/getCoverArt.view?u=admin&p=PASSWORD&v=1.13.0&c=substreamer&f=json&size=500&id=tr-240 HTTP/1.1" 200 44163
[mp3 @ 0x7fc9d1d06380] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fc9d1d06380] Could not find codec parameters for stream 1 (Video: mjpeg, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
84.254.89.207 - - [2023-Aug-31 20:10:18.370] "GET /rest/getCoverArt.view?u=admin&p=PASSWORD&v=1.13.0&c=substreamer&f=json&size=500&id=tr-241 HTTP/1.1" 200 44163
[2023-Aug-31 20:10:20.912] 1 - [info] "Wt: session created (#sessions = 3)"
[2023-Aug-31 20:10:20.912] 1 [/ N8fEpjZvoTh2h87Z] [info] "WEnvironment: UserAgent: Mozilla/5.0 (Android 13; Mobile; rv:109.0) Gecko/116.0 Firefox/116.0"
[2023-Aug-31 20:10:20.912] 1 [/ N8fEpjZvoTh2h87Z] [info] "Wt: Not serving this: request of type 'resource' in a brand new session (probably coming from an old session)"
[2023-Aug-31 20:10:20.912] 1 - [info] "WebController: Removing session N8fEpjZvoTh2h87Z"
[2023-Aug-31 20:10:20.912] 1 [/ N8fEpjZvoTh2h87Z] [info] "Wt: session destroyed (#sessions = 2)"
192.168.178.54 - - [2023-Aug-31 20:10:20.912] "GET /release/?wtd=jkdf3z6mpcxgyy1p&request=resource&resource=o1bs0x14&ver=1&trackid=1179&size=128 HTTP/1.1" 200 45
epoupon commented 1 year ago

Cannot reproduce the issue on android. The code LMS side is not really related, so I suspect something weird when multiple players are active/paused in the OS. That bein said, looks like substreamer does weird things on its side (like playback still ongoing even if the controls are not show on the system panel)

stkw0 commented 4 months ago

Something similar happens to me. But in my case if I am playing a song in firefox, pause it, and play a different media, it pauses right at the start and instead firefox resumes playing. Maybe it's a bug in firefox, did you tried with Chrome?