Comments (8)
It is using a background thread, I just would rather openly indicate that Auxio is loading rather than quietly do it and have items wildly jump around for around a minute.
How big is the cover art that you use? Auxio tends to choke and timeout on very huge (1000x1000x+) album art since reading file data is very slow on modern android. When it timeouts, it ends up being unable to cache anything to speed up subsequent loading. I'd highly recommend shrinking your cover art.
from auxio.
I've decided to turn off the timeout system @SEAPUNK given that no matter how much I adjust it I doubt it'll work. Will probably show up in 3.5.0.
from auxio.
Still, I don't have this issue on other music players. I just installed Poweramp and tested this on the same folder - not only did Poweramp scan the entire library within 10 seconds (compared to Auxio, which takes almost a full minute), it did it all in the background, so I could still listen to music as it did it, even if it lagged during the process.
My best guess as to what's going on, after comparing the two:
Poweramp appears to lazily load the album art. I dont think it cares about what the album art for the songs are at library scan, and it tries to load it as I scroll through the library. I also noticed that Auxio, in a folder of many different songs, is using the same album art for every song in there, presumably by looking for an album art image in the folder, and applying the first one to all of them. It just so happens to be that the first match is a 950x950 1.8MB PNG file, which probably contributes to the slowdown.
So aside from album art being scanned and applied incorrectly for the music (the files already have the album art embedded in them, so I'm not sure how it's determining what the album art for the song should be), it probably is prematurely caring about the album art as well. Maybe Poweramp also optimizes by reading the file in a way where it skips over the part where the album art data is, I'm unfamiliar with Android development and what's possible with it.
from auxio.
I just would rather openly indicate that Auxio is loading rather than quietly do it and have items wildly jump around for around a minute
Does it really have to update the UI in realtime? Why not just show the stale library as it refreshes in the background, applying the changes all at once when it's done? Hell, maybe even on an interval to reduce how often things jump around?
from auxio.
Still, I don't have this issue on other music players. I just installed Poweramp and tested this on the same folder - not only did Poweramp scan the entire library within 10 seconds (compared to Auxio, which takes almost a full minute), it did it all in the background, so I could still listen to music as it did it, even if it lagged during the process.
Poweramp appears to lazily load the album art. I dont think it cares about what the album art for the songs are at library scan, and it tries to load it as I scroll through the library. I also noticed that Auxio, in a folder of many different songs, is using the same album art for every song in there, presumably by looking for an album art image in the folder, and applying the first one to all of them. It just so happens to be that the first match is a 950x950 1.8MB PNG file, which probably contributes to the slowdown.
Poweramp is paid with a full-time developer to basically build an entire audio stack from ground-up. I have to use limited off-the-shelf components, everything I do is a hobby, and I can go weeks without the time to make single-line changes.
Poweramp probably has:
- A full self-rolled native tag extraction stack with low-level workarounds to the horrible post-scoped storage APIs that add artifical delay to every file read for """"""security""""" (read: google doesnt want me using local storage). I have media3, which is slower, maintained passively by google, and requires drastic patches to even do simple versions of the same optimizations you want.
- A full image cache implementation that allows instant cover art loading, likely with it's own deferred pipeline that does further background processing while you aren't looking.//
- Dynamic tag management that likely allows them to skip any cover art loading. I would have to probably make an insanely complicated vendor patch wrecking dozens of systems my end to do the same.
The size of these efforts are extreme for me currently. They would require multiple cross-dependency patches and whole new systems to be built out and likely around +5kloc of changes, and I am managing dozens of other active issues on my limited time. It is NOT as simple as it seems. There is a reason why Poweramp costs money.
Does it really have to update the UI in realtime? Why not just show the stale library as it refreshes in the background, applying the changes all at once when it's done? Hell, maybe even on an interval to reduce how often things jump around?
This would up the complexity to an extreme amount and be slower than right now as it means a total relayout and player reload multiple times. Try using vinyl music player (which does this) and have a great time as the app becomes completely and totally unusable for 3 minutes when it reloads the library.
from auxio.
Reopening to track the optimization you proposed anyway. It will simply take a long time.
from auxio.
That's fine, no rush. I understand that this is an OSS project, and if I would help if I had the time to dig into this myself. I appreciate that a project like this exists. :)
from auxio.
Just looked into it and it seems like ExoPlayer does dynamically do file reads up until it reads metadata, in which it just reads out everything into memory and decodes it from there. No wonder it's so in-efficient. If I make the reads on-demand and dynamically toggle images, it would allow me to avoid image loading I think.
from auxio.
Related Issues (20)
- Add a sleep timer HOT 1
- Show repeat and shuffle in android auto
- Add some e-mail/website/contact/feedback handle from within the app HOT 1
- Bookmark timestamps on the songs' timeline UI, so that user can get back quickly to banger moments :100: HOT 3
- Disable repeat when playing an entire album/artist HOT 11
- Offer "Folders" view tab when "Include folders" option is used HOT 4
- "Hide collaborators" doesn't work for mp3 files HOT 7
- read Embedded lyrics HOT 1
- Add support for webp in covers lookup (the app already supports decoding them) HOT 1
- Start playing when song in queue is selected HOT 2
- Albums/Artists Missing on Android Auto HOT 14
- Make Android Auto library reflect app library HOT 1
- Revert to legacy media for Android Auto HOT 1
- Android 15 HOT 1
- Add menus to Android Auto HOT 1
- Use fuzzy search ordering HOT 3
- Ability to remove songs from a playlist only HOT 1
- Playback state not retained after app is swiped away or device rebooted HOT 3
- 360 reality audio file hangs playback requiring force stop HOT 1
- Support `.m4b` audio formats HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auxio.