1 21 22 23 24 25 368 Replies Latest reply on Oct 14, 2018 12:18 PM by hiassoft Go to original post
      • 330. Re: New reworked driver for Wolfson/Cirrus Logic audio card
        hiassoft

         

        but I'm not able to get the default sound card to be card 0, even though that is the card 0 shown when I run `$ aplay -l`. Disabling the default soundcard by commenting out dtparam=audio=on in /boot/config.txt makes the Raspberry Pi unusable. The desktop GUI loads but keeps bouncing. The top menu does not display and the system is not usable. Any clue on what to check for?

        This is very odd. Disabling the RPi default sound device shouldn't make the GUI unusable - I've never seen that on Raspbian.

         

        I guess it's best if you contact the COSMO developers and ask them what's going on there. Maybe they use some special alsa or jack config on their images.

         

        so long,

         

        Hias

        • 331. Re: New reworked driver for Wolfson/Cirrus Logic audio card
          alweekes

          For anyone concerned about the Wolfson card's sensitivity to PSU noise from some power supplies, I implemented a simple capacitance multiplier filter onto the unit I use as a headless bedside Squeezebox (for headphone listening) and the results are impressive for a very simple, cheap circuit.

          https://alw-audio.co.uk/?p=657

          1 of 1 people found this helpful
          • 332. Re: New reworked driver for Wolfson/Cirrus Logic audio card
            alweekes

            Hi Matthias,

             

            I've been doing some measurements on the sound card today checking operation at low levels with 24bit input files. The first file I tried was a -100dB 24 bit test file (https://www.rme-audio.de/old/download/100_24.zip ) and there was no output from the Wolfson card, despite the noise floor being some 20-30dB lower than this.

             

            I then created a 24/96 level sweep from -60dBfs to -144dBfs (https://drive.google.com/drive/folders/1xasQQHTxsowbhRmaT08l5WEa5jXm5l3N?usp=sharing ) and when playing this back on the Wolfson card the output disappears at just below -90 something dB, implying 16bit operation. The noise floor is way below this, so I tried the same file through a Chromecast Audio, which still outputs well below -110dBfS.

             

            I'm going to try a test with the original Wolfson driver, but is it possible there's a bug somewhere in the driver code that's truncating to 16bits?

             

            I'm playing back directly to the Wolfson hardware, the mixer output is set to 0dB and the output of /proc/asound/card0/pcm0p/sub0/hw_params shows the card is at the right sample rate and bit depth. I've used Squeezelite and mpd and both give the same results.

             

            Will report back after more testing, but if there's anything I can do to help give more info, please ask.

            • 333. Re: New reworked driver for Wolfson/Cirrus Logic audio card
              alweekes

              Ok, so an update, I loaded the original Raspbian image that was supplied as part of the original Wolfson release and it suffers the same problem (tried on two separate cards, one unmodifed, the other with the PSU filter mods, so it's not related to that at all.

               

              I'm beginning to think that something is messed up in the hardware design now? I've just played the same file back using my PC's Focusrite 2i2 and you can see the signal disappear into the noise floor. I'll try it again using the Pi and a USB sound card attached.

              • 334. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                hiassoft

                Audio output vanishing below -90dB could mean the noise gate is kicking in - it is set to -90dB by default.

                 

                Could you try disabling the noise gate?

                amixer -c RPiCirrus sset "Noise Gate" off

                 

                It would also be interesting what happens if you change the noise gate threshold (it's adjustable from -102dB to -60dB in 6dB steps)

                amixer -c RPiCirrus sset "Noise Gate Threshold" -- "-102dB"

                 

                so long,

                 

                Hias

                1 of 1 people found this helpful
                • 335. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                  alweekes

                  Hias,

                   

                  Thank you for the tip, I'll try this a bit later. Hopefully that's all it is!

                   

                  Andy

                  • 336. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                    alweekes

                    Hias,

                     

                    Another huge thanks for your help, it was the noise gate!

                     

                    This is a curious default setting, the point of the card is its ability to utilise 24bit sources, yet the -90dB gate is limiting resolution to < CD dynamic range.

                     

                    Is there an easy way to default to off, or should I just run a script at startup? <edit: it seems to be sticky, with the setting surviving a reboot>

                     

                    Andy.

                    • 337. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                      alweekes

                      If anyone is interested in seeing the effect of the noise gate, I've made a short video to demonstrate. Anyone using this card for high-resolution audio should definitely disable it!

                       

                      https://youtu.be/Abzr4QrrjKU


                      • 338. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                        hiassoft

                        The -90dB noise gate default comes from the wm5102 driver (according to the datasheet the chip's default is to use a -60dB noise gate).

                         

                        I didn't want to change this default in my mixer scripts, but I've disabled the noise gate in LibreELEC's default card config because it has another negative side effect - the noise gate attenuates the first "click" sound from Kodi a lot (probably the time until the noise gate opens is too long for the rather short click sound, cutting off most of it).

                         

                        so long,

                         

                        Hias

                        1 of 1 people found this helpful
                        • 339. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                          psyj

                          Andy and Hias,

                           

                          Well spotted this problem,  I had not noticed it. Of course this setting does not detract during "normal" 24 bit listening, just those moments which are extremely quiet, but there are circumstances when you might want very low level outputs (eg the output attenuators are at max)

                           

                          It seems we have four possible courses of action:-

                           

                          1) Ignore the problem

                          2) Disable the noise gate

                          3) Shift the threshold of the noise gate down

                          4) Increase the hold off time on the noise gate (perhaps in conjunction with 3)

                           

                          Which do you think is the best?  My personal guess is leave the noise gate active (perhaps at -102dB) but increase its activation time to 500mS.  However, it would mean that at the start of a new track (when the noise gate has been activated) there would be a progressive ramp up of volume  ..... I have no idea whether the default 6dB/mS represents an audible effect.  ...... though Hias notes that this aids with certain clicks and pops

                           

                          But what are the relative benefits?

                           

                          Regards

                           

                          John

                           

                          (And my apologies to all for not making a contribution in recent months ...... I thought the thread had gone dead, but in reality Element14 decided to stop sending me notifications)

                          1 of 1 people found this helpful
                          • 340. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                            alweekes

                            I think for a music player, I'd default to disabled. I've not yet heard any untoward effects from disabling it, the chip seems well behaved and there's no clicks or pops in normal use that I've seen.

                             

                            I wasn't aware (although it makes sense) that there's an adjustable time for the gate (attack and decay?). Are these variables documented anywhere, I'm happy to RTFM

                             

                            Andy

                            • 341. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                              hiassoft

                              I'd also say just disable the noise gate. There are certainly applications where a noise gate can be useful but in general I think it's best to have it off.

                               

                              The parameters of the noise gate are described in the WM6102 datasheet on page 170: https://d3uzseaevmutz1.cloudfront.net/pubs/proDatasheet/WM5102_v4.2.pdf

                               

                              These registers are exposed by alsa mixer controls so it's easy to tune them.

                               

                              If you are keen to look into stuff the DRE controls would be interesting (see "amixer controls | grep DRE"). These controls were added a while back in this commit: https://github.com/torvalds/linux/commit/7c470373e097822ce6ca7bbac44b3afec0e7c1f8 but there's no documentation about that in the datasheet.

                               

                              The OSR / "High Performance" settings could be interesting, too, but they are set at maximum performance per default and are documented in the datasheet. So probably changing these will only decrease power consumption and performance.

                               

                              so long,

                               

                              Hias

                              1 of 1 people found this helpful
                              • 342. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                                psyj

                                As Hias mentions, details in the hardware manual,  but easy access (thanks to Hias!) through commands like

                                 

                                amixer -c RPiCirrus sget "Output Ramp Up"

                                amixer -c RPiCirrus sget "Output Ramp Down"

                                amixer -c RPiCirrus sset ...........

                                 

                                And I will go with the two of you, gate off

                                • 343. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                                  johnlanc

                                  Hi Hias,

                                   

                                  I use the CLAC with a Pi3B+ running LibreELEC, listening mainly to FLAC files.

                                   

                                  A while ago I noticed that the line o/p was picking up digital noise, most obvious soon after turning the system on, while kodi was updating the music library (the audio files are stored elsewhere in the LAN on a NAS). I played around with the line o/p volume setting, raising it until the WM5102 limiter kicked in, then backing off a few dBs. Once the external audio power amplifiers were turned down to compensate for the increased output levels from the sound card, this noise pickup was less audible.

                                   

                                  The recent discussion here about PSU noise got me thinking about this again. I'd like to try raising the line o/p volume limit threshold, so I can increase the line o/p level still further, but can't see any mention of the volume limiter control register in either 'rpi-cirrus-config.sh' or 'rpi-cirrus-functions.sh'.

                                   

                                  Thanks for any ideas.

                                   

                                  John

                                  • 344. Re: New reworked driver for Wolfson/Cirrus Logic audio card
                                    hiassoft

                                    Although the WM5102 has configurable volume limits I don't think they'll help you with what you're trying to achieve. They aren't exposed as alsa controls and kept at the chip's default (+0.5dBFS). And they operate in the digital domain and are intended to avoid clipping in the DACs. The DACs recommended maximum output level is 0dBFS and the default config for the card in the mixer scripts (both in Raspbian and LibreELEC) set up the card to unity gain (0dB), which is the maximum that'll work for all input files.

                                     

                                    Although you can raise the output level to eg 6dB when you are playing a file that's been mastered to maximum -6dB that setting won't work well if you try to play a file mastered to eg -3dB or 0dB - these files would then run into clipping, as 3dB or 6dB output levels aren't supported, 0dB is the maximum.

                                     

                                    So, if you have problems with a noise power supply line you have to fix it at that level - use a better power supply and/or apply filtering on the power supply rail.

                                     

                                    so long,

                                     

                                    Hias