Thank you for your donation!


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


Instruction Guide 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi
Also, please post the output of this command


Code:
mpc outputs
Reply
(03-22-2021, 12:21 PM)adrii Wrote: Also, please post the output of this command


Code:
mpc outputs

No bars after 15 minutes. Here commands output:

pi@Simoode-audio:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  Subdevices: 7/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 2: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 3: C20 [CA CXA81 2.0], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0


pi@Simoode-audio:~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
btaplay_dmix
plug_alsaequal
btstream
camilladsp
crossfeed
plug_bs2b
plug_eqfa12p
invpolarity
eqfa12p
eqfa12p_and_copy
alsaequal
alsaequal_and_copy
default:CARD=b1
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Default Audio Device
sysdefault:CARD=b1
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Default Audio Device
dmix:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct sample mixing device
dsnoop:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct sample snooping device
hw:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct hardware device without any conversions
plughw:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Hardware device with all software conversions
default:CARD=Loopback
    Loopback, Loopback PCM
    Default Audio Device
sysdefault:CARD=Loopback
    Loopback, Loopback PCM
    Default Audio Device
front:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    Front speakers
surround21:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
dmix:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    Direct sample mixing device
dmix:CARD=Loopback,DEV=1
    Loopback, Loopback PCM
    Direct sample mixing device
dsnoop:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    Direct sample snooping device
dsnoop:CARD=Loopback,DEV=1
    Loopback, Loopback PCM
    Direct sample snooping device
hw:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    Direct hardware device without any conversions
hw:CARD=Loopback,DEV=1
    Loopback, Loopback PCM
    Direct hardware device without any conversions
plughw:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    Hardware device with all software conversions
plughw:CARD=Loopback,DEV=1
    Loopback, Loopback PCM
    Hardware device with all software conversions
default:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
sysdefault:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
dmix:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample mixing device
dsnoop:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample snooping device
hw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct hardware device without any conversions
plughw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Hardware device with all software conversions
default:CARD=C20
    CA CXA81 2.0, USB Audio
    Default Audio Device
sysdefault:CARD=C20
    CA CXA81 2.0, USB Audio
    Default Audio Device
front:CARD=C20,DEV=0
    CA CXA81 2.0, USB Audio
    Front speakers
surround21:CARD=C20,DEV=0
    CA CXA81 2.0, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=C20,DEV=0
    CA CXA81 2.0, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=C20,DEV=0
    CA CXA81 2.0, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=C20,DEV=0
    CA CXA81 2.0, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=C20,DEV=0
    CA CXA81 2.0, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=C20,DEV=0
    CA CXA81 2.0, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=C20,DEV=0
    CA CXA81 2.0, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=C20,DEV=0
    CA CXA81 2.0, USB Audio
    Direct sample mixing device
dsnoop:CARD=C20,DEV=0
    CA CXA81 2.0, USB Audio
    Direct sample snooping device
hw:CARD=C20,DEV=0
    CA CXA81 2.0, USB Audio
    Direct hardware device without any conversions
plughw:CARD=C20,DEV=0
    CA CXA81 2.0, USB Audio
    Hardware device with all software conversions


pi@Simoode-audio:~ $ cat /etc/asound.conf
# MPD_OLED_START_TAG: DO NOT CHANGE THIS LINE
pcm.!eqfa12p {
    type copy
    slave.pcm "eqfa12p_and_copy"
}

pcm.eqfa12p_and_copy {
    type plug
    slave.pcm {
        type multi
        slaves {
            a { channels 2 pcm "plug_eqfa12p" }       # the original output
            b { channels 2 pcm "plughw:Loopback,0" }  # the loopback driver
        }
        bindings {
            0 { slave a channel 0 }
            1 { slave a channel 1 }
            2 { slave b channel 0 }
            3 { slave b channel 1 }
        }
    }
    ttable [
        [ 1 0 1 0 ]   # left  -> a.left,  b.left
        [ 0 1 0 1 ]   # right -> a.right, b.right
    ]
}

pcm.!alsaequal {
    type copy
    slave.pcm "alsaequal_and_copy"
}

