[GH-ISSUE #4] Add UI to example activity #2

Closed
opened 2026-02-28 14:23:57 +03:00 by kerem · 8 comments
Owner

Originally created by @devgianlu on GitHub (Apr 25, 2021).
Original GitHub issue: https://github.com/devgianlu/librespot-android/issues/4

  • Login UI
  • Play from Uri
  • Play/pause/next/prev
Originally created by @devgianlu on GitHub (Apr 25, 2021). Original GitHub issue: https://github.com/devgianlu/librespot-android/issues/4 - [x] Login UI - [x] Play from Uri - [x] Play/pause/next/prev
kerem 2026-02-28 14:23:57 +03:00
Author
Owner

@mitschwimmer commented on GitHub (May 1, 2021):

Hey @devgianlu, amazing to see what you are achieving here!
Still, there seems to be an issue left with tremolo on the master branch. Once I see the player UI I can't actually play a track. I get this error:

2021-05-01 07:28:25.826 9374-9420/xyz.gianlu.librespot.android E/brespot.androi: No implementation found for long xyz.gianlu.librespot.player.decoders.tremolo.OggDecodingInputStream.initDecoder(java.nio.ByteBuffer) (tried Java_xyz_gianlu_librespot_player_decoders_tremolo_OggDecodingInputStream_initDecoder and Java_xyz_gianlu_librespot_player_decoders_tremolo_OggDecodingInputStream_initDecoder__Ljava_nio_ByteBuffer_2)
2021-05-01 07:28:25.827 9374-9420/xyz.gianlu.librespot.android E/x.g.l.a.d.Decoders: Failed initializing Codec instance for VORBIS
    java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
        at xyz.gianlu.librespot.audio.decoders.Decoders.initDecoder(Decoders.java:54)
        at xyz.gianlu.librespot.player.playback.PlayerQueueEntry.load(PlayerQueueEntry.java:140)
        at xyz.gianlu.librespot.player.playback.PlayerQueueEntry.run(PlayerQueueEntry.java:271)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: java.lang.UnsatisfiedLinkError: No implementation found for long xyz.gianlu.librespot.player.decoders.tremolo.OggDecodingInputStream.initDecoder(java.nio.ByteBuffer) (tried Java_xyz_gianlu_librespot_player_decoders_tremolo_OggDecodingInputStream_initDecoder and Java_xyz_gianlu_librespot_player_decoders_tremolo_OggDecodingInputStream_initDecoder__Ljava_nio_ByteBuffer_2)
        at xyz.gianlu.librespot.player.decoders.tremolo.OggDecodingInputStream.initDecoder(Native Method)
        at xyz.gianlu.librespot.player.decoders.tremolo.OggDecodingInputStream.<init>(OggDecodingInputStream.java:36)
        at xyz.gianlu.librespot.player.decoders.TremoloVorbisCodec.<init>(TremoloVorbisCodec.java:20)
        at java.lang.reflect.Constructor.newInstance0(Native Method) 
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
        at xyz.gianlu.librespot.audio.decoders.Decoders.initDecoder(Decoders.java:54) 
        at xyz.gianlu.librespot.player.playback.PlayerQueueEntry.load(PlayerQueueEntry.java:140) 
        at xyz.gianlu.librespot.player.playback.PlayerQueueEntry.run(PlayerQueueEntry.java:271) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:923) 
2021-05-01 07:28:25.827 9374-9420/xyz.gianlu.librespot.android E/x.g.l.p.Player: Failed loading track.
    java.io.UnsupportedEncodingException: VORBIS
        at xyz.gianlu.librespot.player.playback.PlayerQueueEntry.load(PlayerQueueEntry.java:142)
        at xyz.gianlu.librespot.player.playback.PlayerQueueEntry.run(PlayerQueueEntry.java:271)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)

I am testing on a Pixel 3aXL with Android 11. What do you think, should I open a new issue for that?

