Your message dated Tue, 25 Feb 2025 18:19:17 +0000
with message-id <[email protected]>
and subject line Bug#1096138: fixed in libsdl2 2.32.0+dfsg-2
has caused the Debian Bug report #1096138,
regarding libsdl2-dev: audio capture with pulseaudio do not work
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1096138: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1096138
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libsdl2-dev
Version: 2.32.0+dfsg-1
Forwarded: https://github.com/libsdl-org/SDL/issues/9706

As in <URL: https://github.com/libsdl-org/SDL/issues/9706 >, I
discovered this problem when trying to use whisper.cpp, and thanks to
the example program provided there, I can confirm that the issue is with
SDL 2.

This is the test program:

#include <SDL2/SDL.h>
#include <iostream>

const int SAMPLE_RATE = 16000;
const int NUM_CHANNELS = 1;
const int BUFFER_SIZE = 1024;
const int RECORDING_TIME = 2000; // 2 seconds in milliseconds

int callbackCount = 0;

// Audio callback function
void audioCallback(void* userdata, Uint8* stream, int len) {
    // Do nothing with the audio data, just count the callback invocations
    callbackCount++;
}

int main() {
    if (SDL_Init(SDL_INIT_AUDIO) < 0) {
        std::cerr << "SDL initialization failed: " << SDL_GetError() << 
std::endl;
        return 1;
    }

    SDL_AudioSpec wantedSpec;
    SDL_zero(wantedSpec);
    wantedSpec.freq = SAMPLE_RATE;
    wantedSpec.format = AUDIO_F32;
    wantedSpec.channels = NUM_CHANNELS;
    wantedSpec.samples = BUFFER_SIZE;
    wantedSpec.callback = audioCallback;

    SDL_AudioSpec obtainedSpec;
    SDL_zero(obtainedSpec);

    // Open the default audio capture device
    SDL_AudioDeviceID audioDevice = SDL_OpenAudioDevice(NULL, 1, &wantedSpec, 
&obtainedSpec, 0);
    if (audioDevice == 0) {
        std::cerr << "Failed to open audio: " << SDL_GetError() << std::endl;
        SDL_Quit();
        return 1;
    }

    // Start recording
    SDL_PauseAudioDevice(audioDevice, 0);

    // Wait for recording time
    SDL_Delay(RECORDING_TIME);

    // Stop recording
    SDL_PauseAudioDevice(audioDevice, 1);

    // Close the audio device
    SDL_CloseAudioDevice(audioDevice);

    // Print out the number of callback invocations
    std::cout << "Callback invoked " << callbackCount << " times." << std::endl;

    SDL_Quit();
    return !callbackCount;
}

Tested using "g++ -o test test.cpp -lSDL2", and producing the
following output with pulseaudio:

  %./test
  Callback invoked 0 times.
  %

Here are some alternative results:

  % SDL_AUDIODRIVER=alsa ./test
  Callback invoked 35 times.
  % SDL_AUDIODRIVER=pipewire ./test
  [W][26087.476267] pw.conf      | [          conf.c: 1214 try_load_conf()] 
can't load config client.conf: No such file or directory
  [E][26087.476293] pw.conf      | [          conf.c: 1243 
pw_conf_load_conf_for_context()] can't load config client.conf: No such file or 
directory
  SDL initialization failed: Pipewire: Failed to create hotplug detection 
context (2)
  %

-- 
Happy hacking
Petter Reinholdtsen

--- End Message ---
--- Begin Message ---
Source: libsdl2
Source-Version: 2.32.0+dfsg-2
Done: Simon McVittie <[email protected]>

We believe that the bug you reported is fixed in the latest version of
libsdl2, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Simon McVittie <[email protected]> (supplier of updated libsdl2 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 25 Feb 2025 17:09:58 +0000
Source: libsdl2
Architecture: source
Version: 2.32.0+dfsg-2
Distribution: unstable
Urgency: medium
Maintainer: Debian SDL packages maintainers 
<[email protected]>
Changed-By: Simon McVittie <[email protected]>
Closes: 1096138
Changes:
 libsdl2 (2.32.0+dfsg-2) unstable; urgency=medium
 .
   * d/patches: Update to upstream release-2.32.x branch commit
     release-2.32.0-12-g024c27645, excluding Emscripten-, Github-, macOS-,
     OS/2- and Windows-specific changes
     - d/p/Changed-PULSEAUDIO_FlushRecording-to-only-flush-audio-pre.patch:
       Fix audio capture regression since 2.30 with PulseAudio (Closes: 
#1096138)
     - d/p/SDL2-Add-SDL_HINT_JOYSTICK_HAPTIC_AXES.patch:
       Add a hint to override number of joystick haptic axes
     - d/p/Added-support-for-the-n-sscanf-format-specifier.patch:
       %n support in SDL_sscanf and its relatives
     - Documentation updates
Checksums-Sha1:
 55fe54f758b4b1d208d58b024d8093f46a35e2f4 3238 libsdl2_2.32.0+dfsg-2.dsc
 e0dcfcf6540506d83767f724af62c4cf5a0c9b2a 48384 
libsdl2_2.32.0+dfsg-2.debian.tar.xz
 11fb3669627cc3a0299017df83c3b0ad373f7567 10732 
libsdl2_2.32.0+dfsg-2_source.buildinfo
Checksums-Sha256:
 835d203573c9e7fe083636d58ca9637dce7e055189a3692ee92e3f617cc00d24 3238 
libsdl2_2.32.0+dfsg-2.dsc
 318e9f9ee767fb87e3206b349d8855e02f97d799f5a9d33ac60e875d411adfc3 48384 
libsdl2_2.32.0+dfsg-2.debian.tar.xz
 75aa0d3de4bb82d436382c1150df197eb0ab01d9747851db115e4c27df6f65f1 10732 
libsdl2_2.32.0+dfsg-2_source.buildinfo
Files:
 f80645a4aadb2345e718ba77d328150d 3238 libs optional libsdl2_2.32.0+dfsg-2.dsc
 f26ea6ef545475eaff31cfa8e4f9a3a1 48384 libs optional 
libsdl2_2.32.0+dfsg-2.debian.tar.xz
 d2c16aa927b198192c4dea39eaf48dfc 10732 libs optional 
libsdl2_2.32.0+dfsg-2_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEegc60a5pT6Jb/2LlI1wJnT6zMHYFAme+BbwACgkQI1wJnT6z
MHbzEw/+LeJamogmMS7VKexls086Ah+NXX/7lOkWi+tvUE+4N6unDU3kIQuVd81P
aGxlXPhNA3xDRHRCiJxhJtiFB6lq5hO8osavF8qpUzNMJoXeI71WLI60KXV5qW+8
VKbp4ldQz5XrSXXleb0vRlKSrmNe5x56G4eMzaFdmZ7Nj/77xrqqbGaA/+Sb3oDL
7rfMflMC8WfyX5JPqxNuAOpMRcoVubw7VGzt8YXnCaz2wGo8x96+TjXIh97r+9bH
dF9bp3ir2Ddvk5ulOzobhQsCJg4glXu1SJL32fnrrZGHbhXv52DqVE29KTMdnZCB
s0Mk9fyL393WuMNzqOKpYDA+1nN6C+Gi7vgOinulA29MzvV45pmZTtskg/cKrG8E
+MBzi513sGKaEzXrnOTzL3dj4z7OO/GTX94IvpyWqOxxylN8tUb16wyrKIey2opP
sXboVO8J+7a34qSAOX+W+5UOMnFsk4s55CE3r8wMklDPEWuZChrMBkqjHd3jV7mu
y2MzdZvtsaKGhoGaGoBpojXhdpJfYvFkrLXB7K5EMFBh+xtkhm+F7COK3YVV3rhw
fSaKEm4jyuZGWr813YnPMJehz497tAGlpnDTjLJwyvfs6HayzCzxP09tt0hPnHxA
FeoOeLDEKuDgt/RX6ZF4JMjusNJLI5rWQJeV/1flpho3GF4NtW8=
=kPCV
-----END PGP SIGNATURE-----

Attachment: pgpraDmA7RHvN.pgp
Description: PGP signature


--- End Message ---

Reply via email to