# SPI display stops working after selecting non-dummy dac

**URL:** <https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038>\
**Category:** Hardware\
**Created:** [April 11, 2020, 7:34pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038 "2020-04-11T19:34:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sleepy](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/sleepy/32/3716_2.png) [@sleepy](https://discourse.zynthian.org/u/sleepy)\
**Post date:** [April 11, 2020, 7:34pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/1 "2020-04-11T19:34:15Z")

</div>

Hi! I’m new here and I hope I’m writhing in the right category and don’t break any rules.

I’ve decided to hack together a zynthian with what I have laying around and faced quite strange problem. I’m using ILI9341 based SPI display, which I made working using [this guide](https://pi0cket.com/ili9341-raspberry-pi-guide/), the only thing is each time I change configuration I need to edit `/etc/modules` as OS seems to overwrite my changes, but I can live with that. The problem I face is whenever I choose non-dummy DAC, the display stops working after reboot, and it’s not because `/etc/modules`. I have tried 2 i2s DACs (both usually work with `dtoverlay=hifiberry-dac`on regular rasbian) a and one cheap Chinese generic USB dongle and the result is always the same. Does anybody know what can cause this and how to fix it?

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [April 11, 2020, 9:54pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/2 "2020-04-11T21:54:34Z")

</div>

Hi,  
this happens because your screen use raspberry pin number 12 (GPIO 18) for the backlight, pin that is used by i2s (the protocol that make your raspberry “speech” to the dac).

```
sudo modprobe fbtft_device custom=1 name=fb_ili9341 gpios=reset:25,dc:24,led:18 speed=16000000 bgr=1

```

if you connect the screen directly on the rasp header with a 2x13 female header, I’m afraid that there will be no solution. Otherwise, if you connect the screen with wires (like on the tutorial you’ve given), you can connect the wire that should go on pin number 12 on a another one that is free, like pin 32 (GPIO 12) and use:

```
sudo modprobe fbtft_device custom=1 name=fb_ili9341 gpios=reset:25,dc:24,led:12 speed=16000000 bgr=1
```

---

<div class="post-metadata">

**Author:** ![sleepy](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/sleepy/32/3716_2.png) [@sleepy](https://discourse.zynthian.org/u/sleepy)\
**Post date:** [April 11, 2020, 10:07pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/3 "2020-04-11T22:07:10Z")

</div>

Thanks for the answer. Yeah, I forgot to mention that I was switching display to gpio-12 while I was using gpio-18 for DAC. The display was working until I set the DAC up in the config. I thought that there might be some conflict with these pins, that’s why I tried generic USB card which led to the same result…

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [April 11, 2020, 10:11pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/4 "2020-04-11T22:11:09Z")

</div>

Ok, I see. it’s really strange  
some dmesg output, Xorg.log may help …

---

<div class="post-metadata">

**Author:** ![jofemodo](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/jofemodo/32/2_2.png) [@jofemodo](https://discourse.zynthian.org/u/jofemodo)\
**Post date:** [April 11, 2020, 11:50pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/5 "2020-04-11T23:50:12Z")

</div>

Zynthian configuration system overwrites some /etc files, and `/etc/modules` is certainly modified. Could you check if your custom configuration is still there?

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [April 12, 2020, 6:46am UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/6 "2020-04-12T06:46:13Z")

</div>

Also, did you try to make them work together under regular raspbian ?

---

<div class="post-metadata">

**Author:** ![sleepy](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/sleepy/32/3716_2.png) [@sleepy](https://discourse.zynthian.org/u/sleepy)\
**Post date:** [April 12, 2020, 12:51pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/7 "2020-04-12T12:51:17Z")

</div>

Ok, it’s definitely about GPIO-18 even when using USB DAC  
Here’s a screenshot of a part of dmesg

 ![Screen Shot 2020-04-12 at 15.33.57](https://discourse.zynthian.org/uploads/default/original/2X/e/e3e99f28943d6d01884d16658aa227961975dc41.jpeg)

@jofemodo I didn’t try to make them work on a regular raspbian yet, I’ll try a little later, and will get back with the results

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [April 12, 2020, 6:02pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/8 "2020-04-12T18:02:12Z")

</div>

dmesg above show that the screen is still configured to use GPIO 18 for backlight.

---

<div class="post-metadata">

**Author:** ![sleepy](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/sleepy/32/3716_2.png) [@sleepy](https://discourse.zynthian.org/u/sleepy)\
**Post date:** [April 12, 2020, 7:35pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/9 "2020-04-12T19:35:22Z")

</div>

I guess that the problem is somewhere in this `spi-bcm2835` or `fbtft_device` in `/etc/modules` because I have a display hooked up to gpio-12 with dummy-dac and it works, but as soon as I switch dac to generic usb it stops working and I get the same message in `dmesg` about pin 18.

Just to make everything clear, I have `spi-bcm2835` and `fbtft_device` in `/etc/modules` and `options fbtft_device name=fb_ili9341 gpios=reset:25,dc:24,led:12 speed=16000000 bgr=1 rotate=90 custom=1` in `/etc/modprobe.d/fbtft.conf` and even with this config `dmesg` argues about gpio18.

If there’s no `spi-bcm2835` or `fbtft_device` in `/etc/modules` I can make display work even with dac with `sudo modprobe fbtft_device custom=1 name=fb_ili9341 gpios=reset:25,dc:24,led:12 speed=16000000 bgr=1` but I have no idea how show zynthian UI on it. Maybe I need to try to configure it without adding anything to `/etc/modules` …

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [April 12, 2020, 9:33pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/10 "2020-04-12T21:33:14Z")

</div>

> I guess that the problem is somewhere in this `spi-bcm2835` or `fbtft_device` in `/etc/modules` because I have a display hooked up to gpio-12 with dummy-dac and it works, but as soon as I switch dac to generic usb it stops working and I get the same message in `dmesg` about pin 18.

That’s totaly crazy !

you can try to boot with the working config for the screen and no usb dac attached. UI should show you an error message. From the command line:

- systemctl stop zyntian
- Plug the usb dac,
- aplay -L will give you the hardware name.
- Edit /etc/systemd/system/jack2.service with the right settings
- systemctl reload-daemon (or daemon-reload)
- systemctl restart jack2
- cd /zynthian/zynthian-ui
- startx ./zynthian.sh

It’s geting late here. I hope that you will be able to get out from this mess.

---

<div class="post-metadata">

**Author:** ![sleepy](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/sleepy/32/3716_2.png) [@sleepy](https://discourse.zynthian.org/u/sleepy)\
**Post date:** [April 12, 2020, 9:38pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/11 "2020-04-12T21:38:51Z")

</div>

Thanks a lot, I’ll try that tomorrow, it’s also quite late here 🙂

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [April 13, 2020, 9:45am UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/12 "2020-04-13T09:45:40Z")

</div>

Also, you Can configure zynthian (with the webconf tool) to use the raspberry built in codec.

---

<div class="post-metadata">

**Author:** ![sleepy](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/sleepy/32/3716_2.png) [@sleepy](https://discourse.zynthian.org/u/sleepy)\
**Post date:** [April 13, 2020, 9:34pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/13 "2020-04-13T21:34:13Z")

</div>

After some investigations I realized that following that tutorial was not the right thing to do in the first place. All this modprobe stuff is good to check if the display works, but what I really need is proper dtoverlay, seems like I didn’t use the right one and it was causing all the conflicts. I didn’t find the one that fits my case yet, but I’ve found some mentions that people use modified pitft for this kind of displays.  
@le51 thanks for all your suggestions, it helped me get some understanding of how zynthian works

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [April 13, 2020, 9:49pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/14 "2020-04-13T21:49:59Z")

</div>

I got the 1.8" SPI 128\*160 display based on ST7735S working (see this [topic](https://discourse.zynthian.org/t/lowest-display-resolution-wide-256x64-oled-displays/1881/22)). It is now a display option in Zynthian:

 ![image](https://discourse.zynthian.org/uploads/default/original/2X/a/abc02f32206d306401a002deb6fe7f861eaaddc1.png)

This may not work but might be worth a try. You may find the topic useful if you want to progress things. (The overlay I created for this is suboptimal, e.g. rotation doesn’t work but does the job mostly.)

---

<div class="post-metadata">

**Author:** ![sleepy](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/sleepy/32/3716_2.png) [@sleepy](https://discourse.zynthian.org/u/sleepy)\
**Post date:** [April 13, 2020, 9:54pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/15 "2020-04-13T21:54:33Z")

</div>

Thanks! Seems like a lot of useful info in that topic, will definitely check it out

---

<div class="post-metadata">

**Author:** ![sleepy](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/sleepy/32/3716_2.png) [@sleepy](https://discourse.zynthian.org/u/sleepy)\
**Post date:** [April 15, 2020, 9:09pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/16 "2020-04-15T21:09:01Z")

</div>

I got it working! Thanks for help everybody.

I’ve edited [rpi-display-overlay](https://github.com/raspberrypi/linux/blob/rpi-4.9.y/arch/arm/boot/dts/overlays/rpi-display-overlay.dts), removed all the stuff related to touch, and changed pins a little and made sure gpio-18 is not in use. Compiled it on the PI using this command

```
sudo dtc -@ -I dts -O dtb -o /boot/overlays/foo.dtbo foo-overlay.dts

```

After that I’ve changed to my new overlay in webconfig and it worked. The only thing is for some reason I still had issues with using generic usb dac, display worked this time, but UI didn’t show up. Anyway I just used my i2s dac and it worked perfectly.

Here’s the source code of my dtoverlay in case anybody needs it  
[ili9341-overlay.dts](https://discourse.zynthian.org/uploads/short-url/yd89BR5QgaIDfTTxzJ8tSl32GoG.dts) (1.3 KB)

And here’s the display I used

> **[US $4.35 16% OFF|2.4](https://www.aliexpress.com/item/32834915407.html?spm=a2g0s.9042311.0.0.27424c4dpN2YLQ)**
>
> Smarter Shopping, Better Living! Aliexpress.com

Next stop: wiring the encoders 🙂

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [April 15, 2020, 9:48pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/17 "2020-04-15T21:48:02Z")

</div>

Yes 👍, that’s great ! I was considering buying one of these cheap lcd screen but your problems have frightened me a bit.

Are you sure that touch capability has to be removed ?

---

<div class="post-metadata">

**Author:** ![sleepy](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/sleepy/32/3716_2.png) [@sleepy](https://discourse.zynthian.org/u/sleepy)\
**Post date:** [April 15, 2020, 9:55pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/18 "2020-04-15T21:55:35Z")

</div>

I’m not sure touch HAS to be removed, but this screen does not have touch, so I removed it just in case. At the moment I’m using keyboard with touchpad, but I hoped to make it usable with just encoders and without touch…

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [April 15, 2020, 10:12pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/19 "2020-04-15T22:12:14Z")

</div>

Ok, I see, screen has pins for touch control but the U1 chip isn’t populated

> [@sleepy](#):
>
> hoped to make it usable with just encoders and without touch

sure it is !

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [April 15, 2020, 10:27pm UTC](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038/20 "2020-04-15T22:27:08Z")

</div>

Indeed most functionality is designed around the encoders and touch is an after thought with some interface elements being suboptimal. We aspire to improve touch interface but it is not high on the agenda. The main thing that touch gives is the X-Y controller panel but the rest of Zynthian is completely controllable via four encoder switches.

[Next page](https://discourse.zynthian.org/t/spi-display-stops-working-after-selecting-non-dummy-dac/4038.md?page=2)
