Your message dated Fri, 28 Feb 2025 17:10:37 +0000
with message-id <[email protected]>
and subject line Bug#1098900: fixed in libsdl3 3.2.4+git20250228+ds-1
has caused the Debian Bug report #1098900,
regarding libsdl3-dev: audio capture with pulseaudio does 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.)


-- 
1098900: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1098900
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: libsdl3
Source-Version: 3.2.4+git20250228+ds-1
Done: Simon McVittie <[email protected]>

We believe that the bug you reported is fixed in the latest version of
libsdl3, 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 libsdl3 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: Fri, 28 Feb 2025 13:52:25 +0000
Source: libsdl3
Architecture: source
Version: 3.2.4+git20250228+ds-1
Distribution: experimental
Urgency: medium
Maintainer: Debian SDL packages maintainers 
<[email protected]>
Changed-By: Simon McVittie <[email protected]>
Closes: 1098900
Changes:
 libsdl3 (3.2.4+git20250228+ds-1) experimental; urgency=medium
 .
   * New upstream snapshot
     - Among many other changes, this fixes an audio capture regression
       with PulseAudio in versions since 2.30 (Closes: #1098900)
   * d/copyright: Update
Checksums-Sha1:
 03bf5e242112d04a7781b891636a76742ec3754c 3277 
libsdl3_3.2.4+git20250228+ds-1.dsc
 fc15f3e1cd9baadcb81557ec7955c5040d1f80c6 11737744 
libsdl3_3.2.4+git20250228+ds.orig.tar.xz
 33409135ba7739d4898f80e9f04bfabef3c36ade 41116 
libsdl3_3.2.4+git20250228+ds-1.debian.tar.xz
 bcaccb1d59120b3f45d5b270138540a2b34e81f5 11755 
libsdl3_3.2.4+git20250228+ds-1_source.buildinfo
Checksums-Sha256:
 6919cabb1ba15beb7195b90d6d5e544e41b915631f0cb259d4649f10db976f44 3277 
libsdl3_3.2.4+git20250228+ds-1.dsc
 c46603fd16321e30964853c4e9361b6b98b1dc238003db2a3fab32c670f299ee 11737744 
libsdl3_3.2.4+git20250228+ds.orig.tar.xz
 70f410cc63aa703524a0717174dc8b6545d77fbfc66680bc36fc6811d0249002 41116 
libsdl3_3.2.4+git20250228+ds-1.debian.tar.xz
 ca1b9376b084ae7fc0fb8db32144521902a4faadc397bed28caa06ff8cb847ff 11755 
libsdl3_3.2.4+git20250228+ds-1_source.buildinfo
Files:
 1daca9929b1fb916458d5217eeb6ca08 3277 libs optional 
libsdl3_3.2.4+git20250228+ds-1.dsc
 6586f58a09a6d0ee255e9da4ffcab644 11737744 libs optional 
libsdl3_3.2.4+git20250228+ds.orig.tar.xz
 152099b8b6cbf11ceffb70ae0703ecd4 41116 libs optional 
libsdl3_3.2.4+git20250228+ds-1.debian.tar.xz
 630ccc570bb978a071f9c93f2a2c8234 11755 libs optional 
libsdl3_3.2.4+git20250228+ds-1_source.buildinfo


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

iQIzBAEBCgAdFiEEegc60a5pT6Jb/2LlI1wJnT6zMHYFAmfB02kACgkQI1wJnT6z
MHaXAA/+Jk3GS5FHHUZCFbGRM60UhiFR6fJwKtdWkEkP9EH5t6i6KkaE4aMvSGzy
sW7xRn8WNMZWewqr87EKeNtr6rY2a2HBk0aKzc8czXRK50FtJHI5FSwZ9sYaPPEt
tQkdju9vPl88N9a/UnB0X4mJw22Uyxe2HsuqLsem8X/ry57Y8dJG5GVt9sDtVPGe
A4Acimk7b7ZXnBvNu6JgAQG+zwavkMUAq8BL/V/4uqjam+/JH/DxZ2vhUz0UQkm/
iSOZ5yBckOtacMTWAvqilb/2dywsSKW5kTJWDYd7r26eb4fd7jIzn4aDgsw47Nu9
5ITepkgFJtJTQ4q+WedUeMndtme8SQazMcWEXw+rnoNmFTmRwd1HrsY0zqqnNfRT
TjaemKxyQ3C66uzsq0PqfDjw/UHgdB1rfaaKENTgjx05iMRVdP792xQeVl8Et8iF
+jdMziYaA96b//kdnw2nuNYEGUWTf0sDASfDRsRpIsDazUhwg5nndphXJxGLO+cw
VYVG9P9yfNTTgB5SU8liYriLjYMTyt7/M4cyJBXSAjpmgqyBiTshyM+kIDt5j+B3
wT+wucaEGARgkYgMZ3v+a2xB9ESIKcZ9VuynMK6UCMcVp9a9qIyinwLAwHBAd0jH
hW//ZkiK27Pup2y9fWeTrdwL+lm0mU7exYpMPiCtZU/uDvDwf3I=
=sWgE
-----END PGP SIGNATURE-----

Attachment: pgpbbR9hYFcyX.pgp
Description: PGP signature


--- End Message ---

Reply via email to