Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Config | Odroid C2: Support for HiFi Shields with mainline kernel #5235

Open
berni2a opened this issue Feb 3, 2022 · 28 comments
Open

Comments

@berni2a
Copy link

berni2a commented Feb 3, 2022

Creating a bug report/issue

Required Information

  • DietPi version | v8.0.2
  • Distro version | 6
  • Kernel version |
  • SBC model | 12
  • Power supply used | 5V 2A
  • SDcard used | (EG: SanDisk ultra 16 GB

Additional Information (if applicable)

  • Software title | Sound Config
  • Was the software title installed freshly
  • Can this issue be replicated on a fresh installation of DietPi? --> yes
  • Bug report ID | 381f75d9-0651-4b34-8354-ae6c16b50785

Steps to reproduce

  1. ...Wanted to change sound card to: odroid-hifishiel-plus
  2. ...

Expected behaviour

  • ...should change

Actual behaviour

  • ...ended with error message:
  • Command: modprobe snd-soc-pcm5103 snd-soc-odroid-dac
  • Exit code: 1
  • ...
  • modprobe: FATAL: Module snd-soc-pcm5102 not found in directory /lib/modules/5.10.81-meson64

Extra details

  • ...
@MichaIng
Copy link
Owner

MichaIng commented Feb 3, 2022

Many thanks for your report.

I feared that with the new mainline kernel image the required modules have changed. The same should be true for the odroid-hifishield-2, i.e.

modprobe aml_i2c snd-soc-pcm512x snd-soc-pcm512x-i2c snd-soc-odroid-dac2

Fails the same way, probably not for aml_i2c but for the sound drivers themselves.

We need to check which ones are required, or whether it is actually required to manually load any kernel driver. Can you try to proceed by using the "Change command" option from the error prompt and replace everything with a single colon :? Then see whether it does work.

Also, is the DAC/shield probably listed in the "Auto detection" section already?

@MichaIng
Copy link
Owner

MichaIng commented Feb 3, 2022

Also, regarding another topic, can you please paste the output of:

cat /proc/interrupts

@MichaIng MichaIng added this to the v8.1 milestone Feb 3, 2022
@berni2a
Copy link
Author

berni2a commented Feb 3, 2022

root@DietPi:/var/log# cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3
  9:          0          0          0          0     GICv2  25 Level     vgic
 11:      15465      17064      15490      18509     GICv2  30 Level     arch_timer
 12:          0          0          0          0     GICv2  27 Level     kvm guest vtimer
 14:          0          0          0          0     GICv2 169 Level     arm-pmu
 15:          0          0          0          0     GICv2 170 Level     arm-pmu
 16:          0          0          0          0     GICv2 185 Level     arm-pmu
 17:          0          0          0          0     GICv2 186 Level     arm-pmu
 20:          0          0          0          0     GICv2  53 Edge      c1108500.i2c
 21:          2          0          0          0     GICv2 105 Edge      c1108680.adc
 23:          3          0          0          0     GICv2 225 Edge      ttyAML0
 24:          4          0          0          0     GICv2 228 Edge      c8100580.ir
 25:          0          0          0          0     GICv2  76 Edge      vdec
 26:          0          0          0          0     GICv2  64 Edge      esparserirq
 28:       1777          0          0          0     GICv2 241 Edge      platform_mhu_link
 29:       2275          0          0          0     GICv2 242 Edge      platform_mhu_link
 30:       1286          0          0          0     GICv2  40 Level     eth0
 31:       6790          0          0          0     GICv2 249 Edge      d0072000.mmc
 32:         13          0          0          0     GICv2 250 Edge      d0074000.mmc
 33:          0          0          0          0     GICv2 192 Level     gp
 34:          0          0          0          0     GICv2 193 Level     gpmmu
 35:          0          0          0          0     GICv2 194 Level     pp_bcast
 37:          0          0          0          0     GICv2 196 Level     pp0
 38:          0          0          0          0     GICv2 197 Level     ppmmu0
 39:          0          0          0          0     GICv2 198 Level     pp1
 40:          0          0          0          0     GICv2 199 Level     ppmmu1
 41:          0          0          0          0     GICv2 200 Level     pp2
 42:          0          0          0          0     GICv2 201 Level     ppmmu2
 43:       1064          0          0          0     GICv2  35 Edge      meson
 44:        257          0          0          0     GICv2  89 Edge      dw_hdmi_top_irq, c883a000.hdmi-tx
 45:   14561864          0          0          0     GICv2  63 Level     c9100000.usb, dwc2_hsotg:usb1
 47:          2          0          0          0  meson-gpio-irqchip  29 Level     stmmac-0:00
IPI0:      3606       7700       7728       3268       Rescheduling interrupts
IPI1:      1219        432        449        329       Function call interrupts
IPI2:         0          0          0          0       CPU stop interrupts
IPI3:         0          0          0          0       CPU stop (for crash dump) interrupts
IPI4:         0          0          0          0       Timer broadcast interrupts
IPI5:       393        215        213        316       IRQ work interrupts
IPI6:         0          0          0          0       CPU wake-up interrupts
Err:          0

@MichaIng
Copy link
Owner

MichaIng commented Feb 3, 2022

Okay great, so another obsolete step we could remove on mainline kernel images when selecting "usb-dac" as sound card: ad6dbde

What about the other questions?

@berni2a
Copy link
Author

berni2a commented Feb 3, 2022

We need to check which ones are required, or whether it is actually required to manually load any kernel driver. Can you try to proceed by using the "Change command" option from the error prompt and replace everything with a single colon :? Then see whether it does work.

--> it changes the sounf card -> but there is still no sound

@MichaIng
Copy link
Owner

MichaIng commented Feb 3, 2022

Can you show:

aplay -l

And check whether in alsamixer there is some volume bar which you can raise.

@berni2a
Copy link
Author

berni2a commented Feb 3, 2022

root@DietPi:~# aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: GXSOUNDCARD [GX-SOUND-CARD], Gerät 0: fe.dai-link-0 (*) []
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
root@DietPi:~#

alsa-mixer does not start with --> odroid-hifishield-plus

@berni2a
Copy link
Author

berni2a commented Feb 3, 2022

when i try an USB-DAC it works...

@MichaIng
Copy link
Owner

MichaIng commented Feb 3, 2022

Okay, so what is shown above seems to be the onboard sound card. Would be also interesting whether this works OOTB. On Odroid N2 it was quite complicated to configure it: b575b52#diff-e1f2e63b74209db8768bc28025d8727d20f2a2fa96ef44a0db7991724abeb507R2089

Btw, aplay -l output does not change, regardless whether you have the HiFi Shield plugged or not, right?

USB DACs usually work OOTB since the generic kernel driver works, at least with all basic functionality. The HiFi Shield Plus is connected via I2S header. So the header itself needs to work and probably a driver is required. The official instructions refer to the legacy kernel only (which is so old that it cannot be used with recent distro versions): https://wiki.odroid.com/accessory/sound/hifi_shield

The driver sources are here, but it surely won't work with mainline Linux. I will ask at the Armbian forum whether someone knows whether/how to get the Odroid HiFi shields working.

I would have tried to contact Hardkernel as well, but HiFi Shield Plus is for C1/C2 with are both EOL. A pain that SBC manufacturers (probably forced by SoC manufacturers, like Amlogic here) maintain their own, often single Linux version with drivers instead of working on support for mainline Linux. This single kernel version is then unusable after some years, so that the SBC cannot be maintained anymore with full features...

@berni2a
Copy link
Author

berni2a commented Feb 3, 2022

Btw, aplay -l output does not change, regardless whether you have the HiFi Shield plugged or not, right?

aplay -l shows build in sound card = hdmi & USB-dac but no Hifi Shield plus

By the way - the sound card works fine with VOLUMIO - but may have the former LINUX kernel used

@MichaIng
Copy link
Owner

MichaIng commented Feb 3, 2022

Jep, Volumio uses the legacy Hardkernel kernel. For audio only this is fine, for other network and server tasks, Docker and other things, it's not really usable anymore.

Okay, so I2S (the header/pins) in general and the Odroid HiFi Shields are something to check back on the Armbian forum. Until then, I'm afraid you either need to keep using onboard audio or USB DAC, or use Volumio.

@berni2a
Copy link
Author

berni2a commented Feb 3, 2022

the odroid-sound-card works also with the HARDKERNEL - Ubuntu MATE 20.04 desktop image
but it's okay if it wont work with DIETPI

By the way is there a possibility to get the latest 7.x revision for ODROID C2

@MichaIng
Copy link
Owner

MichaIng commented Feb 4, 2022

the odroid-sound-card works also with the HARDKERNEL - Ubuntu MATE 20.04 desktop image

All Hardkernel provided images use the legacy Hardkernel kernel, so yes it is supposed to work there.

By the way is there a possibility to get the latest 7.x revision for ODROID C2

Do you mean a PCB (hardware) revision or DietPi version? The first of course cannot be upgraded, if you mean the second: The DietPi version is not tied to the kernel/firmware stack. We intentionally replaced the legacy kernel image since it does not work anymore with several software implementations and system parts which expect newer Linux features to be present, so we do not offer an image with the old kernel anymore. You can however create one yourself, starting with the Buster image provided by Meveric: https://oph.mdrjr.net/meveric/images/Buster/
Then running our conversion script on it: https://dietpi.com/docs/hardware/#make-your-own-distribution

MichaIng added a commit that referenced this issue Feb 5, 2022
- DietPi-Config | Do not list Odroid C2 HiFi Should sound cards on mainline kernel image, but only when the related kernel module is actually available: #5235
- DietPi-Config | Fix H3 3.5mm sound card selection, but whether it is selectable like that on mainline kernel images needs to be tested as well (ToDo)
- DietPi-Set_hardware | When toggling Bluetooth, check whether related services are actually available before trying to enable/disable them
@MichaIng
Copy link
Owner

MichaIng commented Feb 5, 2022

I disabled the HiFi Shield sound card selection for now, when the related kernel modules are not available: ac45a2d

On FriendlyARM SBCs (NanoPi), I2S indeed needs to be enabled via (custom) device tree overlay first. I can imagine that it is the same for Odroid C2: https://forum.armbian.com/topic/9009-info-friendlyarm-pcm5102a-hat-with-nanopi-neo-under-mainline-4xx-and-dev-5xx/

Need to ask at the Armbian forum: https://forum.armbian.com/topic/8761-odroid-c2-general/page/2/#comment-125553

As a first step, could you check whether an I2S device is generally available in the tree and whether its enabled or not?

for i in /proc/device-tree/soc/*i2s*
do
[[ -d $i ]] || continue
echo -n "${i}: "
cat "$i/status"
echo
done

@MichaIng MichaIng changed the title Odroid C2 - ODROID Sound MODULE not working DietPi-Config | Odroid C2: Support for HiFi Shields with mainline kernel Feb 5, 2022
@MichaIng MichaIng modified the milestones: v8.1, v8.2 Feb 5, 2022
@berni2a
Copy link
Author

berni2a commented Feb 10, 2022

Sorry I have some issues with the starting behavior of DIETPI after version 8.
Today I updated to version 8.1.


When I start your code - there is NO echo.

@berni2a
Copy link
Author

berni2a commented Feb 10, 2022

I am sorry, could not create a working BUSTER image with the link you have provided.
This might be to difficult for me. :-)

@MichaIng
Copy link
Owner

MichaIng commented Feb 10, 2022

What do you mean with "issue" and "string behaviour"? Our current Odroid C2 image did never support the HiFi Shields out of the box, but I2S needs to be enabled first. This is independent of the DietPi version but a question of the kernel version only.

Hmm, when there is no I2S at all in the device tree, then we indeed have an issue. Does the following return something?

for i in /proc/device-tree/__symbols__/*i2s*
do
[[ -e $i ]] || continue
echo -n "${i}: "
cat "$i"
echo
done

@MichaIng MichaIng modified the milestones: v8.2, v8.3 Mar 2, 2022
@MichaIng MichaIng modified the milestones: v8.20, v8.21 Jul 29, 2023
@MichaIng MichaIng modified the milestones: v8.21, v8.22 Aug 27, 2023
@MichaIng MichaIng modified the milestones: v8.22, v8.23 Sep 23, 2023
@MichaIng MichaIng modified the milestones: v8.23, v8.24 Oct 21, 2023
@MichaIng MichaIng modified the milestones: v8.24, v8.25 Nov 19, 2023
@MichaIng MichaIng modified the milestones: v8.25, v9.0 Dec 20, 2023
@MichaIng MichaIng modified the milestones: v9.0, v9.1 Jan 20, 2024
@MichaIng MichaIng modified the milestones: v9.1, v9.2 Feb 20, 2024
@MichaIng MichaIng modified the milestones: v9.2, v9.3 Mar 17, 2024
@MichaIng MichaIng modified the milestones: v9.3, v9.4 Apr 16, 2024
@MichaIng MichaIng modified the milestones: v9.4, v9.5 May 13, 2024
@MichaIng MichaIng modified the milestones: v9.5, v9.6 Jun 10, 2024
@MichaIng MichaIng modified the milestones: v9.6, v9.7 Jul 10, 2024
@MichaIng MichaIng modified the milestones: v9.7, v9.8 Aug 26, 2024
@MichaIng MichaIng modified the milestones: v9.8, v9.9 Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants