Skip to content

Commit 67dc0a5

Browse files
committed
bgm_xyscope: accept 32 bit samples from alsa
1 parent 4651606 commit 67dc0a5

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
@@ -252,6 +252,10 @@ int init(int modulen, char* argstr) {
252252
printf("Got BS16C2\n");
253253
sf_sampsize = SIZE_16;
254254
sf_2c = 1;
255+
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_S32, SND_PCM_ACCESS_RW_INTERLEAVED, 2, SAMPLE_RATE, 1, 1000))) {
256+
printf("Got BS32C2\n");
257+
sf_sampsize = SIZE_32;
258+
sf_2c = 1;
255259
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_U8, SND_PCM_ACCESS_RW_INTERLEAVED, 2, SAMPLE_RATE, 1, 1000))) {
256260
printf("Got BU8C2\n");
257261
sf_2c = 1;
@@ -261,20 +265,32 @@ int init(int modulen, char* argstr) {
261265
sf_sampsize = SIZE_16;
262266
sf_2c = 1;
263267
sf_us = 1;
268+
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_U32, SND_PCM_ACCESS_RW_INTERLEAVED, 2, SAMPLE_RATE, 1, 1000))) {
269+
printf("Got BU32C2\n");
270+
sf_sampsize = SIZE_32;
271+
sf_2c = 1;
272+
sf_us = 1;
264273
}
265274
} else {
266275
if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_S8, SND_PCM_ACCESS_RW_INTERLEAVED, 1, SAMPLE_RATE, 1, 1000))) {
267276
printf("Got BS8C1\n");
268277
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_S16, SND_PCM_ACCESS_RW_INTERLEAVED, 1, SAMPLE_RATE, 1, 1000))) {
269278
printf("Got BS16C1\n");
270279
sf_sampsize = SIZE_16;
280+
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_S32, SND_PCM_ACCESS_RW_INTERLEAVED, 1, SAMPLE_RATE, 1, 1000))) {
281+
printf("Got BS32C1\n");
282+
sf_sampsize = SIZE_32;
271283
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_U8, SND_PCM_ACCESS_RW_INTERLEAVED, 1, SAMPLE_RATE, 1, 1000))) {
272284
printf("Got BU8C1\n");
273285
sf_us = 1;
274286
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_U16, SND_PCM_ACCESS_RW_INTERLEAVED, 1, SAMPLE_RATE, 1, 1000))) {
275287
printf("Got BU16C1\n");
276288
sf_sampsize = SIZE_16;
277289
sf_us = 1;
290+
} else if (!(code = snd_pcm_set_params(scope_pcm, SND_PCM_FORMAT_U32, SND_PCM_ACCESS_RW_INTERLEAVED, 1, SAMPLE_RATE, 1, 1000))) {
291+
printf("Got BU32C1\n");
292+
sf_sampsize = SIZE_32;
293+
sf_us = 1;
278294
} else {
279295
printf("Couldn't convince ALSA to give sane settings: %i\n", code);
280296
snd_pcm_close(scope_pcm);

0 commit comments

Comments
 (0)