Page 1 of 1

Slider that does not stop the playback function when at 0

Posted: Wed Apr 05, 2017 2:38 pm
by RaivisR
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

Re: Slider that does not stop the playback function when at 0

Posted: Thu Apr 06, 2017 8:15 am
by mcallegari
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.

Re: Slider that does not stop the playback function when at 0

Posted: Thu Apr 06, 2017 10:09 am
by RaivisR
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.

Re: Slider that does not stop the playback function when at 0

Posted: Thu Apr 06, 2017 10:25 am
by mcallegari
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

Re: Slider that does not stop the playback function when at 0

Posted: Thu Apr 06, 2017 11:07 am
by RaivisR
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.

Re: Slider that does not stop the playback function when at 0

Posted: Thu Apr 06, 2017 11:53 am
by mcallegari
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

Re: Slider that does not stop the playback function when at 0

Posted: Thu Apr 06, 2017 12:15 pm
by RaivisR
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.

Re: Slider that does not stop the playback function when at 0

Posted: Thu Apr 06, 2017 12:40 pm
by mcallegari
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

Re: Slider that does not stop the playback function when at 0

Posted: Thu Apr 06, 2017 2:55 pm
by RaivisR
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.

Re: Slider that does not stop the playback function when at 0

Posted: Thu Apr 06, 2017 6:37 pm
by RaivisR
Massimo, is there any way I can chat with you privately?

Re: Slider that does not stop the playback function when at 0

Posted: Thu Apr 06, 2017 7:59 pm
by mcallegari
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 ?

Re: Slider that does not stop the playback function when at 0

Posted: Fri Apr 07, 2017 6:05 am
by RaivisR
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.

Re: Slider that does not stop the playback function when at 0

Posted: Fri Apr 07, 2017 6:46 am
by mcallegari
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.

Re: Slider that does not stop the playback function when at 0

Posted: Fri Apr 07, 2017 6:55 am
by RaivisR
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?

Re: Slider that does not stop the playback function when at 0

Posted: Sat Apr 08, 2017 11:45 am
by mcallegari
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.