<div dir="ltr"><br><p>Thanks for the idea George. I tried using dmix with the instructions in the link that you provided above but it instructs to create a .pa file in the directory: <code>/etc/pulse/default.pa.d/</code> but this is a directory that does not exist on the RPI. I have tried appending the lines:</p>
<pre><code>unload-module module-udev-detect
unload-module module-detect
load-module module-alsa-sink device=dmix
load-module module-alsa-source device=dsnoop
</code></pre>
<p>to my <code>/etc/pulse/<a href="http://default.pa">default.pa</a></code> but that causes aplay to give a busy error: <code>aplay: main:830: audio open error: Device or resource busy</code> and Moode to also still give one as well.</p></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mar, 7 may 2024 a las 14:59, Georg Chini (<<a href="mailto:georg@chini.tk">georg@chini.tk</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

  
    
  
  <div>
    <p>Hi,</p>
    <p>mh, looks like you have a problem then. Pulseaudio exclusively
      opens the sound devices, so<br>
      if the player cannot be configured to use the alsa default device,
      it will not work. You could<br>
      try using dmix (<a href="https://wiki.archlinux.org/title/PulseAudio" target="_blank">https://wiki.archlinux.org/title/PulseAudio</a>
      chapter 5.1.3, just used Google,<br>
      did not check the content)<br>
    </p>
    <p>The only other option left is to start the player with
      pasuspender, but then again ledfx won't<br>
      work while the player is active.</p>
    <p>Regards<br>
                     Georg<br>
    </p>
    <div>On 07.05.24 21:50, Richard Reina wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">$ aplay -L<br>
        null<br>
            Discard all samples (playback) or generate zero samples
        (capture)<br>
        default<br>
            Playback/recording through the PulseAudio sound server<br>
        lavrate<br>
            Rate Converter Plugin Using Libav/FFmpeg Library<br>
        samplerate<br>
            Rate Converter Plugin Using Samplerate Library<br>
        speexrate<br>
            Rate Converter Plugin Using Speex Resampler<br>
        jack<br>
            JACK Audio Connection Kit<br>
        oss<br>
            Open Sound System<br>
        pulse<br>
            PulseAudio Sound Server<br>
        upmix<br>
            Plugin for channel upmix (4,6,8)<br>
        vdownmix<br>
            Plugin for channel downmix (stereo) with a simple
        spacialization<br>
        _audioout<br>
        _audioout__<br>
        alsaequal<br>
        plug_alsaequal<br>
        btstream<br>
        camilladsp<br>
        crossfeed<br>
        plug_bs2b<br>
        eqfa12p<br>
        plug_eqfa12p<br>
        invpolarity<br>
        trx_send<br>
        hw:CARD=sndrpihifiberry,DEV=0<br>
            snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi
        pcm512x-hifi-0<br>
            Direct hardware device without any conversions<br>
        plughw:CARD=sndrpihifiberry,DEV=0<br>
            snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi
        pcm512x-hifi-0<br>
            Hardware device with all software conversions<br>
        sysdefault:CARD=sndrpihifiberry<br>
            snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi
        pcm512x-hifi-0<br>
            Default Audio Device<br>
        dmix:CARD=sndrpihifiberry,DEV=0<br>
            snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi
        pcm512x-hifi-0<br>
            Direct sample mixing device<br>
        usbstream:CARD=sndrpihifiberry<br>
            snd_rpi_hifiberry_dacplus<br>
            USB Stream Output<br>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">El mar, 7 may 2024 a las
          14:44, Georg Chini (<<a href="mailto:georg@chini.tk" target="_blank">georg@chini.tk</a>>)
          escribió:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div>
            <p>Hi,</p>
            <p>so what's the output of aplay -L?</p>
            <p>Regards<br>
                             Georg<br>
            </p>
            <div>On 07.05.24 21:12, Richard Reina wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">Hello Georg, Thank you for the reply. Yes
                Moode accesses alsa directly and unfortunately there is
                no option for making it use pulse.<br>
              </div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">El mar, 7 may 2024 a
                  las 13:33, Georg Chini (<<a href="mailto:georg@chini.tk" target="_blank">georg@chini.tk</a>>)
                  escribió:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                  <div>
                    <p>Hello,</p>
                    <p>maybe you don't have the alsa config for
                      pulseaudio. Normally aplay -L<br>
                      shows that the default device points to pulse:</p>
                    <p>null<br>
                          Discard all samples (playback) or generate
                      zero samples (capture)<br>
                      default<br>
                          Playback/recording through the PulseAudio
                      sound server<br>
                    </p>
                    <p>...</p>
                    <p>pulse<br>
                          PulseAudio Sound Server<br>
                    </p>
                    <p>...<br>
                    </p>
                    <p>I guess the Moode audio player tries to access
                      the ALSA device directly<br>
                      and fails because the device is already in use by
                      pulseaudio. There might<br>
                      also be a configuration option in the player to
                      make it use pulse. <br>
                    </p>
                    <p>Regards<br>
                                    Georg<br>
                    </p>
                    On 07.05.24 18:34, Richard Reina wrote:<br>
                    <blockquote type="cite">
                      <div dir="ltr">Yes it's a requirement. Setting the
                        audio device to pulse in Ledfx is the only way
                        it will work. <br>
                      </div>
                      <br>
                      <div class="gmail_quote">
                        <div dir="ltr" class="gmail_attr">El mar, 7 may
                          2024 a las 11:21, Mark Gaiser (<<a href="mailto:markg85@gmail.com" target="_blank">markg85@gmail.com</a>>)
                          escribió:<br>
                        </div>
                        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                          <div dir="ltr">
                            <div>Have you tried changing your device in
                              ledfx to pulse?</div>
                            <div><a href="https://ledfx.readthedocs.io/en/latest/directing_audio.html" target="_blank">https://ledfx.readthedocs.io/en/latest/directing_audio.html</a><br>
                            </div>
                            <div><br>
                            </div>
                            <div>Again no idea if this works, I don't
                              know nor use ledfx :) Just trying to help
                              out.</div>
                            <br>
                            <div class="gmail_quote">
                              <div dir="ltr" class="gmail_attr">On Tue,
                                May 7, 2024 at 6:14 PM Richard Reina
                                <<a href="mailto:gatorreina@gmail.com" target="_blank">gatorreina@gmail.com</a>>
                                wrote:<br>
                              </div>
                              <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                <div dir="ltr">
                                  <div>Hi Mark,</div>
                                  <div><br>
                                  </div>
                                  <div>Thank you for the reply.  paplay
                                    also works but there's no change.
                                    It's not the playing of the song
                                    that locks up the device and causes
                                    Moode audio not to be able to use
                                    it, it's the starting of ledfx. Once
                                    I do systemctl start ledfx the moode
                                    audio player can no longer use the
                                    output device regardless if I play a
                                    sound file with aplay, paplay or
                                    don't play a sound file at all.
                                    Moode audio can't use the device
                                    until I do systemctl stop ledfx.</div>
                                </div>
                                <br>
                                <div class="gmail_quote">
                                  <div dir="ltr" class="gmail_attr">El
                                    mar, 7 may 2024 a las 10:48, Mark
                                    Gaiser (<<a href="mailto:markg85@gmail.com" target="_blank">markg85@gmail.com</a>>)
                                    escribió:<br>
                                  </div>
                                  <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                    <div dir="ltr">
                                      <div>Can you use paplay instead?</div>
                                      <div>That is the pulseaudio aplay
                                        drop-in replacement.</div>
                                      <div>I'm guessing you won't have
                                        "device or resource busy" errors
                                        when using paplay.</div>
                                      <div><br>
                                      </div>
                                      <div>I did not test this! But do
                                        let us know if it works for you
                                        :)</div>
                                      <div dir="ltr"><br>
                                      </div>
                                      <div dir="ltr">On Tue, May 7, 2024
                                        at 3:24 PM Richard Reina <<a href="mailto:gatorreina@gmail.com" target="_blank">gatorreina@gmail.com</a>>
                                        wrote:<br>
                                      </div>
                                      <div class="gmail_quote">
                                        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                          <div dir="ltr">
                                            <div>
                                              <p>I have a Raspberry Pi
                                                3b with a Hifiberry
                                                Amp4/DAC hat runs Moode
                                                Audio OS.</p>
                                              <p>If I pick <code>Pulse</code>
                                                as they audio device in
                                                LedFx and play a sound
                                                file with <code>aplay
                                                  sound_file.wav</code>
                                                my leds react to the
                                                music.</p>
                                              <p>The problem is that
                                                after <code>aplay</code>
                                                has finished playing the
                                                sound file if I then go
                                                try to use Moode audio
                                                player Moode audio won't
                                                play music and gives me
                                                the following error:</p>
                                              <p><code>MPD error Failed
                                                  to open "ALSA Default"
                                                  (alsa); Failed to open
                                                  ALSA device
                                                  "_audioout": Device or
                                                  resource busy</code></p>
                                              <p>This persists until I
                                                stop Ledfx. Is there a
                                                way I can switch back
                                                and forth between aplay
                                                and Moode Audio player
                                                without having to stop
                                                and start Ledfx? I am
                                                not looking to get LedFx
                                                working with Moode I
                                                only want reactive
                                                lights when I play a
                                                song with <code>aplay</code>.</p>
                                              <p>$ aplay -l <br>
                                              </p>
                                              <p>**** List of PLAYBACK
                                                Hardware Devices **** <br>
                                              </p>
                                              <p>card 0: sndrpihifiberry
[snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ HiFi
                                                pcm512x-hifi-0
                                                [HiFiBerry DAC+ HiFi
                                                pcm512x-hifi-0] <br>
                                              </p>
                                              <p>Subdevices: 0/1 <br>
                                              </p>
                                              <p>Subdevice #0: subdevice
                                                #0</p>
                                              <p>$ amixer<br>
                                                Simple mixer control
                                                'Master',0<br>
                                                  Capabilities: pvolume
                                                pswitch pswitch-joined<br>
                                                  Playback channels:
                                                Front Left - Front Right<br>
                                                  Limits: Playback 0 -
                                                65536<br>
                                                  Mono:<br>
                                                  Front Left: Playback
                                                65536 [100%] [on]<br>
                                                  Front Right: Playback
                                                65536 [100%] [on]<br>
                                                Simple mixer control
                                                'Capture',0<br>
                                                  Capabilities: cvolume
                                                cswitch cswitch-joined<br>
                                                  Capture channels:
                                                Front Left - Front Right<br>
                                                  Limits: Capture 0 -
                                                65536<br>
                                                  Front Left: Capture
                                                65536 [100%] [on]<br>
                                                  Front Right: Capture
                                                65536 [100%] [on]<br>
                                              </p>
                                            </div>
                                          </div>
                                        </blockquote>
                                      </div>
                                    </div>
                                  </blockquote>
                                </div>
                              </blockquote>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                    </blockquote>
                  </div>
                </blockquote>
              </div>
            </blockquote>
          </div>
        </blockquote>
      </div>
    </blockquote>
  </div>

</blockquote></div>