Skip to content

JWahle/piCoreCDSP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 

Repository files navigation

piCoreCDSP

The goal of this project is to provide an easy way to install CamillaDSP 3.0.1 including GUI 3.0.3 and automatic samplerate switching on a piCorePlayer installation.

Requirements

  • a fresh piCorePlayer 10.0.0 or 9.2.0 installation without any modifications
  • on an armv7 or arch64 compatible device (Raspi 2/3/4/5)

How to install

  1. Select a valid output for your Raspi in Squeezelite Settings > Audio output device settings. Check here for more info.
  2. Increase piCorePlayer SD Card size to at least 200MB via Main Page > Additional functions > Resize FS
  3. Run install_cdsp.sh on piCorePlayer from a terminal:
  4. Open CamillaGUI in the browser:
    • It will be running on port 5000 of piCorePlayer.
      Usually can be opened via pcp.local:5000 or <IP of your piCorePlayer>:5000
    • By default, the dummy output null is used, so you can see that CamillaDSP is technically working. If audio is output to CamillaDSP, you should see channel meters and State: RUNNING on the left side in CamillaGUI.
    • Under Playback device enter the settings for your DAC:
      • These HAVE TO BE CORRECT, otherwise CamillaDSP and Squeezelite won't start!
        • device: The Alsa device name of the DAC
          • A list of available devices can be found in Squeezelite settings > Output setting
          • If you know the sampleformat for your DAC or want to find it through trial and error, then choose a device with hw: prefix. Otherwise, use one with plughw: prefix.
        • channels: a supported channel count for the DAC
          Usually 2 for a stereo DAC.
        • sampleformat: a supported sample format for the DAC. (Only important, when NOT using a plughw: device)
    • Hit Apply and save
      • You should see channel meters and State: RUNNING on the left
      • If things go wrong, check the CamillaDSP log file via the Show log file button for more info. After changing the settings, go to the pCP Main Page and press Restart to restart Squeezelite. If you output audio to CamillaDSP and the settings are correct, the channel meters and State: RUNNING should be visible on the left side in CamillaGUI.

Troubleshooting

The script fails with an error

Just try again

Check, your system meets all the requirements, reboot and try to install again.

Sometimes, the script's dependencies get corrupted while downloading.
In that case, you'll see messages like this somewhere in the log:
Checking MD5 of: openssl.tcz.....FAIL
There are a couple of things, you can try to work around this:

  1. reboot and try to install again, repeat until successful
  2. You can try to switch the extension repo:
    • Reboot, then go to Main Page > Extensions > wait for the check to complete (until you see 5 green check marks)
    • Then go to Available > Current repository > select "piCorePlayer mirror repository" and "Set".
    • Run the script again.

If the error persists, post the error message on the piCoreCDSP Thread on diyaudio.com or lyrion.org.

Enough RAM?

If you have a Raspberry Pi with less than 1 GB of RAM, you might need to increase the swap partition to at least 512MB.

Squeezelite doesn't start, even though it is set to auto start

piCorePlayer has a little special logic to determine whether it will start Squeezelite on boot. Here is how to get it to work.
In Squeezelite Settings > Audio output device settings select a valid output for your Raspi. If you have a supported DAC head installed, select that. Otherwise:

  • for Raspi zero, 400, 5 or compute module use one of the HDMI options
  • for the other Raspi models select Headphones

It is irrelevant whether that is the output you are actually using.
If you do this after installing piCoreCDSP, you have to manually set the audio output back to camilladsp for Squeezelite, AirPlay and Bluetooth.

Squeezelite is running, but CamillaDSP is offline (State: Offline)

This happens when no audio is output to CamillaDSP. First, check the error log for errors. If there are no error messages in the log (Show log file button in CamillaGUI), make sure in Squeezelite Settings > Change Squeezelite settings the following is set:

  • Output setting is set to camilladsp
  • Either play audio or ensure Close output setting is empty or set to 0

The audio is delayed

There are various buffers, which can be decreased to reduce latency. This might reduce stability, so decrease stepwise and try which settings work for your setup. Squeezelite Settings > Change Squeezelite settings > ALSA setting the first number can be decreased to 0
CamillaDSP > Devices > Buffers > queuelimit can be reduced to 1
CamillaDSP > Devices > Buffers > chunksize can be reduced - just keep multiples of 2

How to update to CamillaDSP 3.0.0

You can update to the current version, if you have PCP 9.x installed. For older PCP versions, updating is difficult and not recommended - just do a fresh install and enjoy life.

To update, you have to:

How to update to PCP 10.0.0

You can do the insitu update, but afterward you have to reinstall piCoreCDSP and activate your old configuration in CamillaDSP.

How to uninstall

SSH onto the piCorePlayer and enter the following commands depending on what you want to uninstall.

piCoreCDSP extension

If you want to uninstall without setting up piCorePlayer again, you have to reconfigure your audio output device in the pCP UI. Then uninstall the piCoreCDSP Extension (In Main Page > Extensions > Installed > select piCoreCDSP.tcz, press Delete) and reboot.

piCoreCDSP installation script

rm -f /home/tc/install_cdsp.sh

CamillaDSP sound device

Remove the pcm.camilladsp entry from /etc/asound.conf. This is easy to do with the Nano text editor:

tce-load -wil -t /tmp nano
nano /etc/asound.conf

CamillaDSP configuration files and filters

rm -rf /etc/sysconfig/tcedir/camilladsp/

Save the changes

If you just restart, some changes will not be persistent. To make all your changes persistent, run: pcp backup

Implementation

The install_cdsp.sh script downloads the following projects including dependencies and installs them with convenient default settings:

Audio Architecture

graph TD;
    A(Audio Source<br>SqueezeLite/AirPlay/Bluetooth) -- Opens audio stream --> B(CamillaDSP Alsa Plugin);
    B -- Starts and then sends audio to stdin of CamillaDSP.<br>This will show the green meters in CamillaGUI. --> C(CamillaDSP);
    C --> O(Audio output<br>Configured in your CDSP config);
Loading

For developers and tinkerers

In this section it is assumed, that your piCorePlayer is available on pcp.local. If this is not the case, replace occurrences of pcp.local with the IP-address/hostname of your piCorePlayer.

Modifying the installation script

If you made some changes to the installation script on your local machine and want to run it quickly on the piCorePlayer, run the following command from the location of the script:

scp install_cdsp.sh [email protected]:~ && ssh [email protected] "./install_cdsp.sh"

Keeping downloaded extensions to reduce re-installation time

You can keep downloaded extensions to skip the download when installing again. The extensions won't be loaded on startup, so startup time should not be impacted. Just call the script with the -k or --keep-downloads parameter.

Running CamillaDSP standalone

You can run CamillaDSP standalone. This might be useful, if you want to capture audio from some audio device. Although, in this case you won't be able to use any of the Squeezelite/airPlay/Bluetooth audio sources.

  1. Go to Tweaks > Audio Tweaks and set Squeezelite to no.
  2. Then go to Tweaks > User commands and set one of the commands to
    sudo -u tc sh -c '/usr/local/camilladsp -p 1234 -a 0.0.0.0 -o /tmp/camilladsp.log --statefile /mnt/mmcblk0p2/tce/camilladsp/camilladsp_statefile.yml'
    or if you want a fixed volume of e.g. -30dB after boot, use this command:
    sudo -u tc sh -c '/usr/local/camilladsp -p 1234 -a 0.0.0.0 -o /tmp/camilladsp.log --statefile /mnt/mmcblk0p2/tce/camilladsp/camilladsp_statefile.yml --gain=-30'
  3. Save and reboot

Running your own python scripts

It is not possible anymore to reuse the python environment created by this installer. Instead, you can create your own environment as described here: https://github.com/JWahle/piCorePython

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages