Skip to content

Instantly share code, notes, and snippets.

@therealkenc
Last active February 26, 2023 09:37
Show Gist options
  • Save therealkenc/5dae7eefbacb0083e485348bd25ee33c to your computer and use it in GitHub Desktop.
Save therealkenc/5dae7eefbacb0083e485348bd25ee33c to your computer and use it in GitHub Desktop.
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install ubuntu-desktop build-essential git automake checkinstall gcc-6 g++-6 \
    intltool libtool \
    alsa-base alsa-utils alsa-tools libasound2 libasound2-plugins \
    libx11-dev libx11-xcb-dev check libsndfile1-dev libtdb-dev libgdbm-dev \
    libgtk-3-dev libgconf2-dev \
    libjack-dev jack libasyncns-dev libasyncns0 libwrap0-dev libwrap0 libsbc-dev libsbc1 \
    libavahi-common-dev libavahi-client3 libdbus-1-dev libssl-dev \
    libfftw3-dev libspeex-dev libspeexdsp-dev speex libsoxr-dev \
    liborc-0.4-dev libsoxr0 liblircclient-dev libsamplerate-dev \
    libwebrtc-audio-processing-dev libwebrtc-audio-processing-0 libjson-c-dev 
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 200
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 200

wget http://freedesktop.org/software/pulseaudio/releases/pulseaudio-9.0.tar.xz
tar xf pulseaudio-9.0.tar.xz
cd pulseaudio-9.0
CFLAGS="$CFLAGS -g -O0" ./configure     \
    --prefix=/usr/local                 \
    --sysconfdir=/etc                   \
    --localstatedir=/var                \
    --disable-bluez4                    \
    --disable-bluez5                    \
    --disable-rpath                     \
    --disable-asyncns                   \
    --disable-udev                      \
    --disable-systemd-daemon            \
    --without-caps                      \
    --enable-force-preopen

make -j 8
sudo apt-get purge pulseaudio
sudo make install
@rijulg
Copy link

rijulg commented Sep 4, 2018

While installing on my WSL Ubuntu 18.04 version I ran across the following issues

  1. libwebrtc-audio-processing-0 package not found while apt-get installing
    Resolved by removing that requirement from the install command
  2. Got this error while running "make -j 8"
    "static declaration of ‘memfd_create’ follows non-static declaration"
    Resolved by commenting out
// static inline int memfd_create(const char *name, unsigned int flags) {
//     return syscall(SYS_memfd_create, name, flags);
// }

in src/pulsecore/memfd_wrappers.h
3. Got this error while running "make -j 8"
"modules/raop/raop_client.c:167:8: error: dereferencing pointer to incomplete type 'RSA {aka struct rsa_st}' rsa->n = BN_bin2bn(modules, size, NULL);"
Resolved by updating this function as follows:

static int rsa_encrypt(uint8_t *text, int len, uint8_t *res) {
    const char n[] =
        "59dE8qLieItsH1WgjrcFRKj6eUWqi+bGLOX1HL3U3GhC/j0Qg90u3sG/1CUtwC"
        "5vOYvfDmFI6oSFXi5ELabWJmT2dKHzBJKa3k9ok+8t9ucRqMd6DZHJ2YCCLlDR"
        "KSKv6kDqnw4UwPdpOMXziC/AMj3Z/lUVX1G7WSHCAWKf1zNS1eLvqr+boEjXuB"
        "OitnZ/bDzPHrTOZz0Dew0uowxf/+sG+NCK3eQJVxqcaJ/vEHKIVd2M+5qL71yJ"
        "Q+87X6oV3eaYvt3zWZYD6z5vYTcrtij2VZ9Zmni/UAaHqn9JdsBWLUEpVviYnh"
        "imNVvYFZeCXg/IdTQ+x4IRdiXNv5hEew==";
    const char e[] = "AQAB";
    const char e2[] = "JAHH";
    uint8_t modules[256];
    uint8_t exponent[8];
    uint8_t privateExponent[8];
    int size,sizen,sizee,sizef;
    RSA *rsa;

    rsa = RSA_new();
    sizen = pa_base64_decode(n, modules);
    sizee = pa_base64_decode(e, exponent);
    sizef = pa_base64_decode(e2, privateExponent);

    #if OPENSSL_VERSION_NUMBER < 0x10100000L
        /* OpenSSL 1.0.2 and below (old code) */
        rsa->n = BN_bin2bn(modules, sizen, NULL);
        rsa->e = BN_bin2bn(exponent, sizee, NULL);
    #else
        /* OpenSSL 1.1.0 and above (new code) */
        RSA_set0_crt_params(
            rsa,
            BN_bin2bn(modules, sizen, NULL),
            BN_bin2bn(exponent, sizee, NULL),
            BN_bin2bn(privateExponent, sizef, NULL)
        );

    #endif

    size = RSA_public_encrypt(len, text, res, rsa, RSA_PKCS1_OAEP_PADDING);
    RSA_free(rsa);
    return size;
}

