Skip to content

Commit 2541f12

Browse files
committed
Update documentation
1 parent 68bec41 commit 2541f12

3 files changed

Lines changed: 32 additions & 26 deletions

File tree

COMPILING.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,15 @@
55
In order to compile librespot, you will first need to set up a suitable Rust build environment, with the necessary dependencies installed. You will need to have a C compiler, Rust, and the development libraries for the audio backend(s) you want installed. These instructions will walk you through setting up a simple build environment.
66

77
### Install Rust
8-
The easiest, and recommended way to get Rust is to use [rustup](https://rustup.rs). On Unix/MacOS You can install `rustup` with this command:
9-
10-
```bash
11-
curl https://sh.rustup.rs -sSf | sh
12-
```
13-
14-
Follow any prompts it gives you to install Rust. Once that’s done, Rust's standard tools should be setup and ready to use.
8+
The easiest, and recommended way to get Rust is to use [rustup](https://rustup.rs). Once that’s installed, Rust's standard tools should be set up and ready to use.
159

1610
*Note: The current minimum required Rust version at the time of writing is 1.48, you can find the current minimum version specified in the `.github/workflow/test.yml` file.*
1711

1812
#### Additional Rust tools - `rustfmt`
19-
To ensure a consistent codebase, we utilise [`rustfmt`](https://github.com/rust-lang/rustfmt), which is installed by default with `rustup` these days, else it can be installed manually with:
13+
To ensure a consistent codebase, we utilise [`rustfmt`](https://github.com/rust-lang/rustfmt) and [`clippy`](https://github.com/rust-lang/rust-clippy), which are installed by default with `rustup` these days, else they can be installed manually with:
2014
```bash
2115
rustup component add rustfmt
16+
rustup component add clippy
2217
```
2318
Using `rustfmt` is not optional, as our CI checks against this repo's rules.
2419

@@ -43,12 +38,13 @@ Depending on the chosen backend, specific development libraries are required.
4338
|--------------------|------------------------------|-----------------------------------|-------------|
4439
|Rodio (default) | `libasound2-dev` | `alsa-lib-devel` | |
4540
|ALSA | `libasound2-dev, pkg-config` | `alsa-lib-devel` | |
41+
|GStreamer | `gstreamer1.0-plugins-base libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good libgstreamer-plugins-good1.0-dev` | `gstreamer1 gstreamer1-devel gstreamer1-plugins-base-devel gstreamer1-plugins-good` | `gstreamer gst-devtools gst-plugins-base gst-plugins-good` |
4642
|PortAudio | `portaudio19-dev` | `portaudio-devel` | `portaudio` |
4743
|PulseAudio | `libpulse-dev` | `pulseaudio-libs-devel` | |
48-
|JACK | `libjack-dev` | `jack-audio-connection-kit-devel` | |
49-
|JACK over Rodio | `libjack-dev` | `jack-audio-connection-kit-devel` | - |
50-
|SDL | `libsdl2-dev` | `SDL2-devel` | |
51-
|Pipe | - | - | - |
44+
|JACK | `libjack-dev` | `jack-audio-connection-kit-devel` | `jack` |
45+
|JACK over Rodio | `libjack-dev` | `jack-audio-connection-kit-devel` | `jack` |
46+
|SDL | `libsdl2-dev` | `SDL2-devel` | `sdl2` |
47+
|Pipe & subprocess | - | - | - |
5248

5349
###### For example, to build an ALSA based backend, you would need to run the following to install the required dependencies:
5450

@@ -68,7 +64,6 @@ The recommended method is to first fork the repo, so that you have a copy that y
6864

6965
```bash
7066
git clone [email protected]:YOURUSERNAME/librespot.git
71-
cd librespot
7267
```
7368

7469
## Compiling & Running
@@ -109,7 +104,9 @@ cargo build --no-default-features --features "alsa-backend"
109104
Assuming you just compiled a ```debug``` build, you can run librespot with the following command:
110105

111106
```bash
112-
./target/debug/librespot -n Librespot
107+
./target/debug/librespot
113108
```
114109

115110
There are various runtime options, documented in the wiki, and visible by running librespot with the ```-h``` argument.
111+
112+
Note that debug builds may cause buffer underruns and choppy audio when dithering is enabled (which it is by default). You can disable dithering with ```--dither none```.

CONTRIBUTING.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ If you have encountered a bug, please report it, as we rely on user reports to f
88

99
Please also make sure that your issues are helpful. To ensure that your issue is helpful, please read over this brief checklist to avoid the more common pitfalls:
1010

11-
- Please take a moment to search/read previous similar issues to ensure you aren’t posting a duplicate. Duplicates will be closed immediately.
12-
- Please include a clear description of what the issue is. Issues with descriptions such as ‘It hangs after 40 minutes’ will be closed immediately.
13-
- Please include, where possible, steps to reproduce the bug, along with any other material that is related to the bug. For example, if librespot consistently crashes when you try to play a song, please include the Spotify URI of that song. This can be immensely helpful in quickly pinpointing and resolving issues.
14-
- Lastly, and perhaps most importantly, please include a backtrace where possible. Recent versions of librespot should produce these automatically when it crashes, and print them to the console, but in some cases, you may need to run ‘export RUST_BACKTRACE=full’ before running librespot to enable backtraces.
11+
- Please take a moment to search/read previous similar issues to ensure you aren’t posting a duplicate. Duplicates will be closed immediately.
12+
- Please include a clear description of what the issue is. Issues with descriptions such as ‘It hangs after 40 minutes’ will be closed immediately.
13+
- Please include, where possible, steps to reproduce the bug, along with any other material that is related to the bug. For example, if librespot consistently crashes when you try to play a song, please include the Spotify URI of that song. This can be immensely helpful in quickly pinpointing and resolving issues.
14+
- Please be alert and respond to questions asked by any project members. Stale issues will be closed.
15+
- When your issue concerns audio playback, please first make sure that your audio system is set up correctly and can play audio from other applications. This project aims to provide correct audio backends, not to provide Linux support to end users.
16+
- Lastly, and perhaps most importantly, please include a backtrace where possible. Recent versions of librespot should produce these automatically when it crashes, and print them to the console, but in some cases, you may need to run ‘export RUST_BACKTRACE=full’ before running librespot to enable backtraces.
1517

1618
## Contributing Code
1719

@@ -33,16 +35,21 @@ Unless your changes are negligible, please add an entry in the "Unreleased" sect
3335

3436
Make sure that the code is correctly formatted by running:
3537
```bash
36-
cargo +stable fmt --all
38+
cargo fmt --all
3739
```
3840

39-
This command runs the previously installed stable version of ```rustfmt```, a code formatting tool that will automatically correct any formatting that you have used that does not conform with the librespot code style. Once that command has run, you will need to rebuild the project:
41+
This command runs ```rustfmt```, a code formatting tool that will automatically correct any formatting that you have used that does not conform with the librespot code style. Once that command has run, you will need to rebuild the project:
4042

4143
```bash
4244
cargo build
4345
```
4446

45-
Once it has built, and you have confirmed there are no warnings or errors, you should commit your changes.
47+
Once it has built, check for common code mistakes by running:
48+
```bash
49+
cargo clippy
50+
```
51+
52+
Once you have confirmed there are no warnings or errors, you should commit your changes.
4653

4754
```bash
4855
git commit -a -m "My fancy fix"

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
[![Gitter chat](https://badges.gitter.im/librespot-org/librespot.png)](https://gitter.im/librespot-org/spotify-connect-resources)
33
[![Crates.io](https://img.shields.io/crates/v/librespot.svg)](https://crates.io/crates/librespot)
44

5-
Current maintainer is [@awiouy](https://github.com/awiouy) folks.
5+
Current maintainers are [listed on GitHub](https://github.com/orgs/librespot-org/people).
66

77
# librespot
88
*librespot* is an open source client library for Spotify. It enables applications to use Spotify's service to control and play music via various backends, and to act as a Spotify Connect receiver. It is an alternative to the official and [now deprecated](https://pyspotify.mopidy.com/en/latest/#libspotify-s-deprecation) closed-source `libspotify`. Additionally, it will provide extra features which are not available in the official library.
99

10-
_Note: librespot only works with Spotify Premium. This will remain the case for the foreseeable future, as we are unlikely to work on implementing the features such as limited skips and adverts that would be required to make librespot compliant with free accounts._
10+
_Note: librespot only works with Spotify Premium. This will remain the case. We will not any support features to make librespot compatible with free accounts, such as limited skips and adverts._
1111

1212
## Quick start
1313
We're available on [crates.io](https://crates.io/crates/librespot) as the _librespot_ package. Simply run `cargo install librespot` to install librespot on your system. Check the wiki for more info and possible [usage options](https://github.com/librespot-org/librespot/wiki/Options).
1414

15-
After installation, you can run librespot from the CLI using a command such as `librespot -n "Librespot Speaker" -b 160` to create a speaker called _Librespot Speaker_ serving 160kbps audio.
15+
After installation, you can run librespot from the CLI using a command such as `librespot -n "Librespot Speaker" -b 160` to create a speaker called _Librespot Speaker_ serving 160 kbps audio.
1616

1717
## This fork
1818
As the origin by [plietar](https://github.com/plietar/) is no longer actively maintained, this organisation and repository have been set up so that the project may be maintained and upgraded in the future.
@@ -53,12 +53,14 @@ librespot currently offers the following selection of [audio backends](https://g
5353
```
5454
Rodio (default)
5555
ALSA
56+
GStreamer
5657
PortAudio
5758
PulseAudio
5859
JACK
5960
JACK over Rodio
6061
SDL
6162
Pipe
63+
Subprocess
6264
```
6365
Please check the corresponding [compiling entry](https://github.com/librespot-org/librespot/wiki/Compiling#general-dependencies) for backend specific dependencies.
6466

@@ -84,9 +86,9 @@ The above is a minimal example. Here is a more fully fledged one:
8486
```shell
8587
target/release/librespot -n "Librespot" -b 320 -c ./cache --enable-volume-normalisation --initial-volume 75 --device-type avr
8688
```
87-
The above command will create a receiver named ```Librespot```, with bitrate set to 320kbps, initial volume at 75%, with volume normalisation enabled, and the device displayed in the app as an Audio/Video Receiver. A folder named ```cache``` will be created/used in the current directory, and be used to cache audio data and credentials.
89+
The above command will create a receiver named ```Librespot```, with bitrate set to 320 kbps, initial volume at 75%, with volume normalisation enabled, and the device displayed in the app as an Audio/Video Receiver. A folder named ```cache``` will be created/used in the current directory, and be used to cache audio data and credentials.
8890

89-
A full list of runtime options are available [here](https://github.com/librespot-org/librespot/wiki/Options)
91+
A full list of runtime options is available [here](https://github.com/librespot-org/librespot/wiki/Options).
9092

9193
_Please Note: When using the cache feature, an authentication blob is stored for your account in the cache directory. For security purposes, we recommend that you set directory permissions on the cache directory to `700`._
9294

0 commit comments

Comments
 (0)