# streamr-mpc

> MPD Client for playing music using streamr platform

Latest version **0.0.1** (published 2014-07-21) · 0 weekly downloads

## Install

```sh
npm install streamr-mpc
pnpm add streamr-mpc
yarn add streamr-mpc
bun add streamr-mpc
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2014-07-21 |
| First published | 2014-07-21 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nikolaus Kofler |
| Maintainers | caducas |

## Links

- npm: https://www.npmjs.com/package/streamr-mpc
- Issues: http://streamr.freeforums.org/
- npm.io page: https://npm.io/package/streamr-mpc

## Recent versions

- 0.0.1 (latest) — 2014-07-21

## README

Streamr-mpc
======================
MPD-Client for Streamr ([https://www.npmjs.org/package/streamr](https://www.npmjs.org/package/streamr))

working with streamr version >0.0.9

Installation
======================

### Prerequisites
Install Raspbian on your Raspberry Pi and configure the network adapter settings

### Install node.js 
tested with version 0.10.26 for Raspberry Pi (ARM)

```
mkdir ~/node
cd ~/node
wget http://nodejs.org/dist/v0.10.26/node-v0.10.26-linux-arm-pi.tar.gz
tar -xvzf node-v0.10.26-linux-arm-pi.tar.gz
```

### Add node.js to path variables

```
NODE_JS_HOME=/home/pi/node/node-v0.10.26-linux-arm-pi
PATH=$PATH:$NODE_JS_HOME/bin
sudo bash -c 'echo "PATH=$PATH:/home/pi/node/node-v0.10.26-linux-arm-pi/bin" >> /etc/profile'
```

### Install required tools (screen & dos2unix)

```
sudo apt-get update
sudo apt-get install screen
sudo apt-get install dos2unix
sudo apt-get install mpd
sudo apt-get install mpc
```

### Configure MPD
edit configuration file ```sudo nano /etc/mpd.conf``` and change following lines:

```
bind_to_address         "localhost"
```

```
audio_output {
        type            "alsa"
        name            "My ALSA Device"
        device          "hw:0,0"        # optional
#        format          "44100:16:2"    # optional
#        mixer_device    "default"       # optional
#        mixer_control   "PCM"           # optional
#        mixer_index     "0"             # optional
}
```

### Install streamr-mpc

```
cd ~
npm install streamr-mpc
```

### Install required submodules

```
cd ~/node_modules/streamr-mpc
npm install
```

### Configure autostart

```
cd ~
dos2unix node_modules/streamr-mpc/scripts/*
sudo cp node_modules/streamr-mpc/scripts/streamr-mpc /etc/init.d/
sudo chmod 755 /etc/init.d/streamr-mpc
sudo update-rc.d mpd defaults
sudo update-rc.d streamr-mpc defaults
```

following warning can be ignored:
```
insserv: warning: script 'mathkernel' missing LSB tags and overrides
```


Hifiberry (optional)
==========================
I recommend using HifiBerry instead of built-in 3,5mm audio. If you want to use HifiBerry you have to do following steps (from [http://www.hifiberry.com/products/dac/hifiberry-dac-software/](http://www.hifiberry.com/products/dac/hifiberry-dac-software/))

### Load necessary modules
add following entries using ```sudo nano /etc/modules```:

```
snd_soc_bcm2708
snd_soc_bcm2708_i2s
bcm2708_dmaengine
snd_soc_pcm5102a
snd_soc_hifiberry_dac
```

Reboot and then ```aplay -l``` must print something similar:

```
pi@raspberrypi ~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
```

Remember the card number and device number and change output device in mpd config file using ```sudo nano /etc/mpd.conf``` (replace hw:0,0 with hw:yourCardNumber,yourDeviceNumber):

```
audio_output {
        type            "alsa"
        name            "Hifiberry"
        device          "hw:1,0"        # optional
        format          "44100:16:2"    # optional
        mixer_device    "default"       # optional
        mixer_control   "PCM"           # optional
        mixer_index     "0"             # optional
}
```

You also have to change the mixer to software when using hifiberry:

```
mixer_type                      "software"
```

Restart your Raspberry after configuration.

---
_Source: https://npm.io/package/streamr-mpc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
