Thank you for your donation!


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


Problem: XRUN in CDSP when playing via USB input
#1
My main use of Moode is to play music held on a local SSD. This works fine. 

Thanks to some very helpful advice from forum user "BitLab", I have got my Thorens turntable to play vinyl via Moode. “Why would you want to do that” I hear you ask? Because I can then apply room correction via Camilla DSP to my vinyl as well as my streamed FLAC files.
 
In case you’re wondering, the phono outputs from the Thorens go to a Rega Mini A2D phono preamp, which then gives me digitised input via USB into the RPi running Moode 8.1.2. Getting the USB input to be recognised and played by Moode was easy using BitLabs “dummy playlist” approach. (OK I did make 1 stupid error, but he soon sorted me out).

Playing vinyl through Moode without Camilla works fine. There is considerable latency – it takes around 4 secs after the stylus hits vinyl for the sound to come on, and the same in reverse when lifting the stylus off. However this is not an issue.

The problems start when I switch Camilla on. The sound stops frequently, especially during 1st few minutes - and I have to hit pause and play again on the player controls to restart it. This only happens with vinyl input. Camilla applied to my flac files works fine. 

I’ve switched the MPD log to “verbose” and this is a sample of the error messages when it stops –
2022-08-30 09:39:11.202430 INFO [src/alsadevice.rs:156] Starting playback from Prepared state
Aug 30 10:39 : alsa_output: Decoder is too slow; playing silence to avoid xrun
CDSP Plugin ERROR: XRUN OCCURRED!
Aug 30 10:39 : alsa_output: Underrun on ALSA device "_audioout"
CDSP Plugin ERROR: XRUN OCCURRED!
Aug 30 10:39 : alsa_output: Underrun on ALSA device "_audioout"
CDSP Plugin ERROR: XRUN OCCURRED!
 
Whilst it would be nice to get rid of the latency, the major problem is the sound dropouts. Any hints as to what I might tweak in MPD settings (or elsewhere) to get rid of these? 
 
Other info which might be useful –
The RPi is a model 4b with 4GB. This feeds a mark 1 Khadas Tone Board vis USB, hardware volume control is used. Streamed music is held on a local SSD, not that it should matter. The Rega A2D mini is set to sample at 44.1 kHz / 16 bit.

All suggestions, hints etc gratefully received. 
 
Many thanks
 
Paul
Reply
#2
You could try the updated version of alsa-cdsp plugin in our package repo. It has some patches from @bitlab that address certain XRUN conditions. It may or may not help in your particular scenario.

These commands install alsa-cdsp version 1.2.0

Code:
# Update the package list
sudo apt update

# Install the package
sudo moode-apt-mark unhold
sudo apt -y install alsa-cdsp
sudo moode-apt-mark hold

# Reboot afterwards
sudo reboot
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Tim, first of all many thanks for responding so quickly. 

Secondly, that seems on a quick test to have cured all the stopping / having to restart, and USB input and Camilla now seem to be playing nicely together. 

I did check the MPD log and it's got loads of warnings -  
"CDSP Plugin WARN: IO Thread out of data".
But they are not as far as I can tell affecting the audio, and there are no errors that I can see. 

So I've turned off MPD verbose logging ;-)

Thanks again

Paul
Reply
#4
Good to hear :-) The improved alsa-cdsp is part of upcoming moOde 8.2.0 release.

@bitlab may have some comments on the warnings.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: