bsteinsbo / DE1-SoC-Sound

GNU Lesser General Public License v2.1
17 stars 16 forks source link

FATAL ERROR: Unable to parse input tree #7

Open Satris404 opened 6 years ago

Satris404 commented 6 years ago

Hi,

When I try to compile the dts file with dtc, I'm getting: FATAL ERROR: Unable to parse input tree

Is there something I'm missing?

I'm using the command: dtc -O dtb -o socfpga_cyclone5_DE1-SoC.dtb socfpga_cyclone5_DE1-SoC.dts

Thank you,

Samuel

bsteinsbo commented 6 years ago

The dts is written in the same way that the kernel files are, using pre-processor directives like "#include". You will need to pre-process it if you need to run dtc by hand, or just change the Makefile in arch/arm/boot/dts to make the kernel build include your file.

If you want to work out-of-tree, the following Makefile may be of help:

SRCARCH = arm

DTC = dtc
DTCFLAGS = -b 0
dtc_cpp_flags  = -x assembler-with-cpp -nostdinc         \
                 -I $(srctree)/arch/$(SRCARCH)/boot/dts         \
                 -I $(srctree)/arch/$(SRCARCH)/boot/dts/include \
                 -undef -D__DTS__

DTCINCLUDES = -i $(srctree)/arch/$(SRCARCH)/boot/dts -i $(srctree)/arch/$(SRCARCH)/boot/dts/include

%.dtb: %.dts
        cpp $(dtc_cpp_flags) < $< | $(DTC) $(DTCINCLUDES) -I dts -O dtb $(DTCFLAGS) -o $@ -

all: isocfpga_cyclone5_DE1-SoC.dtb

BR, Bjarne

Satris404 commented 6 years ago

Hi,

Thank you for your help. What I did is replace the socfpga_cyclone5_socdk.dts file from the kernel version 3.17 found here : https://github.com/mohammadiahmad/linux-socfpga with your's, patched the snd-soc-wm8731 module, compiled with the linux-config you provide and cross-compiled the drivers. Linux is now running fine on my SoC so I installed the modules with insmod (snd-soc-opencores-i2s, snd-soc-wm8731 and snd-soc-de1-soc-wm8731 in order). Doing the command sudo aplay -l gives me: **** List of PLAYBACK Hardware Devices **** card 0: DE1SOCWM8731 [DE1SOC-WM8731], device 0: WM8731 PCM wm8731-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0

But when I try to play a wav file with sudo aplay song.wav, nothing is outputted at line out. Do I need to configure the Alsa driver in some ways to make it work? Or, am I missing something else?

The FPGA seems to be programmed correctly, the 7-seg are lit and the user led is blinking.

bsteinsbo commented 6 years ago

Hi, One mistake I did myself more than once, was forgetting to un-mute the output. Did you try alsamixer? BR, Bjarne

Satris404 commented 6 years ago

Yes, I unmuted everything and it still doesn't work. I will continue to investigate and keep you updated. If you have any idea what I should test or what could be the problem let my know.

bsteinsbo commented 6 years ago

Hi, It's of course hard to know for me if your problems are caused by the hardware or the software. If you want a second opinion on the software side of it, I would recommend taking a look at the Terasic linux kernel at https://github.com/terasic/linux-socfpga. Terasic has integrated this project into their sources, and the hardware part is also part of the latest CD for the DE10-Standard board. Maybe you can pick up some hint from the way they have integrated this project.

BR, Bjarne

Satris404 commented 6 years ago

Hi, I'm trying to use the socfpga kernel from your link that includes the driver. I suppose the tree file I should use is "socfpga_cyclone5_alsa.dts"? I didn't find any config file though.

So what I just did is configure the kernel myself and compiled with the tree file I've just mentioned. I took the .ko compiled files that are snd-soc-opencores-i2s, snd-soc-socfpga-wm8731 and snd-soc-wm8731 from there and installed them on my device. Now, lsmod gives me

samuel@DE1-SoC:~/drivers$ sudo lsmod
Module                  Size  Used by
snd_soc_socfpga_wm8731     4035  0
snd_soc_wm8731         11951  0
snd_soc_opencores_i2s     4338  0

and no audio driver is detected

samuel@DE1-SoC:~/drivers$ aplay -l
aplay: device_list:268: no soundcards found...

Here is the config file I used: linux-config.txt

Did I miss something?

bsteinsbo commented 6 years ago

Hi, You will find the config file I used in the top directory as Linux-config.

BR, Bjarne

Satris404 commented 6 years ago

Hi, Your linux-config is for kernel 3.17 right? I’ll have to adapt it to the version I use?

bsteinsbo commented 6 years ago

Hi, Probably, but I can't offer any advice on how to do it, except maybe look at what Terasic did in the link I referred to earlier. But the output you showed from lsmod may indicate that the probe didn't succeed, and then you're back to the dts. Maybe you should try to merge the audio part of the dts with the default dts from the kernel version you're using? Again the Terasic sources might provide some hints.

BR, Bjarne

IamCOD3X commented 4 months ago

add export DTC_EXT=/usr/bin/dtc to your build script