: (potential) problems introduced with the " improved stream linking and plugin code cleanups" patch by perex
The following issue has been SUBMITTED.
======================================================================
<https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1034>
======================================================================
Reported By: modax
Assigned To:
======================================================================
Project: ALSA - lib Issue ID: 1034 Category: pcm - digital audio Reproducibility: always Severity: major Priority: normal Status: new ====================================================================== Date Submitted: 04-03-2005 17:42 CEST Last Modified: 04-03-2005 17:42 CEST
======================================================================
Summary: (potential) problems introduced with the " improved
stream linking and plugin code cleanups" patch by perex Description:
I'm not an alsa developer so I hadn't known anything about alsa internals up until I started debugging alsa-lib to fix an annoying bug I was having with alsa 1.0.9rc1 and above. I'm not sure whether my patch/suggestions are 100% correct or the best way fix to those bugs.
The initial problem I'm refering to is described in bug#1009 note
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=0004275. I narrowed my search of the regression down to the big patch,
which was submitted to alsa-lib CVS on 2005-01-20 by perex. The patch cleans up plugin code. Unfortunately, some things have been overlooked by the author. Firstly, I'll start with my problem and a fix for it.
As I described in note
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=0004275, I had problems with -Dsurround51 on my
NFORCE board. The root of the problem was a combination of two plugins - route and hooks - used in surround51 configuration. Later I learned, that removing one of them helped, but they both wouldn't work. The portion of code which is to blame for the regression can be seen in hooks-channel-info-fix.patch (attached). Just compare the original pcm_hooks.c:snd_pcm_hooks_channel_info() (before "2005-01-20" patch) and pcm_generic.c:snd_pcm_generic_channel_info(), which was supposed to replace it. They are completely different functions. Other plugins which are likely to suffer from the same bug are:
* pcm_file.c
* pcm_plug.c
However, most other plugins used pcm_plugin.c:snd_pcm_plugin_channel_info() before the "2005-01-20" patch. It shares the same code with snd_pcm_generic_channel_info(). So this issue raises a few question:
* Is snd_pcm_generic_channel() as it is now valid? At least pcm_hooks
and likely pcm_file and pcm_plug don't work with it.
* If it's valid, there is a necessity to create another generic
function, which clones the code previously provided by snd_pcm_{hooks,file,plug}_channel_info() functions.
The attached patch solves the problem for me, but it is not an universal solution. The patch should be applied against CVS as of 2005-01-21 or later.
And now here it comes some other remarks regarding the "2005-01-20" patch.
* I guess, snd_pcm_plugin_fast_ops.status = snd_pcm_generic_status inpcm_plugin.c is incorrect because it makes snd_pcm_plugin_status() reduntant and these functions don't share the same code.
* Plugins which haven't been "cleaned up" by the "2005-01-20" patch
include:
- pcm_meter.c
- pcm_null.c
- pcm_share.c
- pcm_shm.c
The latter two seem to be kinda different beasts whereas the first two
shouldn't be too difficult to "_generic_"'ize.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
04-03-05 17:42 modax New Issue
04-03-05 17:42 modax File Added: hooks-channel-info-fix.diff
======================================================================
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click