pcm.alsaequal_and_copy {
    type plug
    slave.pcm {
        type multi
        slaves {
            a { channels 2 pcm "plug_alsaequal" }     # the original output
            b { channels 2 pcm "plughw:Loopback,0" }  # the loopback driver
        }
        bindings {
            0 { slave a channel 0 }
            1 { slave a channel 1 }
            2 { slave b channel 0 }
            3 { slave b channel 1 }
        }
    }
    ttable [
        [ 1 0 1 0 ]   # left  -> a.left,  b.left
        [ 0 1 0 1 ]   # right -> a.right, b.right
    ]
}
# MPD_OLED_END_TAG: DO NOT CHANGE THIS LINE


pi@Simoode-audio:~ $ cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

# Allo Boss2 OLED display
i2c-dev
snd-aloop



pi@Simoode-audio:~ $ cat /etc/modprobe.d/alsa-base.conf
options snd-aloop index=-2



pi@Simoode-audio:~ $ cat /var/local/www/currentsong.txt
file=http://strm112.1.fm/blues_mobile_mp3
artist=Radio station
album=1.FM - Blues Radio
title=George ''Wild Child'' Butler - Wedding Ring Blues
coverurl=imagesw/radio-logos/1.FM - Blues Radio.jpg
track=
date=
composer=
encoded=VBR
bitrate=192 kbps
outrate=32 bit, 44.1 kHz, Stereo, 2.822 Mbps
volume=0
mute=0
state=play


pi@Simoode-audio:~ $ ps ax | grep mpd_oled
  365 ?        Dsl    1:38 /usr/bin/mpd_oled -o6 -b 10 -g 1 -f 20
  390 ?        S      0:00 sh -c mpd_oled_cava -p /tmp/cava_config_IDWMau
  391 ?        Sl     0:16 mpd_oled_cava -p /tmp/cava_config_IDWMau
22266 pts/0    S+     0:00 grep --color=auto mpd_oled


pi@Simoode-audio:~ $ mpc outputs
Output 1 (ALSA Default) is disabled
        allowed_formats=""
        dop="0"
Output 2 (ALSA Crossfeed) is disabled
        allowed_formats=""
        dop="0"
Output 3 (ALSA Parametric EQ) is disabled
        allowed_formats=""
        dop="0"
Output 4 (ALSA Graphic EQ) is enabled
        allowed_formats=""
        dop="0"
Output 5 (ALSA Polarity Inv) is disabled
        allowed_formats=""
        dop="0"
Output 6 (ALSA CamillaDSP) is disabled
        allowed_formats=""
        dop="0"
Output 7 (ALSA Bluetooth) is disabled
        allowed_formats=""
        dop="0"
Output 8 (HTTP Server) is disabled
Output 9 (mpd_oled_FIFO) is disabled
Reply
Hello,
I'm also reporting that I don't have any bar showing.
During installation
Code:
mpd_oled -o6 -c alsa,hw:Loopback,1

bars were showing.
But after with mpd_oled_service_edit, I enter  -o 6 -b 10 -g 1 -f 20, then no bar. I tried -o 6 -a 3c -b 10 -g 1 -f 20, no bar.
-P s is working, when paused it goes back to big clock.
I tried from installation from source, same thing.
Reply
Hi officialsm

Thank you for posting the results of the commands. Everything appears to be configured correctly. The loopback device appears to be setup correctly, the ALSA configuration file looks fine.

There is, however, one strange result, which is that Moode is saying that your volume is 0

Code:
pi@Simoode-audio:~ $ cat /var/local/www/currentsong.txt
file=http://strm112.1.fm/blues_mobile_mp3
artist=Radio station
album=1.FM - Blues Radio
title=George ''Wild Child'' Butler - Wedding Ring Blues
coverurl=imagesw/radio-logos/1.FM - Blues Radio.jpg
track=
date=
composer=
encoded=VBR
bitrate=192 kbps
outrate=32 bit, 44.1 kHz, Stereo, 2.822 Mbps
volume=0
mute=0
state=play


I wonder if no bars are showing because the audio level is too low when the audio copy is made. Could you try to adjust your volume so that Moode reports a value for it, and see if this helps with the spectrum bars.

Adrian.
Reply
Hi Alain

You need to specify the loopback device as the audio source, and so your installation command would be
Code:
sudo mpd_oled_service_edit -o 6 -b 10 -g 1 -f 20 -c alsa,hw:Loopback,1

I will update the installation instructions when the method has had a bit more testing.

Adrian.
Reply
(03-22-2021, 03:09 PM)adrii Wrote: Hi officialsm

