Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Upcoming moOde 6.5.0
#11
Hi Tim

I have just recently started building programs on a Raspberry Pi 4 that are also meant to work on the Pi Zero. All I have been doing is including the following in CPPFLAGS

Code:
-march=armv6 -mfpu=vfp

I know some people use additional flags, but I haven't investigated which flags are necessary (depending on the program) and which are optimisations.

Adrian.
Reply
#12
Right except that lbrespot is written in Rust and not C. It's built using Cargo which invokes the Rust compiler. I imagine there are some flags for specifying the target architecture but it would take someone with Rust experience to know what they are and which ones to use.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#13
(02-19-2020, 12:35 PM)Tim Curtis Wrote: Right except that lbrespot is written in Rust and not C. It's built using Cargo which invokes the Rust compiler. I imagine there are some flags for specifying the target architecture but it would take someone with Rust experience to know what they are and which ones to use.

[Full disclosure - I haven't tried this yet]

https://github.com/japaric/rust-cross

and this issue explicitly saying cross-compiling to arm6 can be made to work: https://github.com/japaric/rust-cross/issues/42

Regards,
Kent
Reply
#14
@Tim Curtis

More updates to our curated radio stations. (Caveat - the Swedish Classic Radio URL may not be the most general form - streamers do curious things balancing across multiple servers - but it works for me.)

JB Radio-2 USA (320K): 
Code:
http://cristina.torontocast.com:8007/mp3-320

Swedish Classic Radio: 
Code:
https://live-cdn.sr.se/pool2/p2musik/p2musik.isml/p2musik-audio=192000.m3u8

WBJC Baltimore 91.5 - Classical: new URL 
Code:
http://wbjc-ice.streamguys1.com:80/live


----

Not working (here in USA/MD) and I haven't had time to find alternatives

Amys FM (320K)
Amys FM Spirit of Soul (320K)
Radio Monash
Rinse FM
VRT - Sporza [seriously? A sports station?]

Regards,
Kent
Reply
#15
Thanks. I'll incorporate into 6.5.0
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#16
(02-19-2020, 12:58 PM)TheOldPresbyope Wrote:
(02-19-2020, 12:35 PM)Tim Curtis Wrote: Right except that lbrespot is written in Rust and not C. It's built using Cargo which invokes the Rust compiler. I imagine there are some flags for specifying the target architecture but it would take someone with Rust experience to know what they are and which ones to use.

[Full disclosure - I haven't tried this yet]

https://github.com/japaric/rust-cross

and this issue explicitly saying cross-compiling to arm6 can be made to work: https://github.com/japaric/rust-cross/issues/42

Regards,
Kent

Looks kind of messy.

I ran a brief test on a 1B and a 0W and in both cases the Rust install bombed with a memory error.

Code:
info: installing component 'rustc'
33.3 MiB /  65.1 MiB ( 51 %) 960.0 KiB/s in 32s ETA: 33smemory allocation of 73088220 bytes failedAborted

Full log

Code:
pi@rp2:~ $ curl https://sh.rustup.rs -sSf | sh
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to
Cargo's bin directory, located at:

 /home/pi/.cargo/bin

This can be modified with the CARGO_HOME environment variable.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

 /home/pi/.rustup

This can be modified with the RUSTUP_HOME environment variable.

This path will then be added to your PATH environment variable by
modifying the profile file located at:

 /home/pi/.profile

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


  default host triple: arm-unknown-linux-gnueabihf
    default toolchain: stable
              profile: default
 modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1

info: profile set to 'default'
info: default host triple is arm-unknown-linux-gnueabihf
info: syncing channel updates for 'stable-arm-unknown-linux-gnueabihf'
476.2 KiB / 476.2 KiB (100 %) 366.2 KiB/s in  2s ETA:  0s
info: latest update on 2020-01-30, rust version 1.41.0 (5e1a79984 2020-01-27)
info: downloading component 'cargo'
 4.2 MiB /   4.2 MiB (100 %) 412.8 KiB/s in 17s ETA:  0s
info: downloading component 'clippy'
 1.8 MiB /   1.8 MiB (100 %) 436.5 KiB/s in  5s ETA:  0s
info: downloading component 'rust-std'
15.3 MiB /  15.3 MiB (100 %) 387.2 KiB/s in 38s ETA:  0s
info: downloading component 'rustc'
65.1 MiB /  65.1 MiB (100 %) 451.2 KiB/s in  3m 18s ETA:  0s    
info: downloading component 'rustfmt'
 2.3 MiB /   2.3 MiB (100 %) 442.5 KiB/s in  6s ETA:  0s
info: installing component 'cargo'
 4.2 MiB /   4.2 MiB (100 %)   1.1 MiB/s in  4s ETA:  0s
info: installing component 'clippy'
 1.8 MiB /   1.8 MiB (100 %) 1016.0 KiB/s in  2s ETA:  0s
info: installing component 'rust-std'
15.3 MiB /  15.3 MiB (100 %)   1.6 MiB/s in 10s ETA:  0s
info: installing component 'rustc'
33.3 MiB /  65.1 MiB ( 51 %) 960.0 KiB/s in 32s ETA: 33smemory allocation of 73088220 bytes failedAborted
pi@rp2:~ $

Rust installed just fine on armv7 Pi and no issues compiling librespot. This suggests that there is some sort of bug or resource requirement in the Rust install that causes it to crash on armv6.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#17
Hi,

one more radiostation for the curated radio stations?

Hirschmilch Prog-House:no advertising, no moderation, but best rhythms Cool 


Code:
https://hirschmilch.de:7001/prog-house.mp3


Regards
Norbert

   
Reply
#18
@Tim Curtis

Sorry, I got tied up yesterday with doctor appointments.

Re: Rust

Turn on swap and try again.

I enabled the default 100MB swapspace and saw (via htop) that as much as 55MB of it was used in installing rust.

Result:

Code:
...
 stable installed - rustc 1.41.0 (5e1a79984 2020-01-27)


Rust is installed now. Great!
...

Regards,
Kent
Reply
#19
@Tim Curtis

...but, building librespot just failed. Angry

Code:
pi@moode0w:~ $ cd ./librespot-master
pi@moode0w:~/librespot-master $ cargo build --release --features alsa-backend
   Updating crates.io index
   Updating git repository `https://github.com/plietar/rust-tremor`
   Updating git repository `https://github.com/plietar/rust-mdns`
   Updating git repository `https://github.com/tomaka/rodio`
   Updating git repository `https://github.com/plietar/dns-parser`
 Downloaded bytes v0.4.12
...lots of dependencies downloaded...
  Downloaded stable_deref_trait v1.1.1
   Compiling libc v0.2.58
error: could not compile `libc`.

Caused by:
  process didn't exit successfully: `rustc --crate-name build_script_build /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.58/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="std"' --cfg 'feature="use_std"' -C metadata=e8401035dea43b9e -C extra-filename=-e8401035dea43b9e --out-dir /home/pi/librespot-master/target/release/build/libc-e8401035dea43b9e -L dependency=/home/pi/librespot-master/target/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)


A little web searching and I turned up a hint to add the following to Cargo.toml (I added at end of existing file)

Code:
[profile.release]
codegen-units = 1

Now the build appears to be proceeding but it's taking a l.o.n.g time

Code:
pi@moode0w:~/librespot-master $ cargo build --release --features alsa-backend
  Compiling libc v0.2.58
  Compiling autocfg v0.1.4
  Compiling spin v0.5.0
  Compiling cfg-if v0.1.9
  Compiling rand_core v0.4.0
  Compiling byteorder v1.3.2
  Compiling futures v0.1.28
  Compiling semver-parser v0.7.0
   Building [>                                                        ] 7/255

Regards,
Kent
Reply
#20
Cool.

Ya it takes like 6 hours :-0
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: