BlueWave Studio forum
Touchscreen issue using Hifiberry Amp2 - Printable Version

+- BlueWave Studio forum (https://bluewavestudio.io/community)
+-- Forum: Hardware for head-unit (https://bluewavestudio.io/community/forum-87.html)
+--- Forum: Other Hardware (https://bluewavestudio.io/community/forum-92.html)
+--- Thread: Touchscreen issue using Hifiberry Amp2 (/thread-990.html)



Touchscreen issue using Hifiberry Amp2 - scotty86 - 08-01-2019

Hello,

Image: bluewavestudio-openauto-pro-release-3.3.1
Hardware:
- Raspberry Pi 3b+
- Raspberry 7" touchscreen - connected with a ribbon cable to the DSI and two jumper cables (5v and GND)
- Hifiberry Amp2 (also used for powering the system)

Problem:
When I boot up the system, after attaching the Hifiberry Amp2 and adding "dtoverlay=hifiberry-dacplus" to the config.txt, the touchscreen goes nuts and it looks as if it is touched everywhere all the time.

What I tried:
  • I detached the Amp2, uncommented "dtoverlay=hifiberry-dacplus" and everything was fine again.
  • I only connected the necessary GPIO Pins of the Amp2 with jumper cable and reenabled "dtoverlay=hifiberry-dacplus", the issue was back.
  • I kept "dtoverlay=hifiberry-dacplus" enabled and disconnected the Amp2, issue was still there.
  • I flashed a micro sd with crankshaft-ng, attached the Amp2 and everything is working fine.
  • I switched back to Openauto Pro and replaced the config.txt with the config of the crankshaft-image, issue still exists.
  • I tried an apt dist-upgrade, issue still exists.
  • I tried a rpi-upgrade (firmeware upgrade), issue still exists.
Well, now I'm running out of ideas, does anyone have some tips or a fix for this?

Greetings
scotty86


RE: Touchscreen issue using Hifiberry Amp2 - frankpintosr - 08-01-2019

Can you please paste your config.txt file?


RE: Touchscreen issue using Hifiberry Amp2 - scotty86 - 08-01-2019

Here you go:
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=off
#dtoverlay=vc4-kms-v3d
gpu_mem=256
#dtoverlay=vc4-fkms-v3d
disable_splash=1
dtoverlay=hifiberry-dacplus



RE: Touchscreen issue using Hifiberry Amp2 - Daniel_BlueWave - 08-01-2019

@scotty86 Did you try to ask HiFi Berry? Your setup is standard one and you are using regular Raspbian OS. OpenAuto Pro has nothing to do with your hardware and this looks like incomplete configuration.

Send them your setup and version of used Raspbian (cat /etc/os-release). They should support you with this issue, or at least give you some hints.


RE: Touchscreen issue using Hifiberry Amp2 - scotty86 - 08-02-2019

Ok, I found the solution for the screen issues, following line must not be uncommented:
dtoverlay=vc4-fkms-v3d

But still, OpenAuto Pro does not use the hifiberry. I can't pull up the volume and if I start Android Auto I get the black screen. After plugin in a usb card, OpenAuto detects it, Android Auto starts and I can control the volume (of the usb card).

The OS detects the hifiberry and I can listen to audio files using e.g. VLC. I have set the hifiberry as default audio device by using the raspbian gui and by setting it as default in the /etc/asound.conf and the /home/pi/.asoundrc.

Edit - FIX:
Well, finally .. Just noticed pulseaudio is running ..

What i did (commandline commands):
  • pacmd list-sinks
    3 sink(s) available.
        index: 0
            name: <alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo>
            driver: <module-alsa-card.c>
            flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL LATENCY
            state: RUNNING
            suspend cause:
            priority: 9049
            volume: front-left: 8856 /  14%,   front-right: 8856 /  14%
                    balance 0,00
            base volume: 65536 / 100%
            volume steps: 38
            muted: no
            current latency: 102,70 ms
            max request: 18 KiB
            max rewind: 18 KiB
            monitor source: 0
            sample spec: s16le 2ch 48000Hz
            channel map: front-left,front-right
                         Stereo
            used by: 3
            linked by: 3
            fixed latency: 100,00 ms
            card: 0 <alsa_card.usb-C-Media_Electronics_Inc._USB_Audio_Device-00>
            module: 6
            properties:
                    alsa.resolution_bits = "16"
                    device.api = "alsa"
                    device.class = "sound"
                    alsa.class = "generic"
                    alsa.subclass = "generic-mix"
                    alsa.name = "USB Audio"
                    alsa.id = "USB Audio"
                    alsa.subdevice = "0"
                    alsa.subdevice_name = "subdevice #0"
                    alsa.device = "0"
                    alsa.card = "1"
                    alsa.card_name = "USB Audio Device"
                    alsa.long_card_name = "C-Media Electronics Inc. USB Audio Device at usb-3f980000.usb-1.3, full speed"
                    alsa.driver_name = "snd_usb_audio"
                    device.bus_path = "platform-3f980000.usb-usb-0:1.3:1.0"
                    sysfs.path = "/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/sound/card1"
                    udev.id = "usb-C-Media_Electronics_Inc._USB_Audio_Device-00"
                    device.bus = "usb"
                    device.vendor.id = "0d8c"
                    device.vendor.name = "C-Media Electronics, Inc."
                    device.product.id = "0014"
                    device.product.name = "USB Audio Device"
                    device.serial = "C-Media_Electronics_Inc._USB_Audio_Device"
                    device.string = "front:1"
                    device.buffering.buffer_size = "19200"
                    device.buffering.fragment_size = "4800"
                    device.access_mode = "mmap"
                    device.profile.name = "analog-stereo"
                    device.profile.description = "Analog Stereo"
                    device.description = "USB Audio Device Analog Stereo"
                    alsa.mixer_name = "USB Mixer"
                    alsa.components = "USB0d8c:0014"
                    module-udev-detect.discovered = "1"
                    device.icon_name = "audio-card-usb"
            ports:
                    analog-output-speaker: Lautsprecher (priority 10000, latency offset 0 usec, available: unknown)
                            properties:
                                    device.icon_name = "audio-speakers"
            active port: <analog-output-speaker>
      * index: 1
            name: <alsa_output.platform-soc_sound.analog-stereo>
            driver: <module-alsa-card.c>
            flags: HARDWARE DECIBEL_VOLUME LATENCY
            state: SUSPENDED
            suspend cause: IDLE
            priority: 9009
            volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
                    balance 0,00
            base volume: 65536 / 100% / 0,00 dB
            volume steps: 65537
            muted: no
            current latency: 0,00 ms
            max request: 0 KiB
            max rewind: 0 KiB
            monitor source: 2
            sample spec: s32le 2ch 48000Hz
            channel map: front-left,front-right
                         Stereo
            used by: 0
            linked by: 1
            fixed latency: 100,00 ms
            card: 1 <alsa_card.platform-soc_sound>
            module: 7
            properties:
                    alsa.resolution_bits = "32"
                    device.api = "alsa"
                    device.class = "sound"
                    alsa.class = "generic"
                    alsa.subclass = "generic-mix"
                    alsa.name = ""
                    alsa.id = "HiFiBerry DAC+ HiFi pcm512x-hifi-0"
                    alsa.subdevice = "0"
                    alsa.subdevice_name = "subdevice #0"
                    alsa.device = "0"
                    alsa.card = "0"
                    alsa.card_name = "snd_rpi_hifiberry_dacplus"
                    alsa.long_card_name = "snd_rpi_hifiberry_dacplus"
                    alsa.driver_name = "snd_soc_hifiberry_dacplus"
                    device.bus_path = "platform-soc:sound"
                    sysfs.path = "/devices/platform/soc/soc:sound/sound/card0"
                    device.string = "hw:0"
                    device.buffering.buffer_size = "38400"
                    device.buffering.fragment_size = "9600"
                    device.access_mode = "mmap"
                    device.profile.name = "analog-stereo"
                    device.profile.description = "Analog Stereo"
                    device.description = "snd_rpi_hifiberry_dacplus Analog Stereo"
                    module-udev-detect.discovered = "1"
                    device.icon_name = "audio-card"
            ports:
                    analog-output: Analoge Ausgabe (priority 9900, latency offset 0 usec, available: unknown)
                            properties:
    
            active port: <analog-output>
        index: 2
            name: <alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo.echo-cancel>
            driver: <module-echo-cancel.c>
            flags: HW_MUTE_CTRL LATENCY
            state: SUSPENDED
            suspend cause: IDLE
            priority: 1000
            volume: mono: 65536 / 100%
                    balance 0,00
            base volume: 65536 / 100%
            volume steps: 65537
            muted: no
            current latency: 0,00 ms
            max request: 0 KiB
            max rewind: 0 KiB
            monitor source: 4
            sample spec: float32le 1ch 32000Hz
            channel map: mono
                         Mono
            used by: 0
            linked by: 0
            fixed latency: 100,00 ms
            module: 21
            properties:
                    device.master_device = "alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo"
                    device.class = "filter"
                    device.intended_roles = "phone"
                    device.description = "snd_rpi_hifiberry_dacplus Analog Stereo (echo cancelled with USB Audio Device Analog Mono)"
                    device.icon_name = "audio-card"
  • pacmd set-default-sink 1
  • sudo reboot
Hopefully now everything keeps working.