Announcement

Collapse
No announcement yet.

Multisqueeze : Multiroom 6 zone squeezebox rackable system with equalizer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Multisqueeze : Multiroom 6 zone squeezebox rackable system with equalizer

    Hi,

    Since this open community helped me a lot from a while now, I owe you back at least what I've done .

    So we talk here about a rackable multiroom system of 6 zone based on a RPI PI 3 .

    the architecture is :

    RPI -> USB hub -> 6x DAC PCM2704 -> 6x TDA7498 2x100w amplifier

    Squeezelite instance can pilot GPIO on play/pause/stop state, then a DIY PCB board enable or disable the standby input of the amplifier (this avoid having bad "pop" sound and damage speakers) this board also cut the 24v power supply when there is no zone in use zone.


    Click image for larger version

Name:	152329938_1732937653554532_8319900058913159306_n (1).jpg
Views:	2
Size:	252.0 KB
ID:	1579082

    Main Hardware list :


    Software side :

    On a running PI ( for me Raspbian GNU/Linux 10 (buster)) ,

    First install Squeezelite : for example this tutorial

    To avoid zone mismatch, you have to "fix" or map your USB to have always the same DAC output, you can achieve this mapping based on this tutorial

    For me it looks like this :

    /etc/udev/rules.d/70-alsa-permanent.rules

    Code:
    SUBSYSTEM!="sound", GOTO="my_usb_audio_end"
    ACTION!="add", GOTO="my_usb_audio_end"
    
    DEVPATH=="/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.4/1-1.3.4.4:1.0/sound/card?", ATTR{id}="USB1"
    DEVPATH=="/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.2/1-1.3.4.2:1.0/sound/card?", ATTR{id}="USB2"
    DEVPATH=="/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.2/1-1.3.2:1.0/sound/card?", ATTR{id}="USB3"
    DEVPATH=="/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.3/1-1.3.4.3:1.0/sound/card?", ATTR{id}="USB4"
    DEVPATH=="/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.3/1-1.3.3:1.0/sound/card?", ATTR{id}="USB5"
    DEVPATH=="/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3.1/1-1.3.1:1.0/sound/card?", ATTR{id}="USB6"
    
    LABEL="my_usb_audio_end"
    To add an equalizer to each zone,you have to install Alsa equaliser plugin, you can follow this tutorial

    We then create an Alsa file like this :

    /etc/asound.conf

    Code:
    #USB1
    ctl.USB1 {
      type equal;
      controls "/opt/alsa/USB1.bin";
    }
    
    pcm.USB1 {
      type equal;
      slave.pcm "plughw:USB1";
      controls "/opt/alsa/USB1.bin";
    }
    
    #USB2
    ctl.USB2 {
      type equal;
      controls "/opt/alsa/USB2.bin";
    }
    
    pcm.USB2 {
      type equal;
      slave.pcm "plughw:USB2";
      controls "/opt/alsa/USB2.bin";
    }
    
    #USB3
    ctl.USB3 {
      type equal;
      controls "/opt/alsa/USB3.bin";
    }
    
    pcm.USB3 {
      type equal;
      slave.pcm "plughw:USB3";
      controls "/opt/alsa/USB3.bin";
    }
    
    #USB4
    ctl.USB4 {
      type equal;
      controls "/opt/alsa/USB4.bin";
    }
    
    pcm.USB4 {
      type equal;
      slave.pcm "plughw:USB4";
      controls "/opt/alsa/USB4.bin";
    }
    
    #USB5
    ctl.USB5 {
      type equal;
      controls "/opt/alsa/USB5.bin";
    }
    
    pcm.USB5 {
      type equal;
      slave.pcm "plughw:USB5";
      controls "/opt/alsa/USB5.bin";
    }
    
    #USB6
    ctl.USB6 {
      type equal;
      controls "/opt/alsa/USB6.bin";
    }
    
    pcm.USB6 {
      type equal;
      slave.pcm "plughw:USB6";
      controls "/opt/alsa/USB6.bin";
    }
    You have now your sound output with 10 bands equalizer :

    Click image for larger version