<!-- gh-comment-id:830552502 --> @mitschwimmer commented on GitHub (May 1, 2021): Hey @devgianlu, amazing to see what you are achieving here! Still, there seems to be an issue left with tremolo on the master branch. Once I see the player UI I can't actually play a track. I get this error: ```java 2021-05-01 07:28:25.826 9374-9420/xyz.gianlu.librespot.android E/brespot.androi: No implementation found for long xyz.gianlu.librespot.player.decoders.tremolo.OggDecodingInputStream.initDecoder(java.nio.ByteBuffer) (tried Java_xyz_gianlu_librespot_player_decoders_tremolo_OggDecodingInputStream_initDecoder and Java_xyz_gianlu_librespot_player_decoders_tremolo_OggDecodingInputStream_initDecoder__Ljava_nio_ByteBuffer_2) 2021-05-01 07:28:25.827 9374-9420/xyz.gianlu.librespot.android E/x.g.l.a.d.Decoders: Failed initializing Codec instance for VORBIS java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at xyz.gianlu.librespot.audio.decoders.Decoders.initDecoder(Decoders.java:54) at xyz.gianlu.librespot.player.playback.PlayerQueueEntry.load(PlayerQueueEntry.java:140) at xyz.gianlu.librespot.player.playback.PlayerQueueEntry.run(PlayerQueueEntry.java:271) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) Caused by: java.lang.UnsatisfiedLinkError: No implementation found for long xyz.gianlu.librespot.player.decoders.tremolo.OggDecodingInputStream.initDecoder(java.nio.ByteBuffer) (tried Java_xyz_gianlu_librespot_player_decoders_tremolo_OggDecodingInputStream_initDecoder and Java_xyz_gianlu_librespot_player_decoders_tremolo_OggDecodingInputStream_initDecoder__Ljava_nio_ByteBuffer_2) at xyz.gianlu.librespot.player.decoders.tremolo.OggDecodingInputStream.initDecoder(Native Method) at xyz.gianlu.librespot.player.decoders.tremolo.OggDecodingInputStream.<init>(OggDecodingInputStream.java:36) at xyz.gianlu.librespot.player.decoders.TremoloVorbisCodec.<init>(TremoloVorbisCodec.java:20) at java.lang.reflect.Constructor.newInstance0(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:343)  at xyz.gianlu.librespot.audio.decoders.Decoders.initDecoder(Decoders.java:54)  at xyz.gianlu.librespot.player.playback.PlayerQueueEntry.load(PlayerQueueEntry.java:140)  at xyz.gianlu.librespot.player.playback.PlayerQueueEntry.run(PlayerQueueEntry.java:271)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)  at java.lang.Thread.run(Thread.java:923)  2021-05-01 07:28:25.827 9374-9420/xyz.gianlu.librespot.android E/x.g.l.p.Player: Failed loading track. java.io.UnsupportedEncodingException: VORBIS at xyz.gianlu.librespot.player.playback.PlayerQueueEntry.load(PlayerQueueEntry.java:142) at xyz.gianlu.librespot.player.playback.PlayerQueueEntry.run(PlayerQueueEntry.java:271) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) ``` I am testing on a Pixel 3aXL with Android 11. What do you think, should I open a new issue for that?
Author
Owner

@devgianlu commented on GitHub (May 1, 2021):

That's strange, it's complaining about a missing native method, but it's there.

Maybe @funtax knows more

<!-- gh-comment-id:830560486 --> @devgianlu commented on GitHub (May 1, 2021): That's strange, it's complaining about a missing native method, but it's there. Maybe @funtax knows more
Author
Owner

@funtax commented on GitHub (May 1, 2021):

This happens because the package of the decoder has changed. The native code is still targeting the old package/class Java_xyz_gianlu_librespot_player_codecs_tremolo_OggDecodingInputStream.

I will try to fix this later and provide a new compiled version.

<!-- gh-comment-id:830561893 --> @funtax commented on GitHub (May 1, 2021): This happens because the package of the decoder has changed. The native code is still targeting the old package/class Java_xyz_gianlu_librespot_player_codecs_tremolo_OggDecodingInputStream. I will try to fix this later and provide a new compiled version.
Author
Owner

@devgianlu commented on GitHub (May 1, 2021):

Oh right, I renamed it because the terminology codec was wrong (and it has been for way too long) and this was the right time to change it.

Thank you for looking into it

<!-- gh-comment-id:830562652 --> @devgianlu commented on GitHub (May 1, 2021): Oh right, I renamed it because the terminology `codec` was wrong (and it has been for way too long) and this was the right time to change it. Thank you for looking into it
Author
Owner

@funtax commented on GitHub (May 1, 2021):

@devgianlu Could you give me write-access to this repo? Then I don't have to open a PR for such minor changes.

<!-- gh-comment-id:830577778 --> @funtax commented on GitHub (May 1, 2021): @devgianlu Could you give me write-access to this repo? Then I don't have to open a PR for such minor changes.
Author
Owner

@devgianlu commented on GitHub (May 1, 2021):

@funtax Invited you

<!-- gh-comment-id:830593502 --> @devgianlu commented on GitHub (May 1, 2021): @funtax Invited you
Author
Owner

@funtax commented on GitHub (May 1, 2021):

Perfect, thank you @devgianlu .
@mitschwimmer I have updated the native library but not tested it yet. Feel free to update and give it another try.

<!-- gh-comment-id:830610239 --> @funtax commented on GitHub (May 1, 2021): Perfect, thank you @devgianlu . @mitschwimmer I have updated the native library but not tested it yet. Feel free to update and give it another try.
Author
Owner

@mitschwimmer commented on GitHub (May 1, 2021):

@funtax, @devgianlu just tried it. Works great 🕺

<!-- gh-comment-id:830632317 --> @mitschwimmer commented on GitHub (May 1, 2021): @funtax, @devgianlu just tried it. Works great :man_dancing:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot-android#2
No description provided.