0

I have MPD and a DSP module running in rpi debian jessie

The DSP module helps to add system wide audio effects.

Since the MPD creates its own user, mpd it is not identifying all the config which the DSP library did in root.

How can I fix this?

I have configured alsa like this
My default .asoundrc

pcm.dsp {
        type plug
        slave {
                format FLOAT
                rate unchanged
                channels unchanged
                pcm {
                        type ladspa
                        path "/usr/lib/ladspa"
                        playback_plugins [{
                                label "ladspa_dsp"
                        }]
                        slave.pcm {
                                type plug
                                slave {
                                        pcm "hw:0,0"
                                        rate unchanged
                                        channels unchanged
                                }
                        }
                }
        }
}

pcm.!default {
        type copy
        slave.pcm "dsp"
}

By default running mpg321 -a dsp music_test/test_track.mp3 works perfectly.

But since the MPD creates its own user mpd, I can't make it identify the default alsa device dsp and instead it throws an error.

pi@raspberrypi:~ $ sudo -u mpd mpg321 -a dsp music_test/Pashmina.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2, and 3.
Version 0.3.2-1 (2012/03/25). Written and copyrights by Joe Drew,
now maintained by Nanakos Chrysostomos and others.
Uses code from various people. See 'README' for more!
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
Title   : 02 Pashmina SongsMp3.Com       Artist : Amit Trivedi                  
Album   : Fitoor SongsMp3.Com            Year    : 2016
Comment : SongsMp3.Com                   Genre : Bollywood                     

Directory: music_test
Playing MPEG stream from Pashmina.mp3 ...
MPEG 1.0 layer III, 320 kbit/s, 44100 Hz joint-stereo
ladspa_dsp: error: no config files found
ALSA lib pcm_ladspa.c:1509:(snd_pcm_ladspa_add_plugin) Unable to find or load plugin 'ladspa_dsp' ID 0, path '/usr/lib/ladspa'
Can't open libao driver with device dsp (is device in use?)

Here is the MPD log

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM dsp
Jul 18 19:17 : exception: Failed to open "default" [alsa]
Jul 18 19:17 : exception: nested: Failed to open ALSA device "dsp": No such file or directory
Jul 18 19:17 : exception: Failed to open "default" [alsa]
Jul 18 19:17 : exception: nested: Failed to open ALSA device "dsp": No such file or directory

How can I fix this?

How can I tell the user 'mpd` to access everything from the default root user.

0

The file ~/.asoundrc contains definitions for a user.
The file /etc/asound.conf contains definitions for all users.

1
  • It doesn't work while actually streaming but it is now working through sudo -u mpd ... Why is that?
    – arjun
    Jul 18 '18 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.