Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
translations translations
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Playlists: show #EXTM3U text?
« previous next »
  • Print
Pages: [1]

Author Topic: Playlists: show #EXTM3U text?  (Read 1673 times)

Offline raffraffraff

  • Member
  • *
  • Posts: 7
Playlists: show #EXTM3U text?
« on: February 26, 2022, 05:19:54 PM »
About a month ago I revived a Shanling Q1 with Rockbox. Great! But I was kinda shocked to see playlists only show the track name. While sourcing artist + title from tracks metadata is obviously a daft idea on most devices, surely it isn't hard to show #EXTM3U data if it's already present in the file?

Code: [Select]
#EXTINF:246,Soundgarden - Spoonman
\Music\Soundgarden\Superunknown\Spoonman.mp3
#EXTINF:309,The Who - Baba O'Riley
\Music\The Who\Who's Next\Baba O'Riley.mp3
#EXTINF:427,dEUS - Bad Timing
\Music\dEUS\Pocket Revolution\Bad Timing.mp3

So, gimme everything after the comma! This feature requests was mentioned on the forum in 2006: https://forums.rockbox.org/index.php?topic=6438.0
Someone even pushed a patch for this back in 2007, but presumably the code has moved on significantly since then (or maybe not?): https://www.rockbox.org/tracker/task/7652

I'm surprised that more people don't want to see artist and track name in playlists
« Last Edit: February 27, 2022, 10:58:51 AM by raffraffraff »
Logged

Online 7o9

  • Member
  • *
  • Posts: 173
Re: Playlists: show #EXTM3U text?
« Reply #1 on: February 27, 2022, 01:02:20 AM »
Why is sourcing artist + title from tracks metadata a daft idea?

Track metadata seems an excellent source for this kind of information. You have dedicated metadata fields that are very convenient. #EXTM3U requires additional parsing.

Personally I do not see the value at all of having #EXTM3U data in playlist files.
Logged

Offline raffraffraff

  • Member
  • *
  • Posts: 7
Re: Playlists: show #EXTM3U text?
« Reply #2 on: February 27, 2022, 10:31:53 AM »
Quote
Why is sourcing artist + title from tracks metadata a daft idea?

Take this with a pinch of salt because I'm no rockbox expert. But the slowest component in pretty much any computer system is storage, even a computer with a super fast SSD. Disks are orders of magnitude slower than anything else. On my MP3 player, the SD card performance is gonna be terrible. Therefore my goal is to reduce disk IO as much as possible. Let's compare the two methods after we copy a new 1000 track playlist to a rockbox:

