Source for the hifishield.dtbo and hifishield2.dtbo?

Post Reply
IanL
Posts: 4
Joined: Mon Mar 29, 2021 7:13 pm
languages_spoken: english
ODROIDs: N2+
Has thanked: 0
Been thanked: 0
Contact:

Source for the hifishield.dtbo and hifishield2.dtbo?

Post by IanL »

Hi,
I'm interested in using the I2S interface (on the C4 and N2+) with my own converter and audio output driver circuitry. Currently, I'm playing around with a Cirrus Logic CS4334 DAC chip, and the results are very encouraging. But what I'd really like to do is configure the interface for multi-channel output, if that is possible, which, looking at the AMLogic data sheets, I think it should be. Problem is that I have no experience with device tree overlays. One thing which might help is to be able to see the .dts source files which HK used to compile the hifishield (and hifishield2) .dtbo files. But I can't work out where to find the source. Can anyone help?

Thanks, Ian.

User avatar
odroid
Site Admin
Posts: 37550
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1840 times
Been thanked: 1160 times
Contact:

Re: Source for the hifishield.dtbo and hifishield2.dtbo?

Post by odroid »

You should navigate our Kernel source trees. ;)
https://github.com/hardkernel/linux/tre ... c/overlays

IanL
Posts: 4
Joined: Mon Mar 29, 2021 7:13 pm
languages_spoken: english
ODROIDs: N2+
Has thanked: 0
Been thanked: 0
Contact:

Re: Source for the hifishield.dtbo and hifishield2.dtbo?

Post by IanL »

Ah! Perfect! Thank you. That gives me something to go on.

Thought I'd just mention that I'm having a small issue with my C4 board in that it won't load the hifishield2 overlay. The hifishield one is fine - brings up the 'card' in ALSA, but the hifishield2 doesn't seem to do anything. I'm currently using your latest Ubuntu minimal image. I might be wrong but I thought it was working at one stage. But it isn't now. I'll maybe try re-compiling the .dts on the link you gave me and try that - will be a useful exercise if nothing else. I'll let you know if I find anything out.

Thanks again, Ian.

User avatar
odroid
Site Admin
Posts: 37550
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1840 times
Been thanked: 1160 times
Contact:

Re: Source for the hifishield.dtbo and hifishield2.dtbo?

Post by odroid »


IanL
Posts: 4
Joined: Mon Mar 29, 2021 7:13 pm
languages_spoken: english
ODROIDs: N2+
Has thanked: 0
Been thanked: 0
Contact:

Re: Source for the hifishield.dtbo and hifishield2.dtbo?

Post by IanL »

Yes, except that I don't have a hifishield2, and I don't have any of a keyboard, mouse and HDMI monitor connected. (I'm using the C4 headless, via ssh, forwarding X11 for whenever I need a GUI window. I'm using the minimal Ubuntu image with no local windowing system.) I don't understand why your page says to ensure that you have these peripherals connected. I don't see what difference it makes. Is there one? The hifishield (v1) overlay is working fine under these conditions. I've tried compiling your hifishield2.dts file and using the resulting .dtbo. It still doesn't work. On compilation I get the following warning: hifishield2.dts:46.30-63.6: Warning (unit_address_vs_reg): /fragment@2/__overlay__/aml-audio-card,dai-link@0: node has a unit name, but no reg property. But I don't understand enough about overlays or the hardware in question yet to know if this is anything to worry about. Thanks, Ian.

User avatar
odroid
Site Admin
Posts: 37550
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1840 times
Been thanked: 1160 times
Contact:

Re: Source for the hifishield.dtbo and hifishield2.dtbo?

Post by odroid »

If you don't connect the HiFiShield2 to your C4 board, the PCM5242 driver registration will not complete because of the I2C detection fail.

IanL
Posts: 4
Joined: Mon Mar 29, 2021 7:13 pm
languages_spoken: english
ODROIDs: N2+
Has thanked: 0
Been thanked: 0
Contact:

Re: Source for the hifishield.dtbo and hifishield2.dtbo?

Post by IanL »

That's very strange. When I first tried it, maybe a month or so ago, using your Ubuntu Mate image, on my C4, it worked:

Code: Select all

aplay -l
...
card 1: ODROIDHiFi2 [ODROID-HiFi2], device 0: TDM-B-pcm512x-hifi pcm512x-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

This was without a HiFi shield, of any sort, ever having been attached. I do not own one.

Now, using your Ubuntu minimal image, it doesn't work, presumably for the reason you give. Neither does it work on my N2+, using the Ubuntu Mate image, presumably for the same reason.

It's not important really though since all I need is to activate the I2S output and register it as a 'card' in ALSA, which the hifishield(1) overlay does fine. I presume it works without a shield attached because there is no I2C requirement for that card.

Since, as I understand it, I2S is basically a unidirectional communication protocol, I don't really understand the need for chip-specific 'drivers' as such on the Odroid system at all. Are they primarily to specify the ranges of parameters (eg Fs) that the chip can handle? Are these drivers that you've written yourselves and if so is the source available?

I'm new to low-level stuff on Linux, and to ALSA, so I'm floundering about a bit here. Please excuse me!

Thanks, Ian.

User avatar
odroid
Site Admin
Posts: 37550
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1840 times
Been thanked: 1160 times
Contact:

Re: Source for the hifishield.dtbo and hifishield2.dtbo?

Post by odroid »

HiFiShield2 uses I2S and I2C together while HiFiShiled doesn't use the I2C interface.
Check the PCM5242 datasheet.

Can you share dmesg outputs after running modprobe?

Post Reply

Return to “I2S Devices (HiFi Shield DAC and Stereo Boom Bonnet Kit)”

Who is online

Users browsing this forum: No registered users and 1 guest