If you play a song 2x in a row, it can be that the cache is not readable. librespot gives an IOException. So the cache is not used and fetches the chunk again from the server?
ERROR CdnManager:313 - Failed requesting chunk from cache, index: 4
java.io.IOException: Stream Closed
at java.io.RandomAccessFile.length(Native Method) ~[?:?]
at xyz.gianlu.librespot.cache.CacheManager$Handler.hasChunk(CacheManager.java:216) ~[librespot-api-1.6.1.jar:1.6.1]
at xyz.gianlu.librespot.audio.cdn.CdnManager$Streamer.requestChunk(CdnManager.java:308) ~[librespot-api-1.6.1.jar:1.6.1]
at xyz.gianlu.librespot.audio.cdn.CdnManager$Streamer.access$1500(CdnManager.java:198) ~[librespot-api-1.6.1.jar:1.6.1]
at xyz.gianlu.librespot.audio.cdn.CdnManager$Streamer$InternalStream.lambda$requestChunkFromStream$0(CdnManager.java:398) ~[librespot-api-1.6.1.jar:1.6.1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
at java.lang.Thread.run(Thread.java:831) [?:?]
If you play a song 2x in a row, it can be that the cache is not readable. librespot gives an IOException. So the cache is not used and fetches the chunk again from the server?
ERROR CdnManager:313 - Failed requesting chunk from cache, index: 4
java.io.IOException: Stream Closed
at java.io.RandomAccessFile.length(Native Method) ~[?:?]
at xyz.gianlu.librespot.cache.CacheManager$Handler.hasChunk(CacheManager.java:216) ~[librespot-api-1.6.1.jar:1.6.1]
at xyz.gianlu.librespot.audio.cdn.CdnManager$Streamer.requestChunk(CdnManager.java:308) ~[librespot-api-1.6.1.jar:1.6.1]
at xyz.gianlu.librespot.audio.cdn.CdnManager$Streamer.access$1500(CdnManager.java:198) ~[librespot-api-1.6.1.jar:1.6.1]
at xyz.gianlu.librespot.audio.cdn.CdnManager$Streamer$InternalStream.lambda$requestChunkFromStream$0(CdnManager.java:398) ~[librespot-api-1.6.1.jar:1.6.1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
at java.lang.Thread.run(Thread.java:831) [?:?]