Firefox sound via crontab launch
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Firefox sound via crontab launch
20.1 Cinnamon 4.8.6
I'm launching Firefox by crontab ... (reason, once a week perform updates and restart Firefox) ... however, there's no sound.
0 4 * * 1 pkill firefox
5 4 * * 1 export DISPLAY=:0 && firefox
...works, and with the right options in firefox, it just picks up where it left off. However... it won't play audio. The default output for sound is OK, but nothing comes out, until I quit firefox and restart by using the icons. Changing default audio destination and refreshing the page doesn't work either.
I'm guessing that there needs to be an equivalent export for the sound, as there is for the display, but I'm at a loss and need help please.
I'm launching Firefox by crontab ... (reason, once a week perform updates and restart Firefox) ... however, there's no sound.
0 4 * * 1 pkill firefox
5 4 * * 1 export DISPLAY=:0 && firefox
...works, and with the right options in firefox, it just picks up where it left off. However... it won't play audio. The default output for sound is OK, but nothing comes out, until I quit firefox and restart by using the icons. Changing default audio destination and refreshing the page doesn't work either.
I'm guessing that there needs to be an equivalent export for the sound, as there is for the display, but I'm at a loss and need help please.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Firefox sound via crontab launch
Hi msknight,
See if changing your first line to this helps:
That will restart the sound daemon, but may introduce unwanted results. For example, any currently playing audio will stop.
See if changing your first line to this helps:
Code: Select all
0 4 * * 1 pkill firefox && pulseaudio -k
Re: Firefox sound via crontab launch
Hi MrEen,
Good suggestion, but sadly it didn't work.
Good suggestion, but sadly it didn't work.
Re: Firefox sound via crontab launch
Okay, undo that change obviously.
Your "firefox" command just launches Firefox, and isn't an alias to firejail, correct? If you don't know what I'm talking about, that means the correct answer would be, "Correct."
The next time Firefox is started and doesn't work, run this in the terminal and paste the output:
Maybe I'll spot something in the link it gives that will provide a clue.
Your "firefox" command just launches Firefox, and isn't an alias to firejail, correct? If you don't know what I'm talking about, that means the correct answer would be, "Correct."
The next time Firefox is started and doesn't work, run this in the terminal and paste the output:
Code: Select all
curl https://gitlab.freedesktop.org/pulseaudio/pulseaudio/raw/master/src/utils/pa-info?inline=false | bash | nc termbin.com 9999
Re: Firefox sound via crontab launch
Here you go - https://termbin.com/z5q0
Interestingly the default sink is the podcaster mic, but I did plug some headphones in and nothing's coming out of the monitor there.
However, worth changing the default sink I presume... but I'll hang off doing anything until you've had a look.
Interestingly the default sink is the podcaster mic, but I did plug some headphones in and nothing's coming out of the monitor there.
However, worth changing the default sink I presume... but I'll hang off doing anything until you've had a look.
Re: Firefox sound via crontab launch
Yeah, that default sink is certainly the issue here. I assume you want the HDMI output as default, which this will quickly set:
We may need to add a similar line to /etc/pulse/default.pa if this keeps happening.
Code: Select all
pacmd set-default-sink alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1
Re: Firefox sound via crontab launch
Sadly, didn't work.
The default sink I would like to set is the digital output on the built in card, so I'm presuming that's alsa_output.pci-0000_00_1f.3.iec958-stereo
But that didn't work either. Still silent when started via crontab.
The default sink I would like to set is the digital output on the built in card, so I'm presuming that's alsa_output.pci-0000_00_1f.3.iec958-stereo
But that didn't work either. Still silent when started via crontab.
Re: Firefox sound via crontab launch
I rarely see Digital as the default, and as the HDMI was available had assumed that was the one you wanted.
You did try the correct one after all, and by "didn't work" we need to clarify one thing. Setting the default this way does not move currently playing audio to the new device. Only newly started audio will start using the new default output. Was that tested?
You did try the correct one after all, and by "didn't work" we need to clarify one thing. Setting the default this way does not move currently playing audio to the new device. Only newly started audio will start using the new default output. Was that tested?
Re: Firefox sound via crontab launch
The first test was that the setting was changed, firefox processes were pkilled and then crontab allowed to restart Firefox.
When that failed, I did re-do the test but reset pulseaudio after changing the setting again, just in case.
Knowing how to switch the default to the digital output actually helps another side issue I've got, so that's been a bonus. Is that set now, or do I need to update a config file please?
The overarching aim of this is to keep the main machine running, as it monitors e-mail, some game servers and server status on a few things, so I keep the box running 24/7 and only reboot for kernel updates... but the only thing that usually locks up the machine is when Firefox has leaked so much memory that I have to power off the machine and restart it... then reload everything. Hence trying to restart via Crontab.
Many thanks for your efforts on this.
When that failed, I did re-do the test but reset pulseaudio after changing the setting again, just in case.
Knowing how to switch the default to the digital output actually helps another side issue I've got, so that's been a bonus. Is that set now, or do I need to update a config file please?
The overarching aim of this is to keep the main machine running, as it monitors e-mail, some game servers and server status on a few things, so I keep the box running 24/7 and only reboot for kernel updates... but the only thing that usually locks up the machine is when Firefox has leaked so much memory that I have to power off the machine and restart it... then reload everything. Hence trying to restart via Crontab.
Many thanks for your efforts on this.
Re: Firefox sound via crontab launch
Just guessing here, but what if you set the RODE to input only, so it won't be available as an output:
Code: Select all
pacmd set-card-profile alsa_card.usb-RODE_Microphones_RODE_Podcaster_v2_7A48BB99-00 input:mono-fallback