Digital Room Correction with the HiFiBerry DSP card

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • adamdea
    Senior Member
    • Apr 2010
    • 793

    #16
    @schoeppi @tw99 do you have any idea why I can't use the squeezelite command, or otherise how to set up squeezelite under minidspshd to control hardware vc

    Comment

    • ralphy
      Senior Member
      • Jan 2006
      • 3297

      #17
      It appears the squeezelite is not in your PATH and that's why the command fails.

      You can try running this command to try and locate it.

      find / -name squeezelite

      Mine returns

      /usr/local/bin/squeezelite
      Ralphy

      1-Touch, 5-Classics, 3-Booms, 2-UE Radio
      Squeezebox client builds donations always appreciated.

      Comment

      • adamdea
        Senior Member
        • Apr 2010
        • 793

        #18
        Thanks both i will have a go at adding /opt or wherever squeezelite is to the path

        Comment

        • adamdea
          Senior Member
          • Apr 2010
          • 793

          #19
          Code:
          volumiooem@minidsp-shd:/opt$ squeezelite -L
          Volume controls for default
          
          volumiooem@minidsp-shd:/opt$ squeezelite -l
          Output devices:
            null                           - Discard all samples (playback) or generate zero samples (ca                                            pture)
            default:CARD=Out               - I2S Out, ff010000.i2s-pcm5102a-hifi pcm5102a-hifi-0 - Defau                                            lt Audio Device
            sysdefault:CARD=Out            - I2S Out, ff010000.i2s-pcm5102a-hifi pcm5102a-hifi-0 - Defau                                            lt Audio Device
            dmix:CARD=Out,DEV=0            - I2S Out, ff010000.i2s-pcm5102a-hifi pcm5102a-hifi-0 - Direc                                            t sample mixing device
            dsnoop:CARD=Out,DEV=0          - I2S Out, ff010000.i2s-pcm5102a-hifi pcm5102a-hifi-0 - Direc                                            t sample snooping device
            hw:CARD=Out,DEV=0              - I2S Out, ff010000.i2s-pcm5102a-hifi pcm5102a-hifi-0 - Direc                                            t hardware device without any conversions
            plughw:CARD=Out,DEV=0          - I2S Out, ff010000.i2s-pcm5102a-hifi pcm5102a-hifi-0 - Hardw                                            are device with all software conversions
            default:CARD=SPDIF             - SPDIF, ff030000.spdif-dit-hifi dit-hifi-0 - Default Audio D                                            evice
            sysdefault:CARD=SPDIF          - SPDIF, ff030000.spdif-dit-hifi dit-hifi-0 - Default Audio D                                            evice
            dmix:CARD=SPDIF,DEV=0          - SPDIF, ff030000.spdif-dit-hifi dit-hifi-0 - Direct sample m                                            ixing device
            dsnoop:CARD=SPDIF,DEV=0        - SPDIF, ff030000.spdif-dit-hifi dit-hifi-0 - Direct sample s                                            nooping device
            hw:CARD=SPDIF,DEV=0            - SPDIF, ff030000.spdif-dit-hifi dit-hifi-0 - Direct hardware                                             device without any conversions
            plughw:CARD=SPDIF,DEV=0        - SPDIF, ff030000.spdif-dit-hifi dit-hifi-0 - Hardware device                                             with all software conversions
          
          
          ^Cvolumiooem@minidsp-shd:/opt$ squeezelite -o plughw:CARD=Out -L
          Volume controls for plughw:CARD=Out
          Am I right in thinking this means there is no volume control ascoiuated with the I2S out?
          If so how does volumio (non squeezelite) control the vc?

          Comment

          • ralphy
            Senior Member
            • Jan 2006
            • 3297

            #20
            Originally posted by adamdea
            Code:
            volumiooem@minidsp-shd:/opt$ squeezelite -L
            Volume controls for default
            
            volumiooem@minidsp-shd:/opt$ squeezelite -l
            Output devices:
              null                           - Discard all samples (playback) or generate zero samples (ca                                            pture)
              default:CARD=Out               - I2S Out, ff010000.i2s-pcm5102a-hifi pcm5102a-hifi-0 - Defau                                            lt Audio Device
              sysdefault:CARD=Out            - I2S Out, ff010000.i2s-pcm5102a-hifi pcm5102a-hifi-0 - Defau                                            lt Audio Device
              dmix:CARD=Out,DEV=0            - I2S Out, ff010000.i2s-pcm5102a-hifi pcm5102a-hifi-0 - Direc                                            t sample mixing device
              dsnoop:CARD=Out,DEV=0          - I2S Out, ff010000.i2s-pcm5102a-hifi pcm5102a-hifi-0 - Direc                                            t sample snooping device
              hw:CARD=Out,DEV=0              - I2S Out, ff010000.i2s-pcm5102a-hifi pcm5102a-hifi-0 - Direc                                            t hardware device without any conversions
              plughw:CARD=Out,DEV=0          - I2S Out, ff010000.i2s-pcm5102a-hifi pcm5102a-hifi-0 - Hardw                                            are device with all software conversions
              default:CARD=SPDIF             - SPDIF, ff030000.spdif-dit-hifi dit-hifi-0 - Default Audio D                                            evice
              sysdefault:CARD=SPDIF          - SPDIF, ff030000.spdif-dit-hifi dit-hifi-0 - Default Audio D                                            evice
              dmix:CARD=SPDIF,DEV=0          - SPDIF, ff030000.spdif-dit-hifi dit-hifi-0 - Direct sample m                                            ixing device
              dsnoop:CARD=SPDIF,DEV=0        - SPDIF, ff030000.spdif-dit-hifi dit-hifi-0 - Direct sample s                                            nooping device
              hw:CARD=SPDIF,DEV=0            - SPDIF, ff030000.spdif-dit-hifi dit-hifi-0 - Direct hardware                                             device without any conversions
              plughw:CARD=SPDIF,DEV=0        - SPDIF, ff030000.spdif-dit-hifi dit-hifi-0 - Hardware device                                             with all software conversions
            
            
            ^Cvolumiooem@minidsp-shd:/opt$ squeezelite -o plughw:CARD=Out -L
            Volume controls for plughw:CARD=Out
            Am I right in thinking this means there is no volume control ascoiuated with the I2S out?
            If so how does volumio (non squeezelite) control the vc?
            A hardware mixer might be obsured using plughw:

            I never use it as it "hides" the actual audio formats supported by the dac, which cripples many of the features that are built into squeezelite, like the resampler.

            Try

            squeezelite -o hw:CARD=Out -L
            Ralphy

            1-Touch, 5-Classics, 3-Booms, 2-UE Radio
            Squeezebox client builds donations always appreciated.

            Comment

            • adamdea
              Senior Member
              • Apr 2010
              • 793

              #21
              Originally posted by ralphy
              A hardware mixer might be obsured using plughw:

              I never use it as it "hides" the actual audio formats supported by the dac, which cripples many of the features that are built into squeezelite, like the resampler.

              Try

              squeezelite -o hw:CARD=Out -L
              I'm afraid that draws the same blank. I don;t know if this is relevant but alsamixer says this
              Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	19.7 KB
ID:	1573025This takes me back to wonderign how it is the volumio controls the dac vc.

              Comment

              • vco1
                Member
                • Apr 2018
                • 64

                #22
                Originally posted by cliveb
                I've long been vaguely interested in experimenting with DRC, but whenever I read about Inguz it looked a bit daunting. Added to that, my LMS runs on a Raspberry Pi 3, so there's no chance of doing the necessary processing at the server end.

                I seem to recall some discussions here about whether the HiFiBerry DSP cards could be used for this purpose. (Sorry, but I've done some forum searches and couldn't find the thread, but am pretty sure I'm not imagining it).

                So I've been experimenting with HiFiBerry's Raspberry Pi DIGI2 Pro SPDIF card and DSP add-on board. I can confirm that it's fairly straightforward to load the necessary filters into the DSP card, and when you reboot the Pi using another operating system (eg. piCorePlayer), the filters are still active. I would assume that the same would be true if you use the HiFiBerry DAC+DSP or Beocreate card instead. (I use the SPDIF card because I have Meridian active speakers with digital inputs, so didn't need a DAC).

                What I did find is that some of the facilities provided by the HiFiBerryOS seem a bit unreliable. In particular, they use an old version of Squeezelite that has problems with delays and failure to pause/seek, so my initial plan to run HiFiBerryOS as my Squeezelite player didn't work out. Also, their (experimental) room correction feature didn't work for me. I ended up using Room EQ Wizard to calculate the required filters, then added those filters manually using HiFiBerryOS's parametric EQ page. After adding the filters, you need to go to the DSP Programs page and instruct it to store the settings in the DSP card. Once that is done, you can shut down HiFiBerryOS and reboot into piCorePlayer.

                This is just a heads-up that it does all work rather well, but if anyone wants some more details, let me know.
                I'm plaanning on going the same route: Hifiberry Digi2 (Pro) + DSP Add-on foor room correction. But your post confuses me a bit if it's working fine with Squeezeplayer or not. Especially since you mention "Also, their (experimental) room correction feature didn't work for me." But you end with "This is just a heads-up that it does all work rather well".

                Would like to get more details. More in particular if the combo Pi4 + Hifiberry Digi2 (Pro) and DSP add-on is working for (simple) digital room correction.

                Comment

                • slartibartfast
                  Senior Member
                  • Jan 2010
                  • 13849

                  #23
                  Originally posted by vco1
                  I'm plaanning on going the same route: Hifiberry Digi2 (Pro) + DSP Add-on foor room correction. But your post confuses me a bit if it's working fine with Squeezeplayer or not. Especially since you mention "Also, their (experimental) room correction feature didn't work for me." But you end with "This is just a heads-up that it does all work rather well".

                  Would like to get more details. More in particular if the combo Pi4 + Hifiberry Digi2 (Pro) and DSP add-on is working for (simple) digital room correction.
                  Have a look at this thread first.


                  Sent from my Pixel 3a using Tapatalk
                  Living Room: Touch or Squeezelite (Pi3B) > Topping E30 > Audiolab 8000A > Monitor Audio S5 + BK200-XLS DF
                  Bedroom: Radio
                  Bathroom: Radio

                  Comment

                  • cliveb
                    Senior Member
                    • Apr 2005
                    • 2075

                    #24
                    Originally posted by vco1
                    I'm plaanning on going the same route: Hifiberry Digi2 (Pro) + DSP Add-on foor room correction. But your post confuses me a bit if it's working fine with Squeezeplayer or not. Especially since you mention "Also, their (experimental) room correction feature didn't work for me." But you end with "This is just a heads-up that it does all work rather well".

                    Would like to get more details. More in particular if the combo Pi4 + Hifiberry Digi2 (Pro) and DSP add-on is working for (simple) digital room correction.
                    As slartibartfast pointed out, there's another relevant thread here: https://forums.slimdevices.com/showt...Bass-Artefacts.

                    But here's a quick summary of what I discovered:
                    1. To set up the filters in the DSP card, you need to boot your RPi into HiFiBerryOS. Then you can manually add the filters required.
                    2. HiFiBerryOS does include Squeezelite, which would seem to imply that you can just run your RPi under HiFiBerryOS and use it as an LMS player. However, the version of Squeezelite they use is very old and I found that it was very unreliable. Therefore once the filters are loaded into the DSP card, you need to reboot the RPi into some other appropriate OS such as piCorePlayer, and the filters remain active.
                    3. To figure out what filters you need, HiFiBerryOS has a room correction facility, but I found that it simply didn't work, so I used REW to calculate the filters instead. I opened a thread on the HiFiBerry community about this (https://support.hifiberry.com/hc/en-...oom-Correction) and some others reported the same issue - that it didn't work with the Digi2Pro+DSP combination. The latest posting on that thread suggests that there's an experimental new release that fixes the issue with their room correction facility.

                    Having said all this, in the end I do NOT recommend using the DSP card for room correction. When I had the filters active, they produced some weird bass artefacts, sounding a bit like turntable rumble. It was fairly subtle, but once you've heard it, you can't ignore it.

                    As is discussed in the other thread linked above, it's a simple matter to set up a custom convert file in LMS to apply the required filters using SOX, and this approach doesn't produce those weird bass artefacts. I had initially thought that the RPi3 I use as my LMS server wouldn't have enough CPU power to run the filters, but it turns out not to be an issue.

                    If you've not yet bought the DSP card, don't bother. I have since sold mine on eBay. The Digi2Pro itself is a perfectly fine SPDIF interface for the RPi, but note that there are other similar cards available from other vendors. And if you have a USB capable DAC, then you don't need one at all.

                    I should have updated this thread with these conclusions, and I apologise for failing to do so. Consider this reply to be that update!
                    Until recently: Transporter -> ATC SCM100A, now sold :-(
                    House move forced change to: piCorePlayer(RPi2/HiFiBerry DIGI2 Pro) -> Meridian 218 -> Meridian M6

                    Comment

                    • BoxOfCables
                      Junior Member
                      • Sep 2021
                      • 22

                      #25
                      I meant to update that thread too...

                      It turns out there is a quirk with that rule, if you seek to a point in a track it doesn't apply. I've found it quite a useful way of A/B testing the EQ settings - play a song (the filters are applied), then use the time control to scrub back to near the beginning and the rule doesn't invoke, so you hear the song without the EQ.

                      It can be fixed by adding "# T" (without the quote marks) as a second line in the rule (according to the docs, have to admit I've not personally tested it).

                      Comment

                      • cliveb
                        Senior Member
                        • Apr 2005
                        • 2075

                        #26
                        Originally posted by BoxOfCables
                        I meant to update that thread too...

                        It turns out there is a quirk with that rule, if you seek to a point in a track it doesn't apply. I've found it quite a useful way of A/B testing the EQ settings - play a song (the filters are applied), then use the time control to scrub back to near the beginning and the rule doesn't invoke, so you hear the song without the EQ.

                        It can be fixed by adding "# T" (without the quote marks) as a second line in the rule (according to the docs, have to admit I've not personally tested it).
                        Sorry to reopen this thread, but I just revisited it to get some info and saw your comment about the filtering not working after a seek. I don't generally seek so hadn't noticed, but after seeing your comment I decided to check, and sure enough the EQ stops after a seek.

                        I tried adding the #T, but that appeared to just break the transcode rule completely. (No EQ applied at any time).

                        Then I saw this in the default convert.conf file:
                        Code:
                        flc flc transcode *
                        	# FT:{START=--skip=%t}U:{END=--until=%v}D:{RESAMPLE=-r %d}
                        	[flac] -dcs $START$ $END$ -- $FILE$ | [sox] -q -t wav - -t flac -C 0 $RESAMPLE$ -
                        I tried adding the line # FT:{START=--skip=%t}U:{END=--until=%v} to my custom-convert entry, but then whenever I tried seeking, it restarted the song.

                        (Incidentally, looking at the rule in the default convert.conf, and checking what processes are running on the LMS server, I suspect that what happens when you seek is that the custom-convert rule is abandoned and the transcode rule in the default file gets used).

                        Does anyone understand enough about this to explain exactly what needs to be put into the custom-convert file so that the rule continues to be used after a seek?
                        Until recently: Transporter -> ATC SCM100A, now sold :-(
                        House move forced change to: piCorePlayer(RPi2/HiFiBerry DIGI2 Pro) -> Meridian 218 -> Meridian M6

                        Comment

                        • cliveb
                          Senior Member
                          • Apr 2005
                          • 2075

                          #27
                          Originally posted by cliveb
                          Then I saw this in the default convert.conf file:
                          Code:
                          flc flc transcode *
                          	# FT:{START=--skip=%t}U:{END=--until=%v}D:{RESAMPLE=-r %d}
                          	[flac] -dcs $START$ $END$ -- $FILE$ | [sox] -q -t wav - -t flac -C 0 $RESAMPLE$ -
                          I tried adding the line # FT:{START=--skip=%t}U:{END=--until=%v} to my custom-convert entry, but then whenever I tried seeking, it restarted the song.

                          Does anyone understand enough about this to explain exactly what needs to be put into the custom-convert file so that the rule continues to be used after a seek?
                          OK, I think I've sorted this out so will post my findings here in case it helps anyone else.

                          My mistake was not understanding what's going on in the default convert.conf file. All I did was add the #FT line to my custom file. It looks as if when you seek during playback, LMS starts a whole new decoding operation, and expects the conversion rule to cope with starting at the seek position. Of course the rule in my file didn't have anything in it to define where to begin, and so the song started again from the start.

                          As far as I can tell, there isn't an option in sox to start at a specific place in the file, so we have to run a flac decode starting at the seek position and pipe its output through sox to re-encode to flac and do any other processing required - in my case the EQ for room correction.

                          So my custom convert file ended up as:
                          Code:
                          flc flc * b8:27:eb:e0:f9:75
                          	# FT:{START=--skip=%t}U:{END=--until=%v}
                          	[flac] -dcs $START$ $END$ -- $FILE$ | [sox] -q --multi-threaded --no-clobber -t wav - -t flac -C 0 - equalizer 54.3 2.831q -19.2 equalizer 71.1 3.982q +9.0 equalizer 75.2 7.677q -5.4 equalizer 89.3 11.271q -5.5 equalizer 148 13.429q -13.3 equalizer 202 5.0q -6.2 equalizer 225 5.0q +6.3
                          The mac address is there so the EQ is only applied to the relevant player, of course, and the various equalizer settings are for the room that player is in.

                          From the tests I've done so far, the seeking now works properly, and the room EQ is maintained after a seek.
                          Until recently: Transporter -> ATC SCM100A, now sold :-(
                          House move forced change to: piCorePlayer(RPi2/HiFiBerry DIGI2 Pro) -> Meridian 218 -> Meridian M6

                          Comment

                          Working...