Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Un-hardcode 44.1KHz settings from ALSA and iBasso PCM code

Change-Id: I69a69dabc799f360b73b1cf252645bd4cde13715

+12 -14
+1 -1
firmware/target/hosted/ibasso/pcm-ibasso.c
··· 310 310 pcm_thread_run relies on this size match. See pcm_mixer.h. 311 311 */ 312 312 _config.channels = 2; 313 - _config.rate = 44100; 313 + _config.rate = pcm_sampr; 314 314 _config.period_size = 256; 315 315 _config.period_count = 4; 316 316 _config.format = PCM_FORMAT_S16_LE;
+11 -13
firmware/target/hosted/pcm-alsa.c
··· 1 1 /*************************************************************************** 2 - * __________ __ ___. 3 - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 - * \/ \/ \/ \/ \/ 2 + * __________ __ ___. 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 8 * $Id$ 9 9 * 10 10 * Copyright (C) 2010 Thomas Martitz ··· 77 77 typedef short sample_t; 78 78 #endif 79 79 static const int channels = 2; /* count of channels */ 80 - static unsigned int rate = 44100; /* stream rate */ 81 - 82 - static snd_pcm_t *handle; 80 + static snd_pcm_t *handle = NULL; 83 81 static snd_pcm_sframes_t buffer_size = MIX_FRAME_SAMPLES * 32; /* ~16k */ 84 82 static snd_pcm_sframes_t period_size = MIX_FRAME_SAMPLES * 4; /* ~4k */ 85 83 static sample_t *frames; ··· 136 134 err = snd_pcm_hw_params_set_rate_near(handle, params, &rrate, 0); 137 135 if (err < 0) 138 136 { 139 - printf("Rate %iHz not available for playback: %s\n", rate, snd_strerror(err)); 137 + printf("Rate %iHz not available for playback: %s\n", sample_rate, snd_strerror(err)); 140 138 goto error; 141 139 } 142 140 if (rrate != sample_rate) 143 141 { 144 - printf("Rate doesn't match (requested %iHz, get %iHz)\n", sample_rate, err); 142 + printf("Rate doesn't match (requested %iHz, get %iHz)\n", sample_rate, rrate); 145 143 err = -EINVAL; 146 144 goto error; 147 145 } ··· 359 357 DEBUGF("Unable to install alternative signal stack: %s", strerror(err)); 360 358 return err; 361 359 } 362 - 360 + 363 361 err = snd_async_add_pcm_handler(&ahandler, handle, async_callback, NULL); 364 362 if (err < 0) 365 363 { ··· 430 428 if ((err = snd_pcm_nonblock(handle, 1))) 431 429 panicf("Could not set non-block mode: %s\n", snd_strerror(err)); 432 430 433 - if ((err = set_hwparams(handle, rate)) < 0) 431 + if ((err = set_hwparams(handle, pcm_sampr)) < 0) 434 432 { 435 433 panicf("Setting of hwparams failed: %s\n", snd_strerror(err)); 436 434 }