Name:	pi@multiroom ~_4.jpg
Views:	1
Size:	118.9 KB
ID:	1579083

    Next step is to create a way to launch 6 instances of Squeezelite at boot :

    this is achieved by a service than run as bash file

    You can follow this tutorial to create your service

    my mutiroom.service file

    Code:
    Description=Multisqueeze launch
    ConditionPathExists=/home/user/bin/opt/multiroom
    
    [Service]
    Restart=always
    RestartSec=3
    ExecStart=/home/opt/multiroom/multisqueeze
    
    [Install]
    WantedBy=multi-user.target
    This service will run this bash script :

    Code:
    #! /bin/sh
    
    # Run mutliple squeezelite instance as deamon 
    sudo squeezelite -z -n Cuisine -m 00:00:00:00:00:01 -o plug:USB1 -r 32000,44100,48000 -C 5 -G 4:H -f ~/squeezelite_cui.log
    sudo squeezelite -z -n Sam -m 00:00:00:00:00:02 -o plug:USB2 -r 32000,44100,48000 -C 5 -G 17:H -f ~/squeezelite_sam.log
    sudo squeezelite -z -n Sdb -m 00:00:00:00:00:03 -o plug:USB3 -r 32000,44100,48000 -C 5 -G 27:H -f ~/squeezelite_sdb.log
    sudo squeezelite -z -n Chambre_parents -m 00:00:00:00:00:04 -o plug:USB4 -r 32000,44100,48000 -C 5 -G 22:H -f ~/squeezelite_ch_par.log
    sudo squeezelite -z -n Exterieur -m 00:00:00:00:00:05 -r 32000,44100,48000 -o plug:USB5 -C 5 -G 19:H -f ~/squeezelite_ext.log
    sudo squeezelite -z -n Free -m 00:00:00:00:00:06 -r 32000,44100,48000 -o plug:USB6 -C 5 -G 26:H -f ~/squeezelite_res.log
    You can control GPIO, and define several option at squeezelite instance launch, I let you take a look at all these option HERE


    And that's it...

    At each boot, the script will run your definited numbers of Squeezelite instance as deamon

    You have then a complete mutiroom system with equalizer at low cost

    Click image for larger version

Name:	Invite de commandes.jpg
Views:	1
Size:	10.1 KB
ID:	1579084

    Click image for larger version

Name:	pi@multiroom ~_5.jpg
Views:	1
Size:	163.4 KB
ID:	1579085

    Hope it help, good luck .
    Last edited by Chestroled; 2022-08-22, 10:43.

    #2
    A great project, well executed.

    Comment


      #3
      I always admire this sort of thing.
      Looks like it would be readily achievable for a hobbyist with electronics skills.

      One thing ... the fake MAC addresses that Squeezelite will pass back to LMS might cause problems if you also link to mysqueezebox.com.

      If you want to use mysqueezebox.com then maybe use "locally administered" MAC addresses but make them similar to the MAC address of the host. That might reduce the chance of a clash at mysb.

      Paul Webster
      Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
      and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin

      Comment


        #4
        Originally posted by Paul Webster View Post
        I always admire this sort of thing.
        Looks like it would be readily achievable for a hobbyist with electronics skills.

        One thing ... the fake MAC addresses that Squeezelite will pass back to LMS might cause problems if you also link to mysqueezebox.com.

        If you want to use mysqueezebox.com then maybe use "locally administered" MAC addresses but make them similar to the MAC address of the host. That might reduce the chance of a clash at mysb.

        https://serverfault.com/questions/40...rtual-machines
        Hello, thanks for your point, I personally don't use my squeezebox services , but your message can help others people. So Mac adresses should have to be similar as other Mac adresses from the local network , right ?

        Thanks

        Comment


          #5
          ... adding to my thoughts ... perhaps mysb ignores non-slim/Logitech MAC addresses ... in which case it would not matter I suppose.
          Paul Webster
          Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
          and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin

          Comment


            #6
            Originally posted by Chestroled View Post
            So Mac adresses should have to be similar as other Mac adresses from the local network , right ?
            MAC addresses are assigned to manufacturers. They get a prefix and then it is up to them to make the rest of it unique (which does not always happen).
            So in your home environment you would have a wide variety of prefixes.

            There are some prefixes that are reserved for private use - like 192.168 or 10. in IP addresses.
            My thought was to create a private address set that is similar to the real MAC address of your ethernet connection in your Pi.
            e.g. take the real MAC - change the prefix ... then increment some part of the rest for each player.
            Paul Webster
            Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
            and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin

            Comment


              #7
              Originally posted by Paul Webster View Post
              MAC addresses are assigned to manufacturers. They get a prefix and then it is up to them to make the rest of it unique (which does not always happen).
              So in your home environment you would have a wide variety of prefixes.

              There are some prefixes that are reserved for private use - like 192.168 or 10. in IP addresses.
              My thought was to create a private address set that is similar to the real MAC address of your ethernet connection in your Pi.
              e.g. take the real MAC - change the prefix ... then increment some part of the rest for each player.
              Got it thanks 👍🏻

              Comment

              Working...
              X