Working PiTFT and AudioInjector - but not at the same time

I’ve been working on a Zynthian for quite some time.
After trying out a few cheap Chinese TFT’s without any luck, I gave up and purchased a Adafruit PiTFT 2.8.

I was thrilled, when I finally saw the Zynthian GUI on the little cute display, but my joy faded as soon as I put the AudioInjector into the mix.
When I attach both AudioInjector and PiTFT to my RPI3, the display backlight turns on, but the screen is all white.
I can access the web-interface and connect through ssh. I can even add a HDMI-screen (with appropriate configuration) and use that for interface with the display attached.

I’ve tried to test the devices individually:
RPI3+AudioInjector+HDMI: GUI works on HDMI-display. Audio works
RPI3+PiTFT: GUI works, but there’s obviously no sound.

I feel stuck right now, so any suggestions are most welcome.

And here’s the output of dmesg with both AudioInjector and PiTFT attached:

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.24-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #993 SMP Wed Apr 26 18:01:23 BST 2017
[    0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt:Machine model: Raspberry Pi 3 Model B Rev 1.2
[    0.000000] cma: Reserved 8 MiB at 0x3a800000
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 241664
[    0.000000] free_area_init_node: node 0, pgdat 80c6edc0, node_mem_map b9faa000
[    0.000000]   Normal zone: 2124 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 241664 pages, LIFO batch:31
[    0.000000] percpu: Embedded 14 pages/cpu @b9f63000 s25600 r8192 d23552 u57344
[    0.000000] pcpu-alloc: s25600 r8192 d23552 u57344 alloc=14*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 239540
[    0.000000] Kernel command line: 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 936300K/966656K available (7168K kernel code, 483K rwdata, 2012K rodata, 1024K init, 778K bss, 22164K reserved, 8192K cma-reserved)
[    0.000000] Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xbb800000 - 0xff800000   (1088 MB)
    lowmem  : 0x80000000 - 0xbb000000   ( 944 MB)
    modules : 0x7f000000 - 0x80000000   (  16 MB)
      .text : 0x80008000 - 0x80800000   (8160 kB)
      .init : 0x80b00000 - 0x80c00000   (1024 kB)
      .data : 0x80c00000 - 0x80c78f94   ( 484 kB)
       .bss : 0x80c7a000 - 0x80d3ca64   ( 779 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] 	Build-time adjustment of leaf fanout to 32.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 19.20MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000008] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000025] Switching to timer-based delay loop, resolution 52ns
[    0.000327] Console: colour dummy device 80x30
[    0.001218] console [tty1] enabled
[    0.001273] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.001342] pid_max: default: 32768 minimum: 301
[    0.001710] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.001753] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.002786] Disabling cpuset control group subsystem
[    0.002977] CPU: Testing write buffer coherency: ok
[    0.003048] ftrace: allocating 22386 entries in 66 pages
[    0.054583] CPU0: update cpu_capacity 1024
[    0.054649] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.054750] Setting up static identity map for 0x100000 - 0x100034
[    0.057011] CPU1: update cpu_capacity 1024
[    0.057019] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.057739] CPU2: update cpu_capacity 1024
[    0.057746] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.058409] CPU3: update cpu_capacity 1024
[    0.058416] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.058497] Brought up 4 CPUs
[    0.058670] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.058700] CPU: All CPU(s) started in HYP mode.
[    0.058727] CPU: Virtualization extensions available.
[    0.059551] devtmpfs: initialized
[    0.071033] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[    0.071347] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.071410] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.071975] pinctrl core: initialized pinctrl subsystem
[    0.072903] NET: Registered protocol family 16
[    0.075153] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.083959] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.084007] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.084190] Serial: AMBA PL011 UART driver
[    0.086211] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.086765] uart-pl011 3f201000.serial: could not find pctldev for node /soc/gpio@7e200000/uart0_pins, deferring probe
[    0.087514] irq: no irq domain found for /soc/aux@0x7e215000 !
[    0.155174] bcm2835-dma 3f007000.dma: DMA legacy API manager at bb80f000, dmachans=0x1
[    0.157055] SCSI subsystem initialized
[    0.157233] usbcore: registered new interface driver usbfs
[    0.157335] usbcore: registered new interface driver hub
[    0.157452] usbcore: registered new device driver usb
[    0.164114] raspberrypi-firmware soc:firmware: Attached to firmware from 2017-04-27 17:19
[    0.165499] clocksource: Switched to clocksource arch_sys_counter
[    0.212421] VFS: Disk quotas dquot_6.6.0
[    0.212535] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.212771] FS-Cache: Loaded
[    0.213048] CacheFiles: Loaded
[    0.225229] NET: Registered protocol family 2
[    0.226168] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.226306] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    0.226517] TCP: Hash tables configured (established 8192 bind 8192)
[    0.226629] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.226696] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.226931] NET: Registered protocol family 1
[    0.227362] RPC: Registered named UNIX socket transport module.
[    0.227394] RPC: Registered udp transport module.
[    0.227422] RPC: Registered tcp transport module.
[    0.227450] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.228415] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available
[    0.230752] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[    0.246872] FS-Cache: Netfs 'nfs' registered for caching
[    0.247898] NFS: Registering the id_resolver key type
[    0.247952] Key type id_resolver registered
[    0.247980] Key type id_legacy registered
[    0.250305] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.250452] io scheduler noop registered
[    0.250483] io scheduler deadline registered (default)
[    0.250759] io scheduler cfq registered
[    0.256548] BCM2708FB: allocated DMA memory fa910000
[    0.256602] BCM2708FB: allocated DMA channel 0 @ bb80f000
[    0.265289] Console: switching to colour frame buffer device 82x26
[    0.274191] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[    0.278116] bcm2835-aux-uart 3f215040.serial: could not get clk: -517
[    0.281501] bcm2835-rng 3f104000.rng: hwrng registered
[    0.283930] vc-cma: Videocore CMA driver
[    0.286327] vc-cma: vc_cma_base      = 0x00000000
[    0.288696] vc-cma: vc_cma_size      = 0x00000000 (0 MiB)
[    0.290968] vc-cma: vc_cma_initial   = 0x00000000 (0 MiB)
[    0.293342] vc-mem: phys_addr:0x00000000 mem_base=0x3dc00000 mem_size:0x3f000000(1008 MiB)
[    0.312793] brd: module loaded
[    0.323730] loop: module loaded
[    0.325860] Loading iSCSI transport class v2.0-870.
[    0.328541] usbcore: registered new interface driver smsc95xx
[    0.330685] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    0.558805] Core Release: 2.80a
[    0.560868] Setting default values for core params
[    0.563001] Finished setting default values for core params
[    0.765569] Using Buffer DMA mode
[    0.767699] Periodic Transfer Interrupt Enhancement - disabled
[    0.769946] Multiprocessor Interrupt Enhancement - disabled
[    0.772177] OTG VER PARAM: 0, OTG VER FLAG: 0
[    0.774365] Dedicated Tx FIFOs mode
[    0.776827] WARN::dwc_otg_hcd_init:1053: FIQ DMA bounce buffers: virt = 0xba904000 dma = 0xfa904000 len=9024
[    0.781268] FIQ FSM acceleration enabled for :
    Non-periodic Split Transactions
    Periodic Split Transactions
    High-Speed Isochronous Endpoints
    Interrupt/Control Split Transaction hack enabled
[    0.792612] dwc_otg: Microframe scheduler enabled
[    0.792656] WARN::hcd_init_fiq:459: FIQ on core 1 at 0x8058e4c4
[    0.794952] WARN::hcd_init_fiq:460: FIQ ASM at 0x8058e834 length 36
[    0.797271] WARN::hcd_init_fiq:486: MPHI regs_base at 0xbb87a000
[    0.799638] dwc_otg 3f980000.usb: DWC OTG Controller
[    0.801952] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    0.804314] dwc_otg 3f980000.usb: irq 62, io mem 0x00000000
[    0.806652] Init: Port Power? op_state=1
[    0.808908] Init: Power Port (0)
[    0.811286] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    0.813596] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.815916] usb usb1: Product: DWC OTG Controller
[    0.818163] usb usb1: Manufacturer: Linux 4.9.24-v7+ dwc_otg_hcd
[    0.820430] usb usb1: SerialNumber: 3f980000.usb
[    0.823424] hub 1-0:1.0: USB hub found
[    0.825659] hub 1-0:1.0: 1 port detected
[    0.828323] dwc_otg: FIQ enabled
[    0.828327] dwc_otg: NAK holdoff enabled
[    0.828332] dwc_otg: FIQ split-transaction FSM enabled
[    0.828344] Module dwc_common_port init
[    0.828562] usbcore: registered new interface driver usb-storage
[    0.830890] mousedev: PS/2 mouse device common for all mice
[    0.833980] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
[    0.836552] bcm2835-cpufreq: min=1200000 max=1200000
[    0.839195] sdhci: Secure Digital Host Controller Interface driver
[    0.841508] sdhci: Copyright(c) Pierre Ossman
[    0.844038] sdhost-bcm2835 3f202000.sdhost: could not get clk, deferring probe
[    0.848636] mmc-bcm2835 3f300000.mmc: could not get clk, deferring probe
[    0.851174] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.860895] ledtrig-cpu: registered to indicate activity on CPUs
[    0.863541] hidraw: raw HID events driver (C) Jiri Kosina
[    0.866198] usbcore: registered new interface driver usbhid
[    0.868655] usbhid: USB HID core driver
[    0.871905] vchiq: vchiq_init_state: slot_zero = 0xba980000, is_master = 0
[    0.876119] Initializing XFRM netlink socket
[    0.878658] NET: Registered protocol family 17
[    0.881247] Key type dns_resolver registered
[    0.884062] Registering SWP/SWPB emulation handler
[    0.887268] registered taskstats version 1
[    0.890032] vc-sm: Videocore shared memory driver
[    0.892536] [vc_sm_connected_init]: start
[    0.895432] [vc_sm_connected_init]: end - returning 0
[    0.902849] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[    0.910249] 3f215040.serial: ttyS0 at MMIO 0x0 (irq = 220, base_baud = 50000000) is a 16550
[    0.915925] sdhost: log_buf @ ba907000 (fa907000)
[    0.995527] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    1.000213] mmc-bcm2835 3f300000.mmc: mmc_debug:0 mmc_debug2:0
[    1.002705] mmc-bcm2835 3f300000.mmc: DMA channel allocated
[    1.045587] Indeed it is in host mode hprt0 = 00021501
[    1.135518] random: fast init done
[    1.135593] of_cfs_init
[    1.135676] of_cfs_init: OK
[    1.142583] Waiting for root device /dev/mmcblk0p2...
[    1.156769] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.166772] mmc0: new high speed SDHC card at address d2d2
[    1.169955] mmcblk0: mmc0:d2d2 SU08G 7.40 GiB
[    1.173625] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    1.177658] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    1.180076]  mmcblk0: p1 p2
[    1.183698] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    1.188899] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    1.245541] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    1.247880] Indeed it is in host mode hprt0 = 00001101
[    1.303553] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.308037] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    1.338902] devtmpfs: mounted
[    1.343197] Freeing unused kernel memory: 1024K (80b00000 - 80c00000)
[    1.351389] mmc1: new high speed SDIO card at address 0001
[    1.475815] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[    1.478377] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.481776] hub 1-1:1.0: USB hub found
[    1.484433] hub 1-1:1.0: 5 ports detected
[    1.805548] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    1.935840] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    1.938365] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.943729] smsc95xx v1.0.5
[    2.039314] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:99:6d:c9
[    2.225090] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
[    2.231182] systemd[1]: Detected architecture 'arm'.
[    2.627067] NET: Registered protocol family 10
[    2.631320] systemd[1]: Inserted module 'ipv6'
[    2.638247] systemd[1]: Set hostname to <zynthian>.
[    4.405645] systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory.
[    4.416396] systemd[1]: Starting Forward Password Requests to Wall Directory Watch.
[    4.422171] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    4.427963] systemd[1]: Starting Remote File Systems (Pre).
[    4.434328] systemd[1]: Reached target Remote File Systems (Pre).
[    4.437377] systemd[1]: Starting Encrypted Volumes.
[    5.035308] i2c /dev entries driver
[    5.725864] systemd-udevd[144]: starting version 215
[    5.799716] EXT4-fs (mmcblk0p2): re-mounted. Opts: errors=remount-ro,commit=120
[    6.439839] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    6.496442] stmpe-spi spi0.1: unknown chip id: 0x0
[    6.499030] stmpe-spi: probe of spi0.1 failed with error -22
[    7.018345] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[    7.033603] smsc95xx 1-1.1:1.0 eth2: renamed from eth0
[    7.047430] fb_ili9340: module is from the staging directory, the quality is unknown, you have been warned.
[    7.054102] fbtft_of_value: buswidth = 8
[    7.056863] fbtft_of_value: debug = 0
[    7.058637] audioinjector-stereo soc:sound: ASoC: CPU DAI (null) not registered - will retry
[    7.058648] audioinjector-stereo soc:sound: snd_soc_register_card failed (-517)
[    7.067544] fbtft_of_value: rotate = 90
[    7.070186] fbtft_of_value: fps = 20
[    7.074589] audioinjector-stereo soc:sound: ASoC: CODEC DAI wm8731-hifi not registered - will retry
[    7.080061] audioinjector-stereo soc:sound: snd_soc_register_card failed (-517)
[    7.084710] wm8731 1-001a: Assuming static MCLK
[    7.087812] 1-001a supply AVDD not found, using dummy regulator
[    7.090790] 1-001a supply HPVDD not found, using dummy regulator
[    7.093728] 1-001a supply DCVDD not found, using dummy regulator
[    7.096594] 1-001a supply DBVDD not found, using dummy regulator
[    7.196155] systemd-udevd[159]: renamed network interface eth0 to eth2
[    7.200918] audioinjector-stereo soc:sound: wm8731-hifi <-> 3f203000.i2s mapping ok
[    7.287049] graphics fb1: fb_ili9340 frame buffer, 320x240, 150 KiB video memory, 4 KiB DMA buffer memory, fps=20, spi0.0 at 32 MHz
[    7.429054] usbcore: registered new interface driver brcmfmac
[    7.662805] brcmfmac: Firmware version = wl0: May 27 2016 00:13:38 version 7.45.41.26 (r640327) FWID 01-df77e4a7
[    7.968453] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    8.126359] systemd-journald[117]: Received request to flush runtime journal from PID 1
[    8.807476] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[    8.810193] brcmfmac: power management disabled
[   10.657900] smsc95xx 1-1.1:1.0 eth2: hardware isn't capable of remote wakeup
[   10.660296] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready
[   11.682621] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   14.155730] bcm2835-i2s 3f203000.i2s: I2S SYNC error!
[   15.265949] uart-pl011 3f201000.serial: no DMA platform data
[   51.245801] random: crng init done