1. You load the .m3u file (100kb = 1000 tracks with #EXTM3U data). Now that it's in memory, you can parse it quickly in memory. The string you wish to show is right there above the file path.

2. You load the .m3u file (50kb = 1000 tracks without #EXTM3U data). Now it's in memory, but that's no good because you have to look up artist and title in the ID3 tags of every file in the playlist. You can try to load 1000 of them when the playlist is opened, or you could optimize it so you only perform lookups for the tracks shown on screen, and lazy-load the rest as you very slowly scroll. Bare in mind that you'll be hitting that crappy SD card with a lot of reads every time you open a playlist or scroll up and down. Each MP3 file is, what, at least 3mb in size? Again, you can probably optimize the file reads to grab the header data if it's positioned right at the start of the track. But you have to detect the type and version of each tag (eg: ID3v1, ID3v2.4 etc). So how is parsing ID3 tag data from each MP3 file any easier than parsing the plain-text "Artist - Title" string right out of the #EXTM3U text in the playlist (which is already in memory), aside from the disk IO overhead?

Perhaps there's some option to use the Rockbox Database. I personally don't bother with the database, so I don't know what its data structure is. But even still, you need to load the .m3u playlist and then perform database lookups for every track using the filename as a lookup key. Bare in mind that there may be some file path conversion to do, because the .m3u is probably using relative paths and the database may not. There may be a need to do some file path conversion (eg: changing delimiters from '\' to '/' or whatever)
Logged

Offline raffraffraff

  • Member
  • *
  • Posts: 7
Re: Playlists: show #EXTM3U text?
« Reply #3 on: February 27, 2022, 10:58:23 AM »
For anyone else wondering, the 2007 patch that intended to bring EXTM3U data to the playlist viewer doesn't can't be applied directly to the latest Rockbox source code. But it's an amazingly simple thing to modify it to work - the surrounding code is practically unchanged in over 14 years! Unfortunately, the feature doesn't work, even after I enable it in the settings. I might dig in later to figure out why, since I've got the build tools and source code on my laptop. If anyone's interested in the patched source, I can push it to github.

For now I've changed my playlist view settings to show the full path. Not great, but better than nothing.
« Last Edit: February 27, 2022, 11:01:20 AM by raffraffraff »
Logged

Offline Frankenpod

  • Member
  • *
  • Posts: 798
Re: Playlists: show #EXTM3U text?
« Reply #4 on: February 27, 2022, 02:39:13 PM »
I think that option to show the full path (which will show you the artist/album, if your music is organised that way) was itself only added very recently.  At the time I thought that change would do what you originally asked about, but turned out it wasn't doing that.
I think I agree with your reasoning about using EXTINF vs tag information.  Be good if someone could get that patch working.  I'm not in a position to do anything with the rockbox code so all I can do is agree with you that it would be nice if someone else could do it!

(not only do I lack expertise but my linux machine is currently not in working condition).
Logged

Online 7o9

  • Member
  • *
  • Posts: 173
Re: Playlists: show #EXTM3U text?
« Reply #5 on: February 27, 2022, 02:47:14 PM »
Quote from: raffraffraff on February 27, 2022, 10:31:53 AM
... So how is parsing ID3 tag data from each MP3 file any easier than parsing the plain-text "Artist - Title" string right out of the #EXTM3U text in the playlist ...

You have some reasonable arguments in your second and third post. Much better than calling the people you need to address your concerns 'daft'.

Parsing the #EXTM3U would be more efficient than reading metadata from each file, that makes sense.

But reading the metadata already works and exists so in that sense adding the parsing of the #EXTM3U data is more work, not in the last place because that patch does not work yet.

I also think many more people have metadata in files than #EXTM3U info in their playlists, but that is mostly a feeling. Having both options would be good, no argument there.
Logged

Offline Frankenpod

  • Member
  • *
  • Posts: 798
Re: Playlists: show #EXTM3U text?
« Reply #6 on: February 27, 2022, 03:34:10 PM »
Quote from: 7o9 on February 27, 2022, 02:47:14 PM
I also think many more people have metadata in files than #EXTM3U info in their playlists, but that is mostly a feeling. Having both options would be good, no argument there.

I dunno, that data is in all my playlists, as exported from mediamonkey.  I suspect any media manager will have the option to include it in exported playlists. 
Logged

Offline raffraffraff

  • Member
  • *
  • Posts: 7
Re: Playlists: show #EXTM3U text?
« Reply #7 on: February 27, 2022, 03:50:42 PM »
Quote
Much better than calling the people you need to address your concerns 'daft'.

I don't know where you got that idea. You're taking offense on behalf of people who I did not offend - because as far as I know, nobody ever made the suggestion to source playlist viewer data from ID3 tags. I was simply prefacing my feature request with my opinion that it would be a daft idea to use tags if #EXTM3U data was already loaded in memory.

EDIT: Never mind, I re-read my post and it wasn't 100% clear that I was talking about using ID3 tags for this specific purpose.
« Last Edit: February 27, 2022, 04:05:13 PM by raffraffraff »
Logged

Offline amachronic

  • Developer
  • Member
  • *
  • Posts: 306
Re: Playlists: show #EXTM3U text?
« Reply #8 on: February 28, 2022, 07:36:16 AM »
Quote from: raffraffraff on February 27, 2022, 10:58:23 AM
I might dig in later to figure out why, since I've got the build tools and source code on my laptop. If anyone's interested in the patched source, I can push it to github.

If / when you get it working, I'd be happy to merge this. Just seeing the filename has always bugged me! BTW, it's quite easy to push patches to gerrit - you can sign in with github, then you just have to add your public key. More info if you are interested: https://www.rockbox.org/wiki/UsingGit.

The option to use the database is not a bad idea. If you have the database loaded to RAM then you have the information in memory anyway, just like with extm3u. I agree it'd be horrifically slow if you're just using the on-disk database, or tried to read it directly from the files.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Playlists: show #EXTM3U text?
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.244 seconds with 22 queries.