-
Notifications
You must be signed in to change notification settings - Fork 59
fix pulseaudio re-start command line #300
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
Conversation
When running a kmod-load-unload test locally on a Ubuntu 20.04 machine, it couldn't re-start pulseaudio, the reason was, that the script was trying to start the command in the form ' pulseaudio -D' i.e. with several spaces in front of the executable name and that didn't work. Whereas just using the line as obtained from "ps" output works. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
|
Thanks @lyakh for looking at the pulseaudio situation, I'm afraid you don't realize what you're getting yourself into :-) Now if you think you can (gradually) improve this situation then great! Can you first try to (partially?) revert c7d2477? I think it was not well tested and buggy, see discussion about this commit in PR #266 which maybe related to yours. I think extracting pulseaudio arguments from the output of BTW I created a new label "pulseaudio" in sof-test for convenience, please click on it on the right side of this page. |
|
@marc-hb not sure I wanted to go as far as changing the world (TM) by fixing pulseaudio ;-) There might be slightly more or less correct ways of doing something, e.g. of stopping and re-starting PA, specifying or not specifying environment, missing some command-line arguments, starting as a wrong user, etc. But not starting at all because of a wrong process name should be fixed IMHO. |
Understood. I would still like someone (you?) to explore the history of |
I looked at c7d2477 Though it doesn't strike me as a feat of elegance, it says it's fixing some error checking bug and by just looking at it I'm not sure I know what that bug was. So, reverting it completely or even some not fully understood and unverified parts of it might bring that bug back. |
marc-hb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spent a bit more time looking at the pulseaudio situation. I think the entire approach in this script is broken, as somewhat confirmed by #289 (comment)
We tried a lot of ways to deal with pulseaudio, but in vain.
It's broken because on Ubuntu (and probably many others), pulseaudio is started by systemd's pulseaudio.socket as described by @juimonen in #289
This implies at least two issues:
-
pulseaudio will restart even after having been "disabled" by
func_lib_disable_pulseaudio()which should really be calledfunc_lib_fail_to_kill_pulseaudio(). A simpleaplaycommand is enough to restart pulseaudio, I just checked. -
As already discussed in #266,
systemdstarts pulseaudio with--daemonize=nowhich causes various issues when re-using that parameter.
Instead of these functions we should use the systemd one-liners suggested by @juimonen in #289.
In the meantime the only configuration officially supported by sof-test is apt remove pulseaudio
All this being said, I'm approving because if you think it works for you sometimes then why not. These functions are considered "not in service" anyway.
@marc-hb thanks, without this patch I cannot run tests at all, so, yes, it seems like an improvement to me. |
Before running sof-test you should either |
@marc-hb that doesn't sound like a good idea to me. Firstly we want to test with pulseaudio, that's how SOF has to function, secondly if I understand correctly sof-test only tries to disable PA for module loading-unloading tests and only unless a parameter is specified explicitly to block that behaviour. |
There are different levels of testing. For the lowest level and most fundamental and most important level of testing we don't want pulseaudio to interfere with the tests (it has been for a very long time)
That's not my understanding.
As @aiChaoSONG mentioned there has already been an enormous amount of time spent trying to disable and re-enable pulseaudio dynamically. Since it has failed repeatedly (and inconsistently), pulseaudio is now removed. See above where I could reproduce one of these undesired autospawns in minutes. I'm afraid these attempts didn't use |
@kv2019i I think it was you who suggested, that since we now always run with PA enabled "in the field" i.e. on Linux laptops and the like, that's also how we should test? And that even some use-cases won't work without it? |
|
First of all test without PA to ensure the driver and firmware are okay, then test with as well to compare. Some issues are due to PA configuration and the UCM... |
|
I agree with @lyakh that you cannot ask testers to remove pulseaudio on their target machines. |
|
CI systems would ideally have as few differences as possible with real world systems. Unfortunately removing pulseaudio on them is the best we can do for now. Patches welcome! PS: removing and re-installing pulseaudio with apt takes seconds. |
|
To @lyakh, ack on @paulstelian97 's reply that it is perfectly valid to have both -- e.g. to have a set of tests where Pulseaudio should be disabled and another with the full vertical stack (including Pulseaudio). Given we target a more limited set of distros, disabling Pulseaudio from the script in a robust way, should still be a doable task (and yes, I understand patches are welcome). In wider context of upstream bugs, I usually ask the bug reporter to rename the PA binary and kill all PA processes. This is a minimal procedure that works 100% of the time, but for our CI scripts, I believe we can have something cleaner... and not require to uninstall PA. |
|
fwiw systemd may be respawning pulseaudio too (since it seems to ignore it's own "no respawn" config). |
|
@lgirdwood wrote:
That's one aspect that complicates life in wider context of Linux systems, but in our case (mostly Ubuntu/Fedora), Pulseaudio is run as part of the user session and not as a system-wide daemon. So these instructions to stop Pulseaudio and disabling autospawn should work for all CI cases: https://wiki.debian.org/PulseAudio . But yeah, in wider context, there are a lot more options -- Arch Linux installs a systemd service and e.g. Pulseaudio Snap for Ubuntu adds a systemd unit for some reason -- and then you have to worry about the separate spawn mechanisms of systemd. |
|
I forgot to remove pulseaudio and my test script (as root) just hung forever because: Ctrl-Z
ps f
sudo -u user /usr/bin/pulseaudio --daemonize=no --log-target=journalI admittedly did NOT have autospawn and systemd configured not to start it. I just found this other knob by chance: |
Sort of fixes commit 8b02299 ("fix pulseaudio re-start command line"). The whole pulseaudio situation is a mess anyway, see PR thesofproject#300 and others. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Sort of fixes commit 8b02299 ("fix pulseaudio re-start command line"). The whole pulseaudio situation is a mess anyway, see PR thesofproject#300 and others. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
When running a kmod-load-unload test locally on a Ubuntu 20.04 machine, it couldn't re-start pulseaudio, the reason was, that the script was trying to start the command in the form ' pulseaudio -D' i.e. with several spaces in front of the executable name and that didn't work. Whereas just using the line as obtained from "ps" output works.
I'm not sure how reliable this solution is. But it also boils down to whether we should use
psoutput to re-start pulseaudio or just usepulseaudio --start. Maybe the latter would be more reliable.