Slider that does not stop the playback function when at 0

Post Reply
RaivisR
Posts: 9
Joined: Fri Oct 28, 2016 1:04 pm
Location: Latvia
Real Name: Raivis Rengelis
Contact:

Hi,

I am using QLC+ in a project where it not only controls the lights, but also plays back different sound effects and background music (game show environment) and according to sound designer wishes there should be a background track that is never restarted but just plays in loop and is muted when necessary.
I already implemented looping, so that is sorted, but now the problem is muting without stopping the function. My idea is to modify Slider widget and add configuration checkbox on playback page that would let user choose if function should be stopped on level 0 or not, if this would be enabled, function could still be stopped using some other VC widget if necessary. A few questions to great minds behind the codebase - would that be useful for other uses, like having continuous lights show flow that is dimmed/undimmed at some point? Would that interfere with other functionality of the system?

With best regards,
RR
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Hi Raivis, thanks for the audio looping patch. Will be merged shortly.

Question: have you tried to see if a submaster does what you need ? Basically place a button/slider attached to the looping audio function in a frame and place also a slider in submaster mode. When you move the submaster, it should control the Intensity attribute of the widgets inside the frame, which in the Audio case is the volume.
RaivisR
Posts: 9
Joined: Fri Oct 28, 2016 1:04 pm
Location: Latvia
Real Name: Raivis Rengelis
Contact:

Thanks for the idea, that seems to work, although there is noticeable delay between change of slider and actual volume change. If that delay appears to be too much, I will have to revert to the original plan to change the code, but for now, putting it on hold.
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

The delay is caused by the internal audio buffers.
The volume is applied to sample being pushed to the "render" buffer, while the audio you hear relates to the samples currently being "rendered".

I think we can try the Qt setVolume method and see if it's better.
I need to check the code though
RaivisR
Posts: 9
Joined: Fri Oct 28, 2016 1:04 pm
Location: Latvia
Real Name: Raivis Rengelis
Contact:

Wouldn't that work only for Qt renderer? I am using version with Qt 4 and alsa renderer in prod as that lets me play multiple audio samples at once, which did not work on RasPi and if I am not mistaken Qt 5 version.
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Yes, setVolume is a Qt5 method.
To summarize:
- windows builds bundle Qt5
- macOS builds bundle Qt5
- official Linux builds (32/64bit) still depends on Qt4 :sob:
- OBS Linux builds have both Qt4/Qt5 version
- Raspberry Pi bundles Qt 5.6.2

Both ALSA and Qt support multiple audio rendering
RaivisR
Posts: 9
Joined: Fri Oct 28, 2016 1:04 pm
Location: Latvia
Real Name: Raivis Rengelis
Contact:

Interesting, why on RasPi with latest image I was limited to 1 simultaneous audio playback then? Although, I was not using built in codec, but rather this https://www.element14.com/community/com ... audio_card as it has SPDIF output.
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Well, on the RPi the Qt backend is actually ALSA (I think they support pulseaudio as well though) so you can easily test if your soundcard supports multiple playback by opening two shells and doing:

Code: Select all

shell1# aplay file1.mp3
shell2# aplay file2.mp3
RaivisR
Posts: 9
Joined: Fri Oct 28, 2016 1:04 pm
Location: Latvia
Real Name: Raivis Rengelis
Contact:

will try that when I get a chance, I am suspicious now that it is limitation of driver for that specific codec chip and not limitation of Qt 5 or RasPi itself.

Returning to the original issue, it does not quite work in relatively complex setup the way it works in simple test, so I am still at square one with my problem, only I am not sure my initial solution is the right one.
RaivisR
Posts: 9
Joined: Fri Oct 28, 2016 1:04 pm
Location: Latvia
Real Name: Raivis Rengelis
Contact:

Massimo, is there any way I can chat with you privately?
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

RaivisR wrote: Thu Apr 06, 2017 6:37 pm Massimo, is there any way I can chat with you privately?
Sorry but no. If everyone in this forum would request a private chat with me, it would become my full daytime job.
Is there something you would tell me that you cannot write here in public ?
RaivisR
Posts: 9
Joined: Fri Oct 28, 2016 1:04 pm
Location: Latvia
Real Name: Raivis Rengelis
Contact:

That was exactly why I asked. I could probably get around my issues if there was some IRC channel or something more real time than forums where core developers hung around.
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

This project is not that big to have a real time channel like IRC where you can have immediate answers.
Time slots here are the spare time of myself and a few others.
RaivisR
Posts: 9
Joined: Fri Oct 28, 2016 1:04 pm
Location: Latvia
Real Name: Raivis Rengelis
Contact:

OK then, what do I do, implement non-stopping slider feature as initially planned, or investigate why sometimes function that is in multiple collections that are being switched by buttons in solo frame is restarted and sometimes is not? Should I add a feature or try to fix something that I believe is bug?
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

This thread is about muting an audio function.
Now you talk about a totally different thing. That's just confusion in this forum.

Like everybody else, report what you believe is an issue in the "Issues report" area, following the forum rules, so providing all the necessary details to understand, reproduce and eventually fix what you found.
Who will fix it can be decided once the issue is confirmed to exist.
Post Reply