Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 10 of 10
  1. #1

    Cirrus Logic Audio Card and Wolfson support in PCP 3.20

    Starting from the new kernel ( 4.9.x ) in Picoreplayer 3.20 Beta the great work of Hias has started become available to people who like the simplicity and stability of running PCP as basis to squeezelite.
    The mentioned Pi audio card is one of the most advanced cards with great specs, that do go beyond what PCP will use.

    As I had 2 CLAC's gathering dust , and spare pi's to match, I started some test to revive the old hardware.

    Just recently I got the cards to become visible through :

    ~$ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
    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 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: RPiCirrus [RPi-Cirrus], device 0: WM5102 AiFi wm5102-aif1-0 []
    Subdevices: 1/1
    Subdevice #0: subdevice #0

    However the boot proces is not automatic and needs manual intervention.

    Currently the driver does only register if I change something on the USB bus roughly AFTER the boot message
    udevadm settle - timeout of 5 seconds reached, ....
    is displayed.
    The correct initialisation of the card can be seen from the RED led on the CLAC
    During the initial parts of the boot it turnd off , but at the end of the end of the 'loading extensions ' part it comes back on.
    If I plug in something 'new' on the usb bus the red led turns off again, and the output of aplay -l does alter, adding the RPiCirrus device.
    Currently I can reproduce the start of the driver/device by simply re-plugging my mouse from 1 to the other port on my KBD built-in USB hub, even if this is 2 minutes after boot time.
    It allows me to remotely log in over the WIFI , check through aplay -l , to verify the device is not jet seen.

    Obviously some modules prevent the driver / device to install properly and I jet do not know the cause and the solution.
    Who can help to crack the final parts , that allows me to document how this card can be used in PCP ?

    For anyone that want to replicate, you obviously need the hardware, and I am sorry to tell HW productions seems to have stalled, and proper driver support might have arrived too late to support sales and more production.
    The basic start is a clean PCP 320, although it was tested to work OK on Beta 7, and probably Beta 5 could work to.
    In the 320 Beta thread, most info is found but a short version :
    http://www.horus.com/~hias/cirrus-driver.html

    /etc/modprobe.d/cirrus.conf => /etc/modprobe.conf
    sqeezelite is started with '-n piCorePlayer-test -o hw:CARD=RPiCirrus -a 80 4 1'
    Backup! your changes with 'pcp bu' before any reboot !
    Save all your settings outside the PCP partitions if you do an isitu upgrade ( warnings are in the procedure )
    And as squeezelite does not have the card driver available at first start, be prepared to check and restart it .
    If al starts and there is no sound, verify the use the usescripts provided by Hias, and the volume.

    Regards M-H
    Edit: added dmesg file
    Attached Files Attached Files
    Last edited by M-H; 2017-04-25 at 16:49. Reason: Added dmesg output for debugging

  2. #2
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    608
    Yes, from what I've read the DAC has went out of production, so no more boards, unless someone has a stockpile of chips. That goes to show what happens if you don't have a functioning driver when you try to sell hardware. Seems to be a lesson that a lot never learn.


    If you can, hook up a monitor/keyboard, and just debug from the console.

    After pCP is fully started. Try running

    sudo udevadm trigger

    See if anything happens.

  3. #3

    busybox does lack softdep ?

    Quote Originally Posted by paul- View Post
    ...
    If you can, hook up a monitor/keyboard, and just debug from the console.

    After pCP is fully started. Try running

    sudo udevadm trigger

    See if anything happens.
    I did work from the console, but due to lack of knowledge , have not found a way to load all the modules in the correct order from the boot process only.

    The list is
    arizona/wm5102 depends on
    arizona_ldo1 depends on
    arizona

    Hias hinted to me the modprobe from busybox does lack softdep
    And his set relies on softdep, to work its way around the kernel module sequence problems.
    This is just the info he gave me, and I jet have to understand the way these techniques work to comment on that.

    Still It does wonder me that a USB insert does finish the module load procedure, and does allow me to use the driver from that moment.
    So if I was able to emulate that event, and if really needed load the squeezelite instance with a delay or from a test loop, the setup could work without human intervention to set to a working state.

    I will start to see how busybox modprobe does work , and find ways to perhaps make it more persistent to load the modules .

    Regards M-H

  4. #4
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    608
    Sorry missed this response. The lack of Softdep support sounds like the main problem, I've never heard of softdep before now. The only way around it would be to include the full version of modprobe in the initrd......

    Here is a reference link to rebuild your initrd

    http://forum.tinycorelinux.net/index....html#msg88856

    You can also create a new initrd file system with just the new modprobe in it, then concatenate it to the end of the current initrd.

  5. #5

    Loading all cirrus modules in PCP

    Quote Originally Posted by paul- View Post
    The lack of Softdep support sounds like the main problem, I've never heard of softdep before now. The only way around it would be to include the full version of modprobe in the initrd......

    Here is a reference link to rebuild your initrd

    http://forum.tinycorelinux.net/index....html#msg88856

    You can also create a new initrd file system with just the new modprobe in it, then concatenate it to the end of the current initrd.
    Thanks Paul.
    I've been reading on the modprob discussion, but attacking this issue with a custom built auto boot part is is bit out of my reach at this moment.

    However with lsmod I have identified 4 modules that are not loaded automatically and loaded them manually :
    Code:
    sudo modprobe arizona_micsupp
    sudo modprobe gpio_arizona
    sudo modprobe snd_soc_wm5102
    sudo modprobe snd_soc_arizona
    This does result in a similar lsmod output as when a usb device is plugged in, but the device is not recognised with f.i. aplay -l .
    But a usb add event will still finish the job, so it has not disturbed the process.
    Experimenting with udevadm trigger has not led to anything new.

    So to anyone: Can you give me hints on what I could do to either initialise the modules correctly after plain loading them .
    Or to emulate a USB-add-event that hopefully does the same as the manual action.

  6. #6
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    608
    You can ask the guy who built the driver if you can not use the dtoverlay, and then load all of the modules manually in the proper order.

  7. #7

    First full auto startup of PCP3.20 with Cirrus Logic Audio Card

    Quote Originally Posted by paul- View Post
    You can ask the guy who built the driver if you can not use the dtoverlay, and then load all of the modules manually in the proper order.
    Indeed, that did the trick.
    I've now got a setup that does boot and fix the drivers and set the specific routes within the audio card to come to a functional situation without any human intervention.
    I even got the alsa equalizer to work with card 1 ;-)
    But we are not there.
    ATM I have to reload the module arizona_spi after boot.
    and this takes a lot of time, and I even have to insert delays to get the script to function reliable, and restart squeezelite because it failed to see the card at initialisation.

    So I created the next script bump.sh and call it from the User commands in the web GUI ( TWEAKS tab )

    Code:
    sudo modprobe -r arizona_spi
    sleep 1
    sudo modprobe arizona_spi
    sleep 3
    /usr/local/etc/init.d/squeezelite restart
    sleep 1
    cd /home/tc/usescripts
    ./Playback_to_Speakers.sh
    How can we cleanup all this and put it in some form that is more usable ?
    Ultimately I would like it to be incorporated in PCP as a standard sound card that can just be chosen to be used by less experienced users.

    First I should see how to prevent the module arizona_spi to load at all during boot, and avoid to have it removed.
    Then the sleeps should get replaced with a proper decision wetter the initialisation has completed successfully.
    And the outputs should all be enabled , or some user selection should be allowed through predefined 'versions' of the driver/card.

    Lastly the integration with the alsa equalizer should be fixed.
    Perhaps it is due to te fact I have the card set as 1 with the analoge output as 0.

    Enough for now;
    People with interest to get a Cirrus Logic Audio Card Or Wolfson card working in PiCorePlayer try to trace my steps so far, wait for a write-up I will make later, or ask for hints.
    ( my set = pi B+ , CLAC, powered via barrel connector , speakers-out to reasonable big HIFI speakers, wifi dongle )

    Regards M-H

  8. #8
    Junior Member
    Join Date
    Mar 2014
    Posts
    22
    Great! So what did you select for the soundcard in PCP web interface? I think that's required to load the i2s modules in the first place isn't it?

  9. #9

    CLAC Selection fields

    Quote Originally Posted by Girth View Post
    Great! So what did you select for the soundcard in PCP web interface? I think that's required to load the i2s modules in the first place isn't it?
    Hi Girth ,
    The sound card selected in the web interface is : Analog audio for the audio output field , and "equal" for the Squeezelite output field.
    Combined with an edit of the \etc\asound.conf where

    Code:
    pcm.plugequal {
            type equal;
            slave.pcm "plughw:1,0";
            controls "/home/tc/.alsaequal.bin"
            library "/usr/local/lib/ladspa/caps.so"
    was changed to use card 1 ( bold part ) .

    If you do not care about the equalizer , it is simpler.
    Forget about the \etc\asound.conf and set the squeezelite output to "hw:CARD=RPiCirrus".


    Be sure to follow Hias his setup first to load the correct drivers and then tweak the arizona_spi to complete the initialisation of the modules till you get a 2nd soundcard ( #1) in your aplay -l output.
    It is definitely not without tweaks at this moment.

    Good luck. ! M-H

    Edit: squeezelite output to "hw:CARD=RPiCirrus".
    Last edited by M-H; 2017-05-20 at 13:24.

  10. #10
    Junior Member
    Join Date
    Oct 2011
    Posts
    19

    Great work!!!

    Great stuff M-H. Would be good if this could somehow become part of PiCorePlayer, to allow for really simple configuration.

    Thanks!!!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •