From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org, Petri Latvala <petri.latvala@intel.com>
Cc: Ch Sai Gowtham <sai.gowtham.ch@intel.com>,
Andrzej Hajda <andrzej.hajda@intel.com>
Subject: [igt-dev] [PATCH RFC 0/1] Better handle video driver unload logic
Date: Thu, 14 Apr 2022 10:34:52 +0200 [thread overview]
Message-ID: <cover.1649924725.git.mchehab@kernel.org> (raw)
From: Mauro Carvalho Chehab <mchehab@kernel.org>
Audio device drivers can be hooking into the video drivers, in order to
handle audio from HDMI. On such cases, the video driver usage count
will be incremented.
Before unloading or unbinding such drivers, it is needed first to ensure
that no processes are using the audio devices and that the audio
modules are either unbind or unloaded.
Currently, the logic handles alsactl in daemon mode, but it doesn't
touch pulseaudio nor any other processes that could also be using it.
Make the logic more generic, in order to cover all audio-related processes
and add an special case for pulseaudio, which requires an special request
to stop using audio devices.
With that, tests like core_hotunplug will now do the right thing, even if
pulseaudio is loaded:
$ sudo ./build/tests/core_hotunplug --run unbind-rebind
IGT-Version: 1.26-g776e034e (x86_64) (Linux: 5.18.0-rc2-drm-0fd740aed3bb+ x86_64)
Starting subtest: unbind-rebind
Ask pulseaudio to stop using audio device
process 12919 (alsactl) is using audio device. Should be terminated.
Preventively unloaded audio driver
Subtest unbind-rebind: SUCCESS (2.146s)
I'm sending this as a RFC, as there are other cases that also need to be
covered there:
1. pipewire-pulse. This requires a new feature that was added at version 0.3.50,
released last week;
2. the current code covers only snd-hda-intel and snd-hdmi-lpe-audio. Other
audio modules may also need to be handled - like soc/sof audio drivers.
Mauro Carvalho Chehab (1):
tests/core_hotunplug: properly finish processes using audio devices
lib/igt_aux.c | 141 +++++++++++++++++++++++++++++++++++++++++
lib/igt_aux.h | 1 +
lib/igt_kmod.c | 39 ++++++++----
lib/igt_kmod.h | 2 +
tests/core_hotunplug.c | 11 +---
5 files changed, 173 insertions(+), 21 deletions(-)
--
2.35.1
next reply other threads:[~2022-04-14 8:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-14 8:34 Mauro Carvalho Chehab [this message]
2022-04-14 8:34 ` [igt-dev] [PATCH RFC 1/1] tests/core_hotunplug: properly finish processes using audio devices Mauro Carvalho Chehab
2022-04-14 10:08 ` [igt-dev] ✓ Fi.CI.BAT: success for Better handle video driver unload logic Patchwork
2022-04-14 12:00 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1649924725.git.mchehab@kernel.org \
--to=mauro.chehab@linux.intel.com \
--cc=andrzej.hajda@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=petri.latvala@intel.com \
--cc=sai.gowtham.ch@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox