Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatically start "Auto DJ" at startup #10189

Closed
mixxxbot opened this issue Aug 23, 2022 · 11 comments · Fixed by #13017
Closed

automatically start "Auto DJ" at startup #10189

mixxxbot opened this issue Aug 23, 2022 · 11 comments · Fixed by #13017

Comments

@mixxxbot
Copy link
Collaborator

Reported by: eitanc
Date: 2020-10-31T17:51:10Z
Status: Confirmed
Importance: Wishlist
Launchpad Issue: lp1902379
Tags: autodj, easy


Hi,

I wish to ask for a feature where users will be able to activate/enable/run (and also disable/stop, whatever is needed) the "Auto DJ" mode at Mixxx startup, either using a command line startup switch or using a setting in the user's own "mixxx.cfg" user-specific configuration file.

Adding also a setting to "Shuffle" on or off the "Auto DJ" will be great.

This will support a use case of using Mixxx in an automated fashion, like an "Internet Radio Station" source – just run Mixxx and it will immediately start broadcasting a ready-in-advance list of files.

Thanks.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2020-11-01T12:07:32Z


This can also be a preference option in the Auto-DJ preferences than it will be found by more users.

@mixxxbot
Copy link
Collaborator Author

Commented by: eitanc
Date: 2020-11-01T14:56:32Z


Yep, adding a Preferences "Auto DJ" option, named something like "Enable Auto DJ at Mixxx startup", with either a yes/no checkbox or yes/no drop-down list.

@mixxxbot
Copy link
Collaborator Author

Commented by: ronso0
Date: 2020-11-02T10:18:37Z


I disagree here:
when being started Mixxx should not make any sound on its own!
That's why we mute all mics and aux on startup that might still be attached to an active audio source.
For regular users engaging AutoDJ is no big deal.

For this special case here a command line option is more appropriate.
Also we finally need to add an Auto status light to all skins.

@mixxxbot
Copy link
Collaborator Author

Commented by: ginoissel777
Date: 2021-05-31T07:19:28Z


hi Eitan,

Just FYI - I had the same use case my side and played around with a raspberry pi 3B, raspbian, installed Mixxx 2.2.0, and use the the application to queue all my mixes particularly for internet radio broadcast.
wanted to verify that even when there is a power failure, that this small box would come up, and start playing "autodj" and whatever was in the autodj queue. only when I want to do a live set/broadcast using the MIC, would I then stop the autodj.

For starting mixxx up when pi starts up...

I used the LXDE-pi "autostart"

/etc/xdg/lxsession/LXDE-pi
edited this with nano and added /home/pi/autostart.sh

as for the /home/pi/autostart.sh itself I added this
with the following

ping localhost -c 20 <-- this would provide me with a pause/sleep for the my audio devices to be picked up as sometimes the mixxx run way too fast and never picked up any audio devices.
mixxx <-- this was in my path and could start from anywhere.

this would bring up the mixxx program...

ping localhost -c 20 <--  same reason as above - give time for program to load.

the only issue now was to get mixxx to select and start AutoDJ, and then start broadcasting.
I came across an automation tool called "xdotool" and started playing around with this. I eventually had to change my EnableLiveBroadcasting to the "Shift+F8" key in the default /usr/share/mixxx/keyboard/en_US.kbd.cfg as somehow the xdotool did not like my Control+L key combination.

with my specific monitor/display I used the following to select and get things going...

xdotool mousemove 100 100 click 3; xdotool key shift+F8; xdotool mousemove 120 550 click 1; xdotool key Shift+F12

explanation :
the "100 100" is X Y axis and click 3 is a right click on that window it finds.
then shift+F8 is to enable livebroadcasting; with my active display, I then select the "AutoDJ" just below "Tracks" and then start the AutoDJ itself by doing a Shift+F12

So eventually my "autostart" startup script under /etc/xdg/lxsession/LXDE-pi

had @sh /home/pi/autostart.sh
just before the "@xscreensaver

and the actual /home/pi/autostart.sh had

ping localhost -c 10
mixxx &
ping localhost -c 30
lxterminal --command "DISPLAY=:0 xdotool mousemove 100 100 click 3; xdotool mousemove 120 550 click 1; xdotool key Shift+F12; xdotool key shift+F8"
ping localhost -c 5

Dont know if this would work headless - but for my use case this worked, you might need to play around with the xdotool to select, or use keys for selection if required.

Anyway - just FYI - happy playing

Regards
Gino

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@foss-
Copy link
Contributor

foss- commented Dec 10, 2023

when being started Mixxx should not make any sound on its own!

+1
to me this reads like wontfix.

@ronso0
Copy link
Member

ronso0 commented Dec 10, 2023

I disagree.

For this special case here a command line option is more appropriate.

Users can then create a custom app launcher, e.g. with mixxx --start-autodj.
We should add some basic documentation how to do this.

@danferns
Copy link
Contributor

Hi, I'd like to take this one up!

@daschuer
Copy link
Member

Go ahead. Do you need help?

@danferns
Copy link
Contributor

Yes! I added the CLI option inside util/cmdlineargs. Now, I'm trying to find the right place in the code to check this flag and then enable the Auto DJ command.

@danferns
Copy link
Contributor

I think I figured it out! Thanks for letting me go ahead with this issue. Will send the PR soon :)

@daschuer
Copy link
Member

You can just pick up what you like without asking.
Just make sure to describe you solution before jumping into the code, wen not already done like here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants