Posts: 179
Threads: 8
Joined: Sep 2023
Reputation:
0
08-04-2024, 08:03 AM
(This post was last modified: 08-04-2024, 08:04 AM by kurt1970.)
@ TheOldPresbyope , @ Tim Curtis , @ Nutul I just sent you via PM a movie where I explain how to reproduce the issue, but also how you can workaround it.
As mentioned earlier, I bet on a playlist file locking issue, caused by MPD locking the file when scanning the PL folder.
The reproducer scenario works consistent on my 3 PIs.
Posts: 1,869
Threads: 43
Joined: Mar 2020
Reputation:
85
(08-03-2024, 10:48 AM)kurt1970 Wrote: I use IP reservations as well, and always address my instances via the IP address instead of its name.
Bang goes my simplistic and optimistic hypothesis...
(08-03-2024, 02:44 PM)TheOldPresbyope Wrote: Aw, rats. I woke up all set to post a brilliant argument on the reasons I thought a poor WiFi connection was unlikely to be the culprit, given the symptoms you describe. Too late, you've already established that for yourself.
Yeah I slept on it and thought - "hang on how come..." as well.
----------------
Robert
Posts: 1,869
Threads: 43
Joined: Mar 2020
Reputation:
85
(08-04-2024, 08:03 AM)kurt1970 Wrote: @TheOldPresbyope , @Tim Curtis , @Nutul I just sent you via PM a movie where I explain how to reproduce the issue, but also how you can workaround it.
As mentioned earlier, I bet on a playlist file locking issue, caused by MPD locking the file when scanning the PL folder.
The reproducer scenario works consistent on my 3 PIs.
Just so I'm sure I've got the case straight in my head, you get this error when:
A stored playlist is loaded into the queue, you start to play that playlist, then you try to re-add to the playlist a station that is already on the playlist?
Or
A stored playlist is loaded into the queue, you start to play that playlist, then you try to add a new station to the playlist?
And you get the error when using the three dot on a station and selecting "add to playlist" but not when adding a station to the queue then saving the queue as a playlist?
----------------
Robert
Posts: 179
Threads: 8
Joined: Sep 2023
Reputation:
0
(08-04-2024, 11:19 AM)the_bertrum Wrote: (08-04-2024, 08:03 AM)kurt1970 Wrote: @TheOldPresbyope , @Tim Curtis , @Nutul I just sent you via PM a movie where I explain how to reproduce the issue, but also how you can workaround it.
As mentioned earlier, I bet on a playlist file locking issue, caused by MPD locking the file when scanning the PL folder.
The reproducer scenario works consistent on my 3 PIs.
Just so I'm sure I've got the case straight in my head, you get this error when:
A stored playlist is loaded into the queue, you start to play that playlist, then you try to re-add to the playlist a station that is already on the playlist?
Or
A stored playlist is loaded into the queue, you start to play that playlist, then you try to add a new station to the playlist?
And you get the error when using the three dot on a station and selecting "add to playlist" but not when adding a station to the queue then saving the queue as a playlist?
Hi Robert,
It's just about adding radio stations to whatever playlist. This causes an issue when
In this video you can see what happens and how to reproduce the issue. Turn on the volume, as I explain the steps.
Posts: 13,396
Threads: 304
Joined: Mar 2018
Reputation:
543
I ran some quick tests with something playing and am not able to repro. Adding to playlist was 100% reliable.
I'd suggest adding the logging statements to playlist.php to determine if the script is crashing. A crash might help explain why the round trip between client and server is apparently not happening on your end.
https://moodeaudio.org/forum/showthread....5#pid56595
Also turn on Debug logging in System Config because there are some debugLog() statements in that script that would log errors in the moode log if the playlist file could not be opened.
Posts: 179
Threads: 8
Joined: Sep 2023
Reputation:
0
(08-04-2024, 01:45 PM)Tim Curtis Wrote: I ran some quick tests with something playing and am not able to repro. Adding to playlist was 100% reliable.
I'd suggest adding the logging statements to playlist.php to determine if the script is crashing. A crash might help explain why the round trip between client and server is apparently not happening on your end.
https://moodeaudio.org/forum/showthread....5#pid56595
Also turn on Debug logging in System Config because there are some debugLog() statements in that script that would log errors in the moode log if the playlist file could not be opened. Hi Tim,
Strange you cannot reproduce it. I can reproduce it on 3 different PIs and even on a fresh install. Did you follow the steps in the movie I sent you this morning?
I'll add the logging statements in playlist.php file.
Keep you posted.
Posts: 179
Threads: 8
Joined: Sep 2023
Reputation:
0
08-04-2024, 04:22 PM
(This post was last modified: 08-04-2024, 04:23 PM by kurt1970.)
hi @ Tim Curtis
I addedd the log statements and I switched on debug logging.
Below you see a sequence of here0 and here1. These are all attempts that failed because a radio station was playing when I updated a PL.
For the last attempt I first stopped the music and tried again. As explained in my video, this worked.
In summary, logging output is the same when it works or when it fails.
Can you point me to the code where the actual write to the PL file takes place and tell me where to put some logging statements?
20240804 181128 here0
20240804 181128 here1
20240804 181214 here0
20240804 181214 here1
20240804 181228 here0
20240804 181228 here1
20240804 181422 waitWorker(): Start sys-config, w_active=0
20240804 181422 waitWorker(): End sys-config, w_active=0
20240804 181458 here0
20240804 181458 here1
20240804 181522 here0
20240804 181522 here1
20240804 181537 here0
20240804 181537 here1
20240804 181545 here0
20240804 181545 here1
20240804 181607 here0
20240804 181607 here1
20240804 181616 here0
20240804 181616 here1
20240804 181624 here0
20240804 181624 here1
Posts: 13,396
Threads: 304
Joined: Mar 2018
Reputation:
543
If you added all 4 workerLog() statements then you should see 4 log entries if the script executed to completion.
here0
here1
here2
here3
Here's that code block again.
Code: case 'add_to_playlist':
$plName = html_entity_decode($_POST['path']['playlist']);
workerLog('here0);
// Get metadata (may not exist so defaults will be returned)
$plMeta = getPlaylistMetadata($plName);
workerLog('here1);
// Replace with URL if radio station
if (count($_POST['path']['items']) == 1 && substr($_POST['path']['items'][0], -4) == '.pls') {
$stName = substr($_POST['path']['items'][0], 6, -4); // Trim RADIO/ and .pls
$result = sqlQuery("SELECT station FROM cfg_radio WHERE name='" . SQLite3::escapeString($stName) . "'", sqlConnect());
$_POST['path']['items'][0] = $result[0]['station']; // URL
}
workerLog('here2);
.
.
.
workerLog('here3);
break;
Posts: 179
Threads: 8
Joined: Sep 2023
Reputation:
0
Hi @ Tim Curtis ,
Mistake on my side, as I didn't scroll through your code fragment. All logging statements are added now.
Test 1: A radio station is playing, and I try to add a radio station to a PL. Test failed. Following info in the log:
20240804 190728 here0
20240804 190728 here1
Test 2: No radio station is playing, and I try to add a radio station to a PL. Test passed. Following info in the log:
20240804 190940 here0
20240804 190940 here1
20240804 190940 here2
20240804 190943 here3
Posts: 179
Threads: 8
Joined: Sep 2023
Reputation:
0
08-04-2024, 05:36 PM
(This post was last modified: 08-04-2024, 05:38 PM by kurt1970.)
Hi @ Tim Curtis ,
I added some more logging in playlist.php. Now it looks like this:
Code: case 'upd_playlist':
$plName = html_entity_decode($_POST['path']['name']);
// Get metadata (may not exist so defaults will be returned)
$plMeta = getPlaylistMetadata($plName);
$updPlMeta = array('genre' => $_POST['path']['genre'], 'cover' => $plMeta['cover']);
$plItems = $_POST['path']['items'];
// Write metadata tags, contents and cover image
putPlaylistContents($plName, $updPlMeta, $plItems);
putPlaylistCover($plName);
break;
case 'add_to_playlist':
$plName = html_entity_decode($_POST['path']['playlist']);
workerLog('here0');
// Get metadata (may not exist so defaults will be returned)
$plMeta = getPlaylistMetadata($plName);
workerLog('here1');
// Replace with URL if radio station
if (count($_POST['path']['items']) == 1 && substr($_POST['path']['items'][0], -4) == '.pls') {
workerLog('here1.1');
$stName = substr($_POST['path']['items'][0], 6, -4); // Trim RADIO/ and .pls
workerLog('here1.2');
$result = sqlQuery("SELECT station FROM cfg_radio WHERE name='" . SQLite3::escapeString($stName) . "'", sqlConnect());
workerLog('here1.3');
$_POST['path']['items'][0] = $result[0]['station']; // URL
}
workerLog('here2');
// Write metadata tags, contents and cover image
putPlaylistMetadata($plName, array('#EXTGENRE:' . $plMeta['genre'], '#EXTIMG:' . $plMeta['cover']));
putPlaylistContents($plName, $plMeta, $_POST['path']['items'], FILE_APPEND);
putPlaylistCover($plName);
workerLog('here3');
break;
Test 1: A radio station is playing, and I try to add a radio station to a PL. Test failed. Following info in the log:
20240804 193502 here0
20240804 193502 here1
Test 2: No radio station is playing, and I try to add a radio station to a PL. Test passed. Following info in the log:
20240804 193533 here0
20240804 193533 here1
20240804 193533 here1.1
20240804 193533 here1.2
20240804 193533 here1.3
20240804 193533 here2
20240804 193536 here3
|