Thank you for posting the results of the commands. Everything appears to be configured correctly. The loopback device appears to be setup correctly, the ALSA configuration file looks fine.

There is, however, one strange result, which is that Moode is saying that your volume is 0

Code:
pi@Simoode-audio:~ $ cat /var/local/www/currentsong.txt
file=http://strm112.1.fm/blues_mobile_mp3
artist=Radio station
album=1.FM - Blues Radio
title=George ''Wild Child'' Butler - Wedding Ring Blues
coverurl=imagesw/radio-logos/1.FM - Blues Radio.jpg
track=
date=
composer=
encoded=VBR
bitrate=192 kbps
outrate=32 bit, 44.1 kHz, Stereo, 2.822 Mbps
volume=0
mute=0
state=play


I wonder if no bars are showing because the audio level is too low when the audio copy is made. Could you try to adjust your volume so that Moode reports a value for it, and see if this helps with the spectrum bars.

Adrian.

Hi
volume is 0 because in MPD CONFIG -> COLUME MIXER the Mixer type is Fixed 0 db (disabled). Because i have a DAC embebbed in the AMplifieri.
Tried to change to software audio mixer but still not see bars.

Thank you so much helping me. I will try again when i will reinstall Moode.
Reply
Hi officialsm

Sorry it hasn't worked out. Hopefully a solution will present itself when I have had some more feedback.

Adrian.
Reply
Hi officialsm

The disabled mixer does not seem to be a problem. I usually use an I2S DAC with software volume. Without changing the audio copy configuration, I changed to mixer type disabled (0db outout), and the spectrum worked fine. I then plugged in a USB DAC and tried the software, hardware and disabled mixers, and in all cases the spectrum worked fine without any changes to the audio copy configuration.

That led me to review your ouput again, and I think I have found the problem!

Code:
pi@Simoode-audio:~ $ ps ax | grep mpd_oled
 365 ?        Dsl    1:38 /usr/bin/mpd_oled -o6 -b 10 -g 1 -f 20
 390 ?        S      0:00 sh -c mpd_oled_cava -p /tmp/cava_config_IDWMau
 391 ?        Sl     0:16 mpd_oled_cava -p /tmp/cava_config_IDWMau
22266 pts/0    S+     0:00 grep --color=auto mpd_oled

You are running mpd_oled without specifying the loopback device as the audio source. In which case, make sure you do not have a copy of mpd_oled running and then run


Code:
mpd_oled -o 6 -b 10 -g 1 -f 20 -c alsa,hw:Loopback,1


Adrian.
Reply
(03-22-2021, 06:57 PM)adrii Wrote: Hi officialsm

The disabled mixer does not seem to be a problem. I usually use an I2S DAC with software volume. Without changing the audio copy configuration, I changed to mixer type disabled (0db outout), and the spectrum worked fine. I then plugged in a USB DAC and tried the software, hardware and disabled mixers, and in all cases the spectrum worked fine without any changes to the audio copy configuration.

That led me to review your ouput again, and I think I have found the problem!

Code:
pi@Simoode-audio:~ $ ps ax | grep mpd_oled
 365 ?        Dsl    1:38 /usr/bin/mpd_oled -o6 -b 10 -g 1 -f 20
 390 ?        S      0:00 sh -c mpd_oled_cava -p /tmp/cava_config_IDWMau
 391 ?        Sl     0:16 mpd_oled_cava -p /tmp/cava_config_IDWMau
22266 pts/0    S+     0:00 grep --color=auto mpd_oled

You are running mpd_oled without specifying the loopback device as the audio source. In which case, make sure you do not have a copy of mpd_oled running and then run


Code:
mpd_oled -o 6 -b 10 -g 1 -f 20 -c alsa,hw:Loopback,1


Adrian.

What you wrote gave me the correct idea.
I forgot to disable mpd_oled at boot from the installation i have don ewith Moode 7.0.1. So it started as old package.
Now it is fixed and working.

The trobule is that now it doesn't start at boot. I have to run each time the command from prompt.
How can i enable it at boot?

Thank you
Reply
Hi officialsm

Install the mpd_oled service with

Code:
sudo mpd_oled_service_edit -o 6 -b 10 -g 1 -f 20 -c alsa,hw:Loopback,1

Then it will start at boot.

Adrian.
Reply


Forum Jump: