Solved, Raspberry4 raspbian boot audio problem and hdmi boot solution.

All the topics related to QLC+ on the Raspberry Pi
Post Reply
urieldiazg
Posts: 14
Joined: Thu Mar 02, 2017 7:03 am
Real Name: Uriel Diaz

Hello good day friends.

I have an audio related problem that I have not been able to resolve. I have searched and read post here on the qlcplus blog but I have not been able to solve the problem. I hope someone can help me and I hope they do not bother to open a topic related to audio when there are already topics related to this, but as I said before, I already read them and I have not been able to solve the problem.

I am using an raspberrypi4 of 8gb ram, and built the qlcplus from github and the binaries. I have installed an hdmi screen to the raspberry, and I have programmed routines of lighting effects in QlcPlus to the rhythm of music.

The program that I made in qlcplus with integrated music is executed at the start of the raspberry in kiosk mode through a script sh and crontab -e, also create a shortcut on the raspbian desktop in case the user wants to execute by clicking.

The problem I have, the audio is not heard at the boot of the raspberry.
It works correctly when I close the qlcplus application in kiosk mode and reopen, either from the launcher (direct access) or by executing the script from the terminal, in both cases the audio works correctly, but from the start it does not works.

What I have done is this:

Starting qlcplus in kiosk mode at raspberry4 boot with crontab -e:

Code: Select all

# m h dom mon dow command
@reboot sh /home/pi/run.sh
The run.sh script

Code: Select all

#! / bin / bash
cd / home / pi
sleep 10
export DISPLAY =: 0.0
qlcplus -k -w -f -o /home/pi/hello.qxw -p -c 1220,690,32,32
cd / home / pi
Before I had the problem of executing and displaying qlcplus in kiosk mode at startup with hdmi, so the script has a waiting time and the "export DISPLAY =: 0.0" helped a lot.

But I also had to add this:

"THIS IS THE SOLUTION FOR THOSE WHO HAVE NOT BEEN ABLE TO RUN QLCPLUS SINCE THE RASPBIAN BOOT IN KIOSK MODE WITH HDMI"

sudo nano /home/pi/.bashrc

Code: Select all

# I added these lines to the end of the file.

export XAUTHORITY = / home / pi / .Xauthority
export DISPLAY =: 0.0
xhost +
Now I can display qlcplus in kiosk mode at raspbian boot on raspberry4, but the saved sound is not heard, no audio is output. I would like it to output audio in hdmi or the audio plug of the raspberry4, in either of the two outputs…. It works when I close the program and run again, but I want the application to run automatically, so it is very important to me that audio is output from startup.

I hope someone can advise me something. I thank you very much, greetings and good day friends ..
Last edited by urieldiazg on Thu Sep 24, 2020 4:03 am, edited 1 time in total.
urieldiazg
Posts: 14
Joined: Thu Mar 02, 2017 7:03 am
Real Name: Uriel Diaz

Problem solved.

It was very simple, I did not expect this to be the solution.

I was running QlCplus at raspberry boot with the help of cron but in root mode, that is, in crontab -e. I've always done it like this and hadn't had any problems, even this time the audio didn't work when the raspberry started.

The solution was to remove the crontab -e command and put it in crontab -e -u pi where I normally schedule common tasks that don't necessarily need root permission, it worked amazingly.

Don't run QlcPlus in crontab -e at raspberry boot.

Code: Select all

crontab -e
#@reboot sh /home/pi/run.sh
The solution was to start QlcPlus in crontab -e -u pi at raspberry boot.

Code: Select all

crontab -e -u pi
@reboot sh /home/pi/run.sh
Actually I don't know why the audio at raspberry startup works in common task cron and it doesn't work in root mode cron, but it worked.

I hope it serves you. Regards.
Post Reply