<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Refactoring idea: change sink and source ownership from the card back end implementation to pa_card"
href="https://bugs.freedesktop.org/show_bug.cgi?id=72523">72523</a>
</td>
</tr>
<tr>
<th>CC</th>
<td>lennart@poettering.net
</td>
</tr>
<tr>
<th>Assignee</th>
<td>pulseaudio-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Summary</th>
<td>Refactoring idea: change sink and source ownership from the card back end implementation to pa_card
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>pulseaudio-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Reporter</th>
<td>tanuk@iki.fi
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Component</th>
<td>core
</td>
</tr>
<tr>
<th>Product</th>
<td>PulseAudio
</td>
</tr></table>
<p>
<div>
<pre>When a sink or source belongs to a card, I think it would be a good idea to
make pa_card the owner of the sink or source. This would mean that pa_card
would decide when to create and destroy sinks and sources (they would be
created at profile activation and destroyed at profile deactivation). I think
this would make a lot of sense conceptually, but I'm not whether the effects on
the back end complexity would be positive or negative (I would expect a
positive effect).
The unclear part is how to delegate the back end specific parts of the sink
initialization (and deinitialization) to the back end, if pa_sink_new() is
called from card.c. I don't think we currently have any similar object
initialization scheme in PA.
This idea occurred to me while implementing device prototypes. It's annoying
that card back ends need to explicitly link the device prototypes with the sink
or source whenever the back end creates a sink/source. It's only one line per
created sink/source, but still it feels like unnecessary boilerplate code. If
pa_card controlled the sink and source creation, the common code in card.c
could take care of hooking the sinks and sources to the corresponding device
prototype.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>