RockPro64 SPDIF/TOSLINK

  • After my cubox is not supported any more I ordered a Rock64Pro to use instead. I need TOSLINK to connect audio and looked around for a solution like for the audio board for the Rock64 that does not work on the Rock64Pro.

    I found the this forum message with a description how to connect SPDIF/TOSLINK to pins on the Rock64Pro.

    Did anybody try this, yet? Is there information whether audio routing with LibreELEC would work through such a connection?

  • Just got my Rock64Pro and started it with LibreElec. Still need to connect it via toslink:

    - Looked around to find a vendor for DLT1150A or a similar toslink f.e.m.a.l.e connector, but just found offers for a whole box (2000 pieces) of them. Any idea where to get the connector (from Germany)?

    - Looked at "Audio output devices" in LibreElec and found 4x ALSA (Default: HDMI Analog, HDMI Analog, HDMI HDMI, ES8316 Analog) and a Pulse Bluetooth Audio. Which one would be the right output to get a signal on the SPDIF header?


    Thanks, Chris

    PS: My message contains the censored word "f.e.m.a.l.e" as part of the technical name of the thing one can plug a toslink cable into. I'm not an english native speaker and its been the only translation I found.

  • Thought some more about it. Build my own image - cool build process :) .

    Compared config.gz and dtb of Armbian to the ones of LibreElec and found differences.

    Made some changes to .config of the kernel package in LibreElec (funny, I had to change the package directory to get a rebuild of the package - changing the kernel configuration didn't do the trick) and changed some minor difference in the dtb.

    I'm still reading about these things as I'm new to them.

    Well, I'm stuck with this message on serial console when starting:

    Code
    [    2.128560] rockchip-spdif ff870000.spdif: Missing dma channel for stream: 0
    [    2.129312] rockchip-spdif ff870000.spdif: ASoC: pcm constructor failed: -22
    [    2.130055] asoc-simple-card spdif-sound: ASoC: can't create pcm ff870000.spdif-dit-hifi :-22
    [    2.130946] asoc-simple-card spdif-sound: ASoC: failed to instantiate card -22

    Don't know how to cure this. The system is otherwise working fine, but no spdif out.

  • Sometime giving the thought about an approach some time helps. Not this time. I'm stuck.

    I'd bet that there is only something really small to change to get the spdif output for rockpro64 working since the difference to the dtb and kernel of armbian is so slight. But I don't see my approach to pin it.

    Nobody else out there running rockpro64 and thinking about using a digital output ;) ?

    Anybody who can point me in the right direction to look to find the difference?

  • That's actually pretty easy to achive:

    RockPro64 devicetree has all i2s engines enabled by default: You'll just have to disable the unused (i2s0, iirc - i2s1 is used for the analog codec and i2s2 for hdmi) and enable spdif (and spdif-dit). Reason behind is, that the dma controller does not support all channels which are connected to it at the same time and the upstream pl330 driver does not support virtual channels (yet).

    Also you should check if the second pin of the spdif header outputs the voltage (> 3V) which is needed drive the optical output (maybe there is another pinctrl required - check schematics for that) - or try first by connecting via coax by using spdif_tx and gnd only.

  • Hey, thanks for the information! You made my day! I'll check and get back...

    ...later:

    With your information at hand I compared the armbian dtb with the libreelec dtb again and found how to do it:

    In 'spdif@ff870000 {' I changed 'status = "disabled";' to 'status = "okay";'.

    To disable some other output I changed in 'i2s@ff880000 {' 'status = "okay";' to 'status = "disabled";'.

    There's been sound on the optical output :). I still have to test whether it really works without errors or glitches, but it is definitely the right track I'm on.

    Wouldn't it be a nice idea to put an alternative dtb inside the RockPro64 image so that it is easier for users to change to spdif?

    Edited once, last by ChriChri (November 19, 2021 at 8:39 PM).

  • works without errors or glitches

    Sadly it doesn't. The sound is nearly good, but it is stuttering every ~10seconds.

    Any idea what else I could do?

    I successfully tested the output in armbian and it just worked fine. So it shouldn't be a hardware issue.