User avatar
PeterO
Posts: 3631
Joined: Sun Jul 22, 2012 4:14 pm

STICKY: Device Tree Q&A

Wed Feb 11, 2015 10:09 pm

Starting new thread as suggested....

In symbols like "bcm2708_i2s_of_match" what does the "of" bit stand for ? I'm sure things would be clearer if I was reading/saying the symbol names correctly in my head :-)

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1361
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Device Tree Q&A

Thu Feb 12, 2015 10:19 am

The "of" is short for Open Firmware, a Sun BIOS/ACPI alternative.

User avatar
PeterO
Posts: 3631
Joined: Sun Jul 22, 2012 4:14 pm

Re: Device Tree Q&A

Thu Feb 12, 2015 10:34 am

PhilE wrote:The "of" is short for Open Firmware, a Sun BIOS/ACPI alternative.
Ah, I was expecting it to be something more "functional" :-)
Thanks.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

ronaldteune
Posts: 8
Joined: Wed Oct 16, 2013 5:39 am

Re: Device Tree Q&A

Fri Mar 06, 2015 2:22 pm

I'm not sure if this belongs here or in another thread(...)

-edit- moved

Thanks @PhilE
Last edited by ronaldteune on Mon Mar 09, 2015 7:39 pm, edited 3 times in total.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1361
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Device Tree Q&A

Fri Mar 06, 2015 2:24 pm

It definitely belongs in another thread.

Danielya
Posts: 15
Joined: Thu May 04, 2017 12:25 pm

Re: Device Tree Q&A

Mon May 15, 2017 9:39 am

Is it possible to create a device tree overlay that defines both speaker and microphone, each connected via I2S?

I have the ICS43432 mic and the HiFiberry DAC speaker. Each one of them works when I define them in /boot/config.txt but when I define both, only the last one written applies...I need them for a project that I must have two-way audio in, and simultaneously...

Thanks in advance

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1361
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Device Tree Q&A

Mon May 15, 2017 12:30 pm

I'm not in a position to experiment, but I think that the problem is likely to be caused by both overlays trying to use the node labelled "sound" (which corresponds to the path "/soc/sound" in the Device Tree). If you move one of the sound card instances somewhere else it might start working. I suggest moving the microphone to "/soc/soundinput" (or "/soc/sound2" - it doesn't really matter what you choose as long as it doesn't clash with something else).

Since this node doesn't exist in the base DTBs your overlay will have to create it. Change:

Code: Select all

    target = <&sound>;
    __overlay__ {
        ...whatever...
    };
to (notice the extra level in the hierarchy):

Code: Select all

    target = <&soc>;
    __overlay__ {
        soundinput {
            ...whatever...
        };
    };

Danielya
Posts: 15
Joined: Thu May 04, 2017 12:25 pm

Re: Device Tree Q&A

Tue May 16, 2017 2:56 am

Thanks for the help.
Unfortunately it didn't work :(

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1361
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Device Tree Q&A

Tue May 16, 2017 10:48 am

Are there any errors or warnings in the kernel log (type "dmesg")?

sv1eia
Posts: 2
Joined: Mon May 08, 2017 12:43 pm

Re: Device Tree Q&A

Sat May 20, 2017 4:57 pm

Hi,
Need to experiment with I2S but without any codec device attached.
From what I read, there can be a way with snd-soc-dummy and simple-audio-card to have just a overlay .dts in such a way that can give user access to I2S as alsa devices.
Is there any example or hint to help me on this?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1361
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Device Tree Q&A

Sat May 20, 2017 6:56 pm

Yes you could write an overlay using simple-audio-card, but you could probably get away with the hifiberry-dac overlay. HiFiBerry DAC is built around a PCM5102 which doesn't have an I2C interface so it doesn't need any runtime control - you just feed it an I2S bitstream and it converts it to analogue voltages. The codec is configured as a sample clock slave and bit clock slave. Because there is no feedback from the codec you don't even need to have one attached to get I2S output.

Just add "dtoverlay=hifiberry-dac" to config.txt, or to just try it out until you reboot type "sudo dtoverlay hifiberry-dac".

sv1eia
Posts: 2
Joined: Mon May 08, 2017 12:43 pm

Re: Device Tree Q&A

Sat May 20, 2017 7:04 pm

Thanks, yet since that is a DAC should it also generate the 'capture' device that I need?
(going to try it)

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1361
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Device Tree Q&A

Sat May 20, 2017 7:12 pm

You didn't mention capture. There is already a simple-audio-card capture overlay - see https://github.com/raspberrypi/linux/bl ... verlay.dts

There is a tbread on GitHub that includes a discussion of a SAC-based overlay for a playback card - see https://github.com/raspberrypi/linux/pu ... -298261663

Combining the two is an exercise for the reader.

Return to “Interfacing (DSI, CSI, I2C, etc.)”

Who is online

Users browsing this forum: No registered users and 10 guests