<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>193768</bug_id>
          
          <creation_ts>2007-09-25 16:56 0000</creation_ts>
          <short_desc>[WITH ONELINE FIX] media-plugins/alsa-plugins builds broken speex rate converter.</short_desc>
          <delta_ts>2007-10-20 15:46:46 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Library</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>sybolt@xs4all.nl</reporter>
          <assigned_to>alsa-bugs@gentoo.org</assigned_to>
          <cc>flameeyes@gentoo.org</cc>
    
    <cc>ssuominen@gentoo.org</cc>
    
    <cc>sybolt@xs4all.nl</cc>

      

      
          <long_desc isprivate="0">
            <who>sybolt@xs4all.nl</who>
            <bug_when>2007-09-25 16:56:35 0000</bug_when>
            <thetext>When media-libs/speex is installed, media-plugins/alsa-plugins links 
/usr/lib/alsa/libasound_module_rate_speexrate.so with the system libspeex, resulting in an unusable rate converter.

Reproducible: Always

Steps to Reproduce:
1.make sure media-libs/speex is installed
2.(Re)emerge media-plugins/alsa-plugins
3.echo &quot;defaults.pcm.rate_converter \&quot;speexrate\&quot;&quot; &gt;&gt; .asoundrc
4.mpg123 some_mp3.mp3
Actual Results:  
I hear nothing because mpg123 segfaults:
&lt;snipped&gt;
ALSA lib pcm_rate.c:1381:(snd_pcm_rate_open) Cannot find rate converter
zsh: segmentation fault  mpg123


Expected Results:  
a 44.1kHz mp3 should be automatically upmixed by dmix to 48kHz on a dmixed soundcard (by default any soundcard that doesn&apos;t do hardware mixing)
I expect to hear music.

The fix is simple: add the line 
--with-speex=builtin \
to econf in the ebuild, and media-plugins/alsa-plugins won&apos;t pick up the system libspeex, and build a working libasound_module_rate_speexrate.so. Alternatively, adding
--with-speex=no \
instead will also fix the problem, by not building the speex rate converter at all.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ssuominen@gentoo.org</who>
            <bug_when>2007-09-25 18:33:57 0000</bug_when>
            <thetext>media-lib/speex-1.2_beta2? If yes, does it work if you build it with USE=&quot;wideband&quot;? If no, ignore this message.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>sybolt@xs4all.nl</who>
            <bug_when>2007-09-25 19:11:16 0000</bug_when>
            <thetext>(In reply to comment #1)
&gt; media-lib/speex-1.2_beta2? If yes, does it work if you build it with
&gt; USE=&quot;wideband&quot;? If no, ignore this message.
&gt; 

I am on ~x86, and yes, I am media-libs/speex-1.2_beta2 (along with media-plugins/alsa-plugins-1.0.14). Reemerging speex with USE=&quot;wideband&quot; produces the same result. Regards, Sybolt</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>sybolt@xs4all.nl</who>
            <bug_when>2007-09-25 19:47:05 0000</bug_when>
            <thetext>Just tested reverting media-libs/speex-1.2_beta2 to media-libs/speex-1.1.12. This fixes the issue, so the problem is a speex API change. Anyway, I believe media-plugins/alsa-plugins needs to do one of 3 things:

1. disable the speex rate converter (--with-speex=no)
2. explicitly enable the builtin rate converter (--with-speex=buitin)
3. add a dependency on media-libs/speex (and --with-speex=lib)

Although the last option will not produce a working rate converter until alsa-plugins is updated upstream to work with new speex. Regards, Sybolt</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ssuominen@gentoo.org</who>
            <bug_when>2007-09-25 20:25:35 0000</bug_when>
            <thetext>In fact, alsa-plugins-1.0.15_rc1 is out and configure.in has:

[ snip ]

if test &quot;$PPH&quot; = &quot;lib&quot;; then
        PKG_CHECK_MODULES(speex, [speex &gt;= 1.2], [USE_LIBSPEEX=&quot;yes&quot;], [USE_LIBS
PEEX=&quot;&quot;])
        if test &quot;$USE_LIBSPEEX&quot; = &quot;yes&quot;; then
                AC_CHECK_LIB([speex], [speex_resampler_init],
                        [USE_LIBSPEEX=&quot;yes&quot;], [USE_LIBSPEEX=&quot;&quot;])
        fi
        if test &quot;$USE_LIBSPEEX&quot; = &quot;yes&quot;; then
                AC_DEFINE(USE_LIBSPEEX, 1, &quot;Link with libspeex for resampler&quot;)
        else
                echo &quot;No libspeex with resampler unit; use built-in code&quot;
                PPH=&quot;builtin&quot;
        fi
fi

[ snip ]

So it&apos;s been updated to check for speex version 1.2 which has &quot;A new resampler module has been added, providing arbitrary sampling rate conversion -- fast.&quot; from www.speex.org.

Funny thing is, speex 1.2 is not out yet and latest is still 1.2_beta2 so they are depending on version control sources of upcoming speex release.

# pkg-config --modversion speex
1.2beta2
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>phreak@gentoo.org</who>
            <bug_when>2007-10-20 15:46:46 0000</bug_when>
            <thetext>Thanks to Diego and Sybolt, I just committed a fixed ebuild. For future use, if you want the speex rate convertor, you need to add USE=speex to either package.use or your global USE list.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>