[GH-ISSUE #75] Mention kernel 3.9 is required #65

Closed
opened 2026-02-27 19:28:37 +03:00 by kerem · 12 comments
Owner

Originally created by @sashahilton00 on GitHub (Jan 29, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/75

Issue by Informatic
Saturday Jul 22, 2017 at 10:58 GMT
Originally opened as https://github.com/plietar/librespot/issues/226


Hey,
when trying to run a binary built with librespot-cross container on "legacy" (3.4) Allwinner H3 (OrangePi Zero) Linux Kernel I noticed it crashes with "Protocol not available" error when discovery is enabled. Sadly I don't have full error line, as I already resolved it and forgot to write it down.

This error is thrown when calling setsockopt with SO_REUSEPORT, which is only available since Linux Kernel 3.9 AFAIK. It'd be nice to mention it in README, or find some solution to disable that syscall or ignore that error on unsupported systems. I'm not a rust developer myself, so wasn't even able to find a module (crate?) it is actually called in ;)

Besides that everything works perfectly.

Originally created by @sashahilton00 on GitHub (Jan 29, 2018). Original GitHub issue: https://github.com/librespot-org/librespot/issues/75 <a href="https://github.com/Informatic"><img src="https://avatars2.githubusercontent.com/u/1131102?v=4" align="left" width="96" height="96" hspace="10"></img></a> **Issue by [Informatic](https://github.com/Informatic)** _Saturday Jul 22, 2017 at 10:58 GMT_ _Originally opened as https://github.com/plietar/librespot/issues/226_ ---- Hey, when trying to run a binary built with `librespot-cross` container on "legacy" (3.4) Allwinner H3 (OrangePi Zero) Linux Kernel I noticed it crashes with "`Protocol not available`" error when discovery is enabled. Sadly I don't have full error line, as I already resolved it and forgot to write it down. This error is thrown when calling `setsockopt` with `SO_REUSEPORT`, which is only available since Linux Kernel 3.9 AFAIK. It'd be nice to mention it in `README`, or find some solution to disable that syscall or ignore that error on unsupported systems. I'm not a rust developer myself, so wasn't even able to find a module (crate?) it is actually called in ;) Besides that everything works perfectly.
kerem 2026-02-27 19:28:37 +03:00
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by bjoerns1983
Tuesday Aug 15, 2017 at 13:16 GMT


You saved my day, tried to use librespot on an OrangePi Zero which only has a Legacy Kernel and was wondering we it does not work

<!-- gh-comment-id:361275421 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/bjoerns1983"><img src="https://avatars3.githubusercontent.com/u/424566?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [bjoerns1983](https://github.com/bjoerns1983)** _Tuesday Aug 15, 2017 at 13:16 GMT_ ---- You saved my day, tried to use librespot on an OrangePi Zero which only has a Legacy Kernel and was wondering we it does not work
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by bjoerns1983
Thursday Aug 17, 2017 at 13:54 GMT


The complete error line is this:
INFO:librespot: librespot ddfc28f (2017-08-04). Built on 2017-08-07. Build ID: N5RcEuis thread 'main' panicked at 'called Result::unwrap()on anErrvalue: Error { repr: Os { code: 92, message: "Protocol not available" } }', /checkout/src/libcore/result.rs:860 note: Run withRUST_BACKTRACE=1 for a backtrace.

@Informatic how did you solve this, i have the same hardware here an would love to have librespot running on it

<!-- gh-comment-id:361275442 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/bjoerns1983"><img src="https://avatars3.githubusercontent.com/u/424566?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [bjoerns1983](https://github.com/bjoerns1983)** _Thursday Aug 17, 2017 at 13:54 GMT_ ---- The complete error line is this: `INFO:librespot: librespot ddfc28f (2017-08-04). Built on 2017-08-07. Build ID: N5RcEuis thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 92, message: "Protocol not available" } }', /checkout/src/libcore/result.rs:860 note: Run with `RUST_BACKTRACE=1` for a backtrace.` @Informatic how did you solve this, i have the same hardware here an would love to have librespot running on it
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by Informatic
Thursday Aug 17, 2017 at 15:14 GMT


I just upraded my box to mainline kernel. I've been using Armbian, so all I needed to do was just install following packages: linux-image-dev-sun8i linux-headers-dev-sun8i linux-u-boot-orangepipc-dev linux-jessie-root-dev-orangepipc linux-dtb-dev-sun8i (keep in mind video and some other minor peripherals are not supported in mainline yet, look this stuff up on Armbian forums, as this is not really a proper place for that...)

<!-- gh-comment-id:361275465 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/Informatic"><img src="https://avatars2.githubusercontent.com/u/1131102?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [Informatic](https://github.com/Informatic)** _Thursday Aug 17, 2017 at 15:14 GMT_ ---- I just upraded my box to mainline kernel. I've been using Armbian, so all I needed to do was just install following packages: ` linux-image-dev-sun8i linux-headers-dev-sun8i linux-u-boot-orangepipc-dev linux-jessie-root-dev-orangepipc linux-dtb-dev-sun8i` (keep in mind video and some other minor peripherals are not supported in mainline yet, look this stuff up on Armbian forums, as this is not really a proper place for that...)
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by djsuszi
Sunday Sep 03, 2017 at 18:39 GMT


Can't it be used without SO_REUSEPORT ?
new dev kernels can have some issues,

On old kernel it's working with --disable-discovery and registering with user/password.

<!-- gh-comment-id:361275486 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/djsuszi"><img src="https://avatars3.githubusercontent.com/u/20277627?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [djsuszi](https://github.com/djsuszi)** _Sunday Sep 03, 2017 at 18:39 GMT_ ---- Can't it be used without SO_REUSEPORT ? new dev kernels can have some issues, On old kernel it's working with --disable-discovery and registering with user/password.
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by montvid
Thursday Sep 07, 2017 at 11:50 GMT


@herrernst I would like to reopen the problem - It is a big problem for most of the ARM users! Most of ARM users have old kernels like 3.0 and 3.4. I was able to compile librespot fine on armhf 3.4 kernel but I get @bjoerns1983 mentioned error while trying to run librespot with discovery enabled. Please try to change the code to support old ARM devices because I am trying to find a use for old phones with good DAC i.e. samsung galaxy s 2 kernel 3.0, lg g2 3.4 kernel running librespot in linux chroot etc.

<!-- gh-comment-id:361275512 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/montvid"><img src="https://avatars0.githubusercontent.com/u/23270059?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [montvid](https://github.com/montvid)** _Thursday Sep 07, 2017 at 11:50 GMT_ ---- @herrernst I would like to reopen the problem - It is a big problem for most of the ARM users! Most of ARM users have old kernels like 3.0 and 3.4. I was able to compile librespot fine on armhf 3.4 kernel but I get @bjoerns1983 mentioned error while trying to run librespot with discovery enabled. Please try to change the code to support old ARM devices because I am trying to find a use for old phones with good DAC i.e. samsung galaxy s 2 kernel 3.0, lg g2 3.4 kernel running librespot in linux chroot etc.
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by jr01
Saturday Sep 16, 2017 at 12:00 GMT


@Informatic - I found that the reuse_port is used in rust-mdns address_family.rs - if I comment out line 15 and cargo build (I am using spotty) on my ARM with kernel 2.6 then discovery works.

<!-- gh-comment-id:361275539 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/jr01"><img src="https://avatars2.githubusercontent.com/u/2624681?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [jr01](https://github.com/jr01)** _Saturday Sep 16, 2017 at 12:00 GMT_ ---- @Informatic - I found that the reuse_port is used in rust-mdns [address_family.rs](https://github.com/plietar/rust-mdns/blob/master/src/address_family.rs) - if I comment out line 15 and cargo build (I am using [spotty](https://github.com/michaelherger/spotty)) on my ARM with kernel 2.6 then discovery works.
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by montvid
Saturday Sep 16, 2017 at 12:16 GMT


Thanks @jr01 for your research. Could you do a code contribution via pull request - maybe this way it would be fixed sooner? :) I love that Librespot is just 12.8MB of ram and spotify is like more than 200MB!

<!-- gh-comment-id:361275567 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/montvid"><img src="https://avatars0.githubusercontent.com/u/23270059?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [montvid](https://github.com/montvid)** _Saturday Sep 16, 2017 at 12:16 GMT_ ---- Thanks @jr01 for your research. Could you do a code contribution via pull request - maybe this way it would be fixed sooner? :) I love that Librespot is just 12.8MB of ram and spotify is like more than 200MB!
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by jr01
Saturday Sep 16, 2017 at 13:37 GMT


I could do that, but I am not a rust developer and I am very unsure if the change is correct and what side effects it may have. Maybe @plietar can help?

<!-- gh-comment-id:361275602 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/jr01"><img src="https://avatars2.githubusercontent.com/u/2624681?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [jr01](https://github.com/jr01)** _Saturday Sep 16, 2017 at 13:37 GMT_ ---- I could do that, but I am not a rust developer and I am very unsure if the change is correct and what side effects it may have. Maybe @plietar can help?
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by bjoerns1983
Saturday Oct 28, 2017 at 19:55 GMT


Tried the workaround of jr01 and it works for me, no negative side effects till now. Struggled a bit till i compiled a patched version but i made a guide if somebody also wants to try:
Compile Librespot for Orange Pi
Asking myself if reuse_port is really neccessary here.

<!-- gh-comment-id:361275628 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/bjoerns1983"><img src="https://avatars3.githubusercontent.com/u/424566?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [bjoerns1983](https://github.com/bjoerns1983)** _Saturday Oct 28, 2017 at 19:55 GMT_ ---- Tried the workaround of jr01 and it works for me, no negative side effects till now. Struggled a bit till i compiled a patched version but i made a guide if somebody also wants to try: [Compile Librespot for Orange Pi](https://blog.sengotta.net/how-to-compile-librespot-for-orange-pi-or-kernel-prior-3-9/) Asking myself if reuse_port is really neccessary here.
Author
Owner

@ComlOnline commented on GitHub (Jan 29, 2018):

May be worth just putting in the wiki as a note at the very least.

<!-- gh-comment-id:361352148 --> @ComlOnline commented on GitHub (Jan 29, 2018): May be worth just putting in the wiki as a note at the very least.
Author
Owner

@ComlOnline commented on GitHub (Jan 31, 2018):

Hi @bjoerns1983, I have updated your guide and you can find it here. Before I add to to the wiki sidebar I wanted to make sure this was OK with you?

<!-- gh-comment-id:362073839 --> @ComlOnline commented on GitHub (Jan 31, 2018): Hi @bjoerns1983, I have updated your guide and you can find it [here](https://github.com/librespot-org/librespot/wiki/Compile-librespot-for-kernel-prior-3.9). Before I add to to the wiki sidebar I wanted to make sure this was OK with you?
Author
Owner

@sashahilton00 commented on GitHub (Feb 6, 2018):

Haven't heard anything, so have added this to the sidebar. If the original author has a problem with us adding this to the wiki, mention me and we'll resolve this issue another way. Marking as solved for now.

<!-- gh-comment-id:363530184 --> @sashahilton00 commented on GitHub (Feb 6, 2018): Haven't heard anything, so have added this to the sidebar. If the original author has a problem with us adding this to the wiki, mention me and we'll resolve this issue another way. Marking as solved for now.
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#65
No description provided.