Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention kernel 3.9 is required #226

Open
Informatic opened this issue Jul 22, 2017 · 10 comments

Comments

@Informatic
Copy link

commented Jul 22, 2017

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.

@bjoerns1983

This comment has been minimized.

Copy link

commented Aug 15, 2017

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

@bjoerns1983

This comment has been minimized.

Copy link

commented Aug 17, 2017

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

@Informatic

This comment has been minimized.

Copy link
Author

commented Aug 17, 2017

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...)

@djsuszi

This comment has been minimized.

Copy link

commented Sep 3, 2017

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.

@montvid

This comment has been minimized.

Copy link

commented Sep 7, 2017

@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.

@jr01

This comment has been minimized.

Copy link

commented Sep 16, 2017

@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.

@montvid

This comment has been minimized.

Copy link

commented Sep 16, 2017

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!

@jr01

This comment has been minimized.

Copy link

commented Sep 16, 2017

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?

@bjoerns1983

This comment has been minimized.

Copy link

commented Oct 28, 2017

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.

@sashahilton00

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2018

Issue migrated to librespot-org/issue-test#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.