Also had to add "#include <openssl/opensslv.h>" at the top of the file.
This is apparently happening because of an OpenSSL upgrade where they changed the visibility of elements.

After these 3 fixes I got the setup done upto "make -j 8" complete.

After the tutorial I got a pulseAudio Sound Server when checking "aplay -L", but still did not show any sound cards, which I think wasn't meant to happen anyway.

@ValentinMumble
Copy link

While installing on my WSL Ubuntu 18.04 version I ran across the following issues

  1. libwebrtc-audio-processing-0 package not found while apt-get installing
    Resolved by removing that requirement from the install command
  2. Got this error while running "make -j 8"
    "static declaration of ‘memfd_create’ follows non-static declaration"
    Resolved by commenting out
// static inline int memfd_create(const char *name, unsigned int flags) {
//     return syscall(SYS_memfd_create, name, flags);
// }

in src/pulsecore/memfd_wrappers.h
3. Got this error while running "make -j 8"
"modules/raop/raop_client.c:167:8: error: dereferencing pointer to incomplete type 'RSA {aka struct rsa_st}' rsa->n = BN_bin2bn(modules, size, NULL);"
Resolved by updating this function as follows:

static int rsa_encrypt(uint8_t *text, int len, uint8_t *res) {
    const char n[] =
        "59dE8qLieItsH1WgjrcFRKj6eUWqi+bGLOX1HL3U3GhC/j0Qg90u3sG/1CUtwC"
        "5vOYvfDmFI6oSFXi5ELabWJmT2dKHzBJKa3k9ok+8t9ucRqMd6DZHJ2YCCLlDR"
        "KSKv6kDqnw4UwPdpOMXziC/AMj3Z/lUVX1G7WSHCAWKf1zNS1eLvqr+boEjXuB"
        "OitnZ/bDzPHrTOZz0Dew0uowxf/+sG+NCK3eQJVxqcaJ/vEHKIVd2M+5qL71yJ"
        "Q+87X6oV3eaYvt3zWZYD6z5vYTcrtij2VZ9Zmni/UAaHqn9JdsBWLUEpVviYnh"
        "imNVvYFZeCXg/IdTQ+x4IRdiXNv5hEew==";
    const char e[] = "AQAB";
    const char e2[] = "JAHH";
    uint8_t modules[256];
    uint8_t exponent[8];
    uint8_t privateExponent[8];
    int size,sizen,sizee,sizef;
    RSA *rsa;

    rsa = RSA_new();
    sizen = pa_base64_decode(n, modules);
    sizee = pa_base64_decode(e, exponent);
    sizef = pa_base64_decode(e2, privateExponent);

    #if OPENSSL_VERSION_NUMBER < 0x10100000L
        /* OpenSSL 1.0.2 and below (old code) */
        rsa->n = BN_bin2bn(modules, sizen, NULL);
        rsa->e = BN_bin2bn(exponent, sizee, NULL);
    #else
        /* OpenSSL 1.1.0 and above (new code) */
        RSA_set0_crt_params(
            rsa,
            BN_bin2bn(modules, sizen, NULL),
            BN_bin2bn(exponent, sizee, NULL),
            BN_bin2bn(privateExponent, sizef, NULL)
        );

    #endif

    size = RSA_public_encrypt(len, text, res, rsa, RSA_PKCS1_OAEP_PADDING);
    RSA_free(rsa);
    return size;
}

Also had to add "#include <openssl/opensslv.h>" at the top of the file.
This is apparently happening because of an OpenSSL upgrade where they changed the visibility of elements.

After these 3 fixes I got the setup done upto "make -j 8" complete.

After the tutorial I got a pulseAudio Sound Server when checking "aplay -L", but still did not show any sound cards, which I think wasn't meant to happen anyway.

Thank you!

@Petezah
Copy link

Petezah commented Dec 19, 2019

Get this updated version instead:

https://freedesktop.org/software/pulseaudio/releases/pulseaudio-13.0.tar.xz

I replaced the wget line with:

wget https://freedesktop.org/software/pulseaudio/releases/pulseaudio-13.0.tar.xz

It works, and no changes were needed. I am using the Ubuntu 16.04 LTS in WSL on Windows 10 1909 (18363).

@pgaskin
Copy link

pgaskin commented Apr 25, 2021

Also see https://github.com/pgaskin/pulseaudio-win32 for up-to-date patched builds with better system integration and many bugfixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment