Skip to content

Commit 75eb5e3

Browse files
committed
bgm_xyscope: accept 32 bit samples from alsa
1 parent 02d38ce commit 75eb5e3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/modules/bgm_xyscope.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ int init(int modulen, char* argstr) {
251251
printf("Got BS16C2\n");
252252
sf_sampsize = SIZE_16;
253253
sf_2c = 1;
254+
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_S32, SND_PCM_ACCESS_RW_INTERLEAVED, 2, SAMPLE_RATE, 1, 1000))) {
255+
printf("Got BS32C2\n");
256+
sf_sampsize = SIZE_32;
257+
sf_2c = 1;
254258
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_U8, SND_PCM_ACCESS_RW_INTERLEAVED, 2, SAMPLE_RATE, 1, 1000))) {
255259
printf("Got BU8C2\n");
256260
sf_2c = 1;
@@ -260,20 +264,32 @@ int init(int modulen, char* argstr) {
260264
sf_sampsize = SIZE_16;
261265
sf_2c = 1;
262266
sf_us = 1;
267+
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_U32, SND_PCM_ACCESS_RW_INTERLEAVED, 2, SAMPLE_RATE, 1, 1000))) {
268+
printf("Got BU32C2\n");
269+
sf_sampsize = SIZE_32;
270+
sf_2c = 1;
271+
sf_us = 1;
263272
}
264273
} else {
265274
if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_S8, SND_PCM_ACCESS_RW_INTERLEAVED, 1, SAMPLE_RATE, 1, 1000))) {
266275
printf("Got BS8C1\n");
267276
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_S16, SND_PCM_ACCESS_RW_INTERLEAVED, 1, SAMPLE_RATE, 1, 1000))) {
268277
printf("Got BS16C1\n");
269278
sf_sampsize = SIZE_16;
279+
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_S32, SND_PCM_ACCESS_RW_INTERLEAVED, 1, SAMPLE_RATE, 1, 1000))) {
280+
printf("Got BS32C1\n");
281+
sf_sampsize = SIZE_32;
270282
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_U8, SND_PCM_ACCESS_RW_INTERLEAVED, 1, SAMPLE_RATE, 1, 1000))) {
271283
printf("Got BU8C1\n");
272284
sf_us = 1;
273285
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_U16, SND_PCM_ACCESS_RW_INTERLEAVED, 1, SAMPLE_RATE, 1, 1000))) {
274286
printf("Got BU16C1\n");
275287
sf_sampsize = SIZE_16;
276288
sf_us = 1;
289+
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_U32, SND_PCM_ACCESS_RW_INTERLEAVED, 1, SAMPLE_RATE, 1, 1000))) {
290+
printf("Got BU32C1\n");
291+
sf_sampsize = SIZE_32;
292+
sf_us = 1;
277293
} else {
278294
printf("Couldn't convince ALSA to give sane settings: %i\n", code);
279295
snd_pcm_close(scope_pcm);

0 commit comments

Comments
 (0)