Added initial support for PulseAudio in KMix. #19
Merged
MicheleC
merged 1 commits from feat/pa-support
into master
4 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'feat/pa-support'
Deleting a branch is permanent. It CANNOT be undone. Continue?
The mixer/device channel to control from the system tray widget is now selectable from the user and default to the main one if not specifically selected. This allows to control PulseAudio volume from KMix correctly if PA is installed on the system
This PR makes the PR proposed in bug 2782 (#4) obsolete. Please note additional work is still required to integrate KMilo and also to fix a few extra issues in KMix.
Added initial support for PulseAudio in KMix.to WIP: Added initial support for PulseAudio in KMix. 4 years ago@deloptes
Could you test this PR and let me know if you can correctly control PA volume on your system using the KMix tray icon/slider? Please note KMilo support is still not working correctly.
To test:
Hi Michele,
went through the steps but Step 4. does not return behaviour to control PA Master channel
- mute unmute impacts now Master and PCM in the ALSA only (I mean visually it does not switch off the PA Master
- also the volume slider does not control PA anymore.
- also PA Master shows up at 50% but ALSA is at 100%.
- also mouse wheel controls sound but not the mixer (left mouse click). When mixer is open the PA slider is not controlled by mouse wheel. In the ALSA however it is.
Same on the D520 and on top, what I am missing all the time is to handle dynamic devices - like BT mixers or perhaps USB (but I have not tried USB here). I tested however BT (as you perhaps know) and the problem is that one can not configure BT-device audio properties with kmix, but can with PA volume control.
I think this topic is much bigger, than it seems and IMO the original patch controlling all the master channels was OK. Might be that something in between is the truth, but I had no time to look into details in yours or in the others patch.
Thinking about it once again, why should PA has only master channel? And why should kmix mess up with ALSA and PA?
If PA is installed, then primary control should be on PA, if not on ALSA device. In fact PA is "just" another device. What I mean is I am missing a TDE interface similar to pactl. It would be great if we had such interface.
I'm curious to know how kmix is working, but don't have the time to go deeper now.
Hi Emanoil, thanks for testing.
There is currently a problem with the update of the slider for PA master in the mixer window, this was preexisting and is a point I was already planning to look at. Both step 2. and 4. should give the exact same results, which are what you described:
So for what I see here and your comments, it seems things are in sync.
This patch and for R14.1.0 there will only be minimal support for PA in KMix, as in the Master channel only. For R14.2.0 I would like to extend KMix to properly support PA, that is add the ability to control the volume of individual streams as can be done at the moment using pavucontrol for example/
KMix currently shows the actual hw device channels related to PA. The sw streams are not yet supported, as mentioned in the previous comment I would like to add them for R14.2.0.
KMix will also list all available mixers in the system.
Correct, if PA is installed, PA should be the primary control as the "default" option in this PR does. But if a user wants to control a different channel for some reasons, he is given the ability to do so.
Hi Emanoil, I have done further testing while working on keyboard shortcuts. I confirm there is a problem with the update of the tray icon when KMix is started with the default channel already selected. This is probably what you saw at point 4. If you select another channel and select back to default, it works. I will work on a fix 😄
@deloptes @roman
Could you test this PR on your system and let me know if it works fine with muting/unmuting the selected mixer/device? Please note that:
Thanks for any feedback 😄
Further update to the code. Now even the slider's mute/unmute and wheels event should work nicely. Furthermore increasing/decreasing the volume using keyboard shortcut should now work. No KMilo is required for that, so appreciated if you could test without KMilo installed, just for the sake of it.
Hi Michele,
I did compile the pa patch and installed kmix without restarting the desktop. The MM keys did not work even after removing kmilo.
The rest looks good. I will look forward to test on the D520 tomorrow. I can reboot there and test fresh.
Hi Emanoil, thanks for testing.
Regarding the MM keys, did all three functions (increase volume, decrease volume, mute/unmute) not work? Have you tried assigning different shortcuts to them for a test? I can see the functions working here on my VM. I can try on a laptop later on if required.
Now that I am think of it, please take note there is no OSD feedback for volume change using this code. Something I missed out, I will have to put it back in 😄
Confirmed the MM keys don't work, I tried on my old laptop. But if reassigned they do, so the functionality is there. Just need to clean it up properly 😉
@deloptes @roman
Could you test this PR again, together with TDE/tdeutils#26? What it does is as follow:
this PR allows the user to select the default mixer/device to consider as master (by default it will be the default mixer)
KMilo volume controls acts on such selected channel.
This adds support for PA on a default installation.
Notes:
in case you had assigned special global shortcuts in KMix, make sure they are either removed or do not conflict with the global shortcuts specified in KMilo
suggest you make a reboot before testing or alternatively exit kmix and stop kmilo, then run kmix and kmilo again. This is to make sure global keyboard shortcuts are correctly handled.
Hi Michele,
this works almost great. There are two things I noticed:
This might be OK if we assume that kmix is always taking the Master as default, but I noticed that:
If 1. is on purpose then it looks like only 2 needs more attention.
thanks, Michele
Hi Emanoil, first of all thanks for testing.
"default" means that KMix will use the master channel that would automatically be selected by the system, so that is the reasons the other options are grayed out.If you choose "custom", then you can select any of the available channels on any available mixer.
if you have only ALSA installed (no PA), then "default" will control the master channel only. If you have PA installed, "default" will control the PA master channel. PA will then control volume and mute status of ALSA master and PCM. On my system, muting PA mutes both ALSA master and PCM. On your D520 system if I remember correctly, you don't have a mute switch for PCM, so only ALSA master will be muted/unmuted by PA
when controlling ALSA master with custom config, muting will mute PA too, and consequently ALSA PCM too if available. When unmuting, only ALSA master will unmute while PA master will remained muted since PCM is still muted. You should be able to reproduce this behavior in alsamixer (even without running KMix at all) if you act on the ALSA master instead of PA master. This is something I also see here and many people have already observed. Since this is a custom config from the user and the behavior is as per expected, I don't see a problem here. Basically if PA is installed, we should control PA master to have the correct mute/unmute behavior 😉
In summary, your tests matches my tests too and it works as expected, based on the actual user choice.
Does this explanation clear your doubts?
Hi,
regarding 1) no problem with this at all - I was just double checking
regarding 2) you want to say that PA is controlling the ALSA device (Master/PCM)?
Because as mentioned only the PCM was going up/down. So what you say means that PA is controlling only the PCM? I'll double check this with the PA mixer.
regarding 3) I observed described behavior only after changing configuration default -> custom -> default. Before it was default, but was behaving as you describe the custom one. It could be that there was some left over.
Mute/Unmute seems OK in all cases.
regards
Hi Emanoil,
ok, all clear
yes, PA is controlling ALSA master and PCM, both volume and mute. This is regardless of whether kmix is running, you can check this in alsamixer. On my system, first PCM volume goes down, then at very low percentage of PA master volume, even ALSA master volume goes down to 0. Not sure if this is the same on all systems, but it is nothing to do with kmix or TDE in any case.
I have tried to replicate your item 3 here, but I always see consistent behaviour. Could you double check first, then if you can reproduce this systematically please let me know the exact steps and I will try again (I have both VM and real laptop available).
I will wait for you feedback before proceeding on this.
Thanks for the support in testing 😄
Hi Michele,
I can confirm 2) and 3) with what you are saying.
Regarding 2) the volume control decreases only ALSA PCM, but when it reaches minimum also ALSA Master is set to 0.
Regarding 3) it seems something was saved in config when testing previous versions. Now it behaves exactly as expected.
I wonder if I should test with a fresh user. I can do this later this evening. Let me know if desired.
regards
Hi Emanoil
sure, why not. A quick test on a fresh user will provide extra feedback. If all is good, I can then merge this. If we find a problem, I will look into it.
Thanks!
Hi Michele,
now tested on the VM with new user.
Uninstalled PA - ALSA controls work great. Installed PA - controls work great. I can not reproduce 3) anymore.
ok, thanks for checking and confirming this. I will proceed with merging.
On a side note, I think you may have observed the problem in 3) if you had started PA after KMix. In such case KMix would have been controlling the ALSA master and not the PA master, since it can't at present detect changes in mixers at run time (it is in my todo list at some point).
Thanks for all the test and support.
WIP: Added initial support for PulseAudio in KMix.to Added initial support for PulseAudio in KMix. 4 years agoe1b2705c5d
.