If I had that problem, I would first try a fresh image, update 3 times via ssh and hope for the best.
If this still doesn’t work, I would check the wiring.
Which wiring are you using?

Hi @Beltshassar!

Nice to meet you, and welcome to the Zynthian community! :wink:

Your log seems OK. It’s not strange to see some “errors” before the driver is loaded correctly. WIth Hifiberry and other devices is normal too.

Anyway, I had some problems with AudioInjector soundcards. I’ve mounted 2 zynthians with it:

  • First time I had to change the wiring because a ground pin in the AudioInjector header didn’t work. Currently this Zynthian works perfectly.

  • Second time i didn’t get the AudioInjector working with all the encoders, i couldn’t determine exactly what the f*** was happening, but the problems got solved by using another AudioInjector. The “broken” audioinjector remains in its box for further analisys …

So … currently i’m not very confident with the AudioInejctor hardware, specially when connecting more devices together using audioinjector’s male-pin-header

Good Luck!

Thanks for the replies!

I have already tried to start from scratch with a new image, but the male header on the AudioInjector could very well be the culprit.

I’ll try to make a connection to the AI female header through the flat cable that I’ve seen work with the display.

Hi @Beltshassar!

Did you solve your problems with the AudioInjector? I’m interested in … :wink:

1 Like

Hi @jofemodo

Thankyou for taking interest in my issue :smile:

Unfortunately I haven’t had a lot of time to play around with my pet project lately. But last night I tried out a few things and there’s definitely something fishy going on when I use the AudioInjector male pins.

I can play audio with ssh -> mpg123 when using the female connector, but that means no display. Now I’m trying to make a connector for the female pins but I’m still struggling.

Which ground pin was bugging you and how did you figure that out?

Read this:

Anyway, the second time i tried to mount a Zynthian Box with AudioInjector, it didn’t work and have to replace the Audio Injector for getting things work ;-(

Regards,

Very nice! With your tips and a little help from http://www.flatmax.org/phpbb/viewtopic.php?f=5&t=4&p=9&hilit=Pinout I managed to adjust my flat cable to fit the female plug in the Audio Injector.

I think you are right about the male header being unreliable. Even the female connector have been bugging me, but at last I have a working connection and a playable Zynthian. I’m amazed by the low latency. I haven’t made any measurements, but the feel seems great!

Now onto a custom case and some rotary buttons :smile:

2 Likes