LibreELEC 7.0.3 build with new, reworked Wolfson/Cirrus driver

  • I've been working on a major driver rework, removing the need to add a ton of patches to upstream Linux code, fixing several outstanding issues and adding some new features.

    Here are builds based on LibreELEC 7.0.3:
    RPi: LibreELEC-RPi.arm-7.0.3-HiassofT.tar
    RPi2/3: LibreELEC-RPi2.arm-7.0.3-HiassofT.tar
    Source code: GitHub - HiassofT/LibreELEC.tv at 7.0.3-cirrus-ng

    Note: the name of the soundcard has changed from "snd_rpi_wsp" to "RPi-Cirrus".

    One of the new features is proper AC3/DTS passthrough support via S/PDIF, including setting the S/PDIF channel status bits. Choose "RPi-Cirrus, S/PDIF" for that, this device will mute all other analog outputs.

    To use the analog outputs (plus S/PDIF) choose "RPi-Cirrus Analog" - this works as before in the previous versions and you can customize the mixer routing (mixing line-in into the signal etc).

    Customizing the mixer settings is now done via a shell script (instead of the udev rule):

    Code
    .config/rpi-cirrus-config.sh


    Use .config/rpi-cirrus-config.sh.sample as a template. This scripts makes use of a bunch of helper functions and definitons in /usr/lib/alsa/rpi-cirrus-functions.sh to simplify setup - you can either use these functions or simply add amixer statements as before (but note that you need to change the soundcard name).

    Note: These builds use the rather new Linux kernel 4.9. The current LibreELEC alpha builds also use this kernel but it's still possible that there are some (yet unknown) issues. Just drop me a line if something doesn't quite work as excpected.

    so long,

    Hias

  • Hi Hias,

    Thanks once more for your excellent work. I installed the 7.03 update yesterday - it just worked seamlessly. I haven't had a chance to check out any of the new features or settings yet, but will report back if anything appears broken.

    Will you be releasing anything based on the upcoming LE version 8 beta? Or will you wait for the official release?

    Happy New Year!

    John

  • Hi John,

    thanks a lot for the feedback!

    I haven't decided yet on 8.0 (beta) releases. I've got an 8.0 LE tree working here with the new driver, but IMO kodi 17 isn't quite ready for everyday use yet so I decided to release a 7.0 build with the new driver first and see how that goes.

    so long,

    Hias

  • Hi Hias,

    Im a end user and I just updated to 7.0.3 but now I can not update to another version.
    I use kodi jaris 16.1 on raspberry pi3

    Pls advice.

    Greets, Eric


  • Im a end user and I just updated to 7.0.3 but now I can not update to another version.
    I use kodi jaris 16.1 on raspberry pi3


    Have you update to the official 7.0.3 build or to the one linked from this forum topic? To which version are you trying to update to, which steps did you take to update and what exactly is happening?

    so long,

    Hias

  • Edited once, last by e01_03m (January 2, 2017 at 6:05 AM).

  • Hi Eric!

    I've run into a similar issue during testing, the problem most certainly comes from the Krypton Confluence skin not really working with Jarvis. You could try uninstalling the Confluence addon, then the built-in Confluence skin should be used.

    But there may have been other (newer, possibly incompatible) addons installed and you'll have newer database versions (which might cause troubles when you later update to Krypton) so it'd be better to do a soft or hard reset.

    BTW: If you used the integrated update feature you'll most certainly be using the official LibreELEC versions, not my builds - check in the system info, my build should show up as "LibreELEC (HiassofT)" instead of "LibreELEC (official)". In that case better post in the Bug Reports forum.

    so long,

    Hias

  • Hi Hias,

    I tried hard & soft reset, but nothing works.. no reaction.
    Could not make back up so I started all over.
    New year, new beginning! Yeah!
    Thanks for your advice, next time I now what to look for and will post in the bug forum.
    I think we "end users" should NOT be giving the option to update to a version that was intended to works on an other platform.
    Sounds logic to me.

    Thanks Hias.

  • Hi HiasSoft, thanks for the awesome software, wanted to use my wolfson audio card again after a while and found out you continued with LibreElec, ive got it up and running of SPDIF :) So i am very happy now! But while configuring i missed the frist installation steps you made in the 7.0 version Post:
    Quick first-time installation instructions:

    • First install an official LibreELEC RPi build
    • Download the Wolfson/Cirrus build and do a manual update (copy the tar file to the Update share or to /storage/.update/ on the command line and reboot)
    • After reboot add the following line to /flash/config.txt
      Code:
      Code
      dtoverlay=rpi-cirrus-wm5102
    • Reboot again to activate the config change
    • Go to Kodi system settings and change the audio output device to ALSA (snd_rpi_wsp S/PDIF)

    Maybe its and idea for following (new) users to include that with every version or make a start from scratch post?
    I found out i forgot to add dtoverlay=rpi-cirrus-wm5102 to my config.txt ;)

    But thanks anyway, im glad with the software! :)

  • Hi, HiassofT
    Are you still there?
    I just registered to the forum, because I cannot get any sound from the Wolfson card - maybe you can give me some advice....
    I have RPi 2B and I installed your version of libreelec 7.0.3.
    I think I did everything as in the description - edited the config file and selected the card in the settings - so it should be ok, but there is no sound...
    All I need is to listen to tidal, youtube etc - do I have to run/edit rpi-cirrus.config.sh for that ? What else could be missing ?

    Also one more question : did anybody notice that when we connect RPi2 and Wolfson, some of the 8 big pins from Wolfson make contact with elements on the Pi board ? Is it supposed to be like this? I put some tape there not to short anything.

    Best regards


  • Also one more question : did anybody notice that when we connect RPi2 and Wolfson, some of the 8 big pins from Wolfson make contact with elements on the Pi board ? Is it supposed to be like this? I put some tape there not to short anything.


    This sounds like you are trying to use the original Wolfson card for the RPi1 (with 26 pin GPIO connector plus 8 pogo-pins for the P5 connetor). If that's the case - sorry, that won't work, you need to use the Cirrus card (with 40 pin GPIO and no pogo pins) on RPi2 (and all other B+ models with 40-pin GPIO connector).

    so long,

    Hias

  • One more problem - I get loud clicks between tracks when playing some albums on Tidal, or changing youtube videos..
    My speakers are pretty loud, but I think there should beno clicks at all.
    Is there a fix for this?
    I tried to set the option 'keep audio device alive' to 'always' , but no difference

    Regards
    Tomek


  • One more problem - I get loud clicks between tracks when playing some albums on Tidal, or changing youtube videos..
    My speakers are pretty loud, but I think there should beno clicks at all.
    Is there a fix for this?
    I tried to set the option 'keep audio device alive' to 'always' , but no difference


    Do you also get these clicks when playing local music files?

    So far I haven't noticed these. There'll be a quite faint click when the audio card is turned off after the default 1min idle time, but that was it.

    You could try changing the resampling quality in system settings->audio (make sure you are in "Advanced" or "Expert" mode) an see if that makes a difference. And/or try changing the output configuration to fixed.

    Last but not least it could also be a problem with the audio/video tracks you are playing.

    so long,

    Hias

  • I've experienced clicks too, and have established that they usually occur when the sample frequency of the source files changes. eg. listen to a file or album with 44.1KHz sampling, then change to a file or album with 96KHz sampling - this produces an audible click. I tried changing a few options in the audio settings, but nothing seemed to make much difference - maybe I didn't find the correct combination.

    I assume that the clicks tomasz1500 hears when changing the source material between Tidal and Youtube is caused by the different sample rates of the different sources.

    I haven't looked at the schematics of the Cirrus card in any detail, but wouldn't be surprised if there is an option to 'soft mute' briefly when a change in input sample rate is detected. There again, I'm often wrong.

    John

  • Could you try setting the audio configuration to Fixed, for example 96kHz and see if you still get clicks?

    The driver for the WM5102 soundchip (which comes from the upstream linux kernel) is designed to be run at a fixed internal clock rate which is a multiple of the samplerate. This means it can support 32kHz, 48kHz, 96kHz, 192kHz (or 44.1, 88.2, 176.4kHz) without needing to change the internal clock. But switching between these 2 families, eg from 44.1kHz to 48kHz is tricky: the internal clock needs to be reconfigured which can cause glitches.

    Muting the outputs is also a little bit tricky and the S/PDIF output doesn't have a mute setting at all - so it's not really easy to mute all outputs.

    So, I'm aware of possible problems but currently don't have a solution for that that'd work for all configurations.

    I have to add that I've been using the card with S/PDIF-out and Line-out and so far didn't experience any loud clicks yet.

    so long,

    Hias

  • Hi Hias,

    Sorry about the long delay in replying. Testing so far shows that setting the audio config to 'fixed' at 96KHz appears to stop the clicks and splats when the input files change between 192KHz, 96kHz and 44.1kHz. Thanks for the tip!

    Regarding muting, I assumed that the soundchip might be similar to other Cirrus chips I worked with in the past (many options for muting all sections), but as the chip came from Wolfson originally, I assumed wrongly.

    Sometime soon I might try fixing the audio config to 192KHz to see if that also works. I might even get time to test the various output configs to find out which might be generally optimal for THD+n, etc. I have the equipment, but unfortunately not much time recently.

    Cheers,

    John

  • Update: I tried fixing the audio config to 192kHz, but ran into another problem. Input files with sampling frequencies up to 96kHz played back fine, but files at 192kHz didn't - the audio was chopped up a few times per second, sounding terrible.

    So, fixing the audio config to 96kHz seems to be the best option.

    Cheers,

    John

    Edited once, last by JohnnyL (February 19, 2017 at 11:30 AM).