openDsh / dash

Join us on Slack! https://join.slack.com/t/opendsh/shared_invite/zt-la398uly-a6eMH5ttEQhbtE6asVKx4Q
GNU General Public License v3.0
254 stars 80 forks source link

White screen on autostart (systemd) #131

Open TheWolf95 opened 2 years ago

TheWolf95 commented 2 years ago

Issue

White screen when autostarting

Hardware

Device Connection Method Screen Mobile Device Android Auto Version
Raspberry Pi 4 2GB USB C Cable on 3.0 ports Official Raspberry 7" Screen Android 9/10 (diff Devs) v.8.0.623354-release

Installation Method: Install.sh

Description of problem:

OpenDash works great and normally when as user I run manually the program. With RtAudio on I can connect the smartphone and OpenAuto starts with no issues. However if I use systemd to autostart it, I can't successfully connect the device (white screen) without turning off RtAudio and so I can't listen to Spotify with Bluetooth audio (while I can with RtAudio on).

[Service]
Environment="DISPLAY=:0"
Environment="XAUTHORITY=/home/pi/.Xauthority"
ExecStart=/home/pi/Desktop/dash/bin/dash
User=pi
Type=simple
Restart=always
RestartSec=3s
[Install]
WantedBy=graphical.target 

I use something like this as dash.service

Expected Result:

Expected OpenAuto to start without white screen as for normal execution (double click on dash file or launch with sh script)

Problem-relevant steps to reproduce:

  1. Create systemd service
  2. Reload daemon
  3. Start service
  4. Check if RtAudio is on
  5. Connect device
  6. White screen

Traceback (if applicable):

Let me know how can I give you a detailed log

Additional info:

Nothing that comes to my mind

rsjudka commented 1 year ago

hmmm... well this might help us narrow down why toggling RtAudio sometimes gets dash to work for some people :)

ngl I'm not too sure what RtAudio is or how it affects openauto, but this helps with a point where toggling it affects it! ill have to dig deeper into openauto to see how all this gets initialized and where the fault could be

TheWolf95 commented 1 year ago

Appreciate it! Hope this helps solving also the other RtAudio issues

Batman313v commented 1 year ago

@TheWolf95 I was having the same issue and after tinkering with a few methods and multiple reinstalls the method I finally got to work for me was changing how dash auto-starts. I started with the service method and noticed the issue however the issue wasn't present for running Dash via cli. So I started playing with auto-start / auto-run methods and the way that works for me is to create a file at /etc/xdg/autostart/run.desktop with the following contents:

[Desktop Entry]
Name=Dash
Exec=/home/pi/dash/bin/dash

Note: I am running on RPI 4 4GB with Bullseye 64bit. I am not using the Lite edition as I ran into far more problems and opted to disable some services and use various other optimizations I found on blog posts and hackaday articles to speed up boot.

I don't know if this helps find the underlying issue with RtAudio or not but this is how I got it to work without disabling it.