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.

SWCODEC recording: More cleanup of stuff after queue additions and audio driver unification.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11783 a1c6a512-1295-4272-9138-f99709370657

+33 -60
+5
firmware/export/audio.h
··· 186 186 void audio_stop_recording(void); 187 187 void audio_pause_recording(void); 188 188 void audio_resume_recording(void); 189 + #if CONFIG_CODEC == SWCODEC 190 + static inline void audio_new_file(const char *filename) 191 + { audio_record(filename); } 192 + #else 189 193 void audio_new_file(const char *filename); 194 + #endif /* CONFIG_CODEC == SWCODEC */ 190 195 void audio_set_recording_options(struct audio_recording_options *options); 191 196 void audio_set_recording_gain(int left, int right, int type); 192 197 unsigned long audio_recorded_time(void);
+26 -32
firmware/pcm_record.c
··· 19 19 #include "system.h" 20 20 #include "kernel.h" 21 21 #include "logf.h" 22 - #include "panic.h" 23 22 #include "thread.h" 24 23 #include <string.h> 25 24 #include "ata.h" 26 25 #include "usb.h" 27 - #if defined(HAVE_UDA1380) 28 - #include "uda1380.h" 29 - #include "general.h" 30 - #elif defined(HAVE_TLV320) 31 - #include "tlv320.h" 32 - #endif 33 26 #include "buffer.h" 27 + #include "general.h" 34 28 #include "audio.h" 35 29 #include "sound.h" 36 30 #include "id3.h" ··· 45 39 * Public - 46 40 * pcm_init_recording 47 41 * pcm_close_recording 48 - * pcm_rec_mux 49 42 * Semi-private - 50 43 * pcm_rec_dma_start 51 44 * pcm_rec_dma_stop ··· 234 227 PCMREC_INIT, /* enable recording */ 235 228 PCMREC_CLOSE, /* close recording */ 236 229 PCMREC_OPTIONS, /* set recording options */ 237 - PCMREC_START, /* start recording */ 230 + PCMREC_RECORD, /* record a new file */ 238 231 PCMREC_STOP, /* stop the current recording */ 239 232 PCMREC_PAUSE, /* pause the current recording */ 240 233 PCMREC_RESUME, /* resume the current recording */ 241 - PCMREC_NEW_FILE, /* start new file */ 242 234 #if 0 243 235 PCMREC_FLUSH_NUM, /* flush a number of files out */ 244 236 #endif ··· 427 419 void audio_record(const char *filename) 428 420 { 429 421 logf("audio_record: %s", filename); 430 - queue_send(&pcmrec_queue, PCMREC_START, (void *)filename); 422 + queue_send(&pcmrec_queue, PCMREC_RECORD, (void *)filename); 431 423 logf("audio_record_done"); 432 424 } /* audio_record */ 433 425 434 426 /** 435 - * Equivalent to audio_record() 436 - */ 437 - void audio_new_file(const char *filename) 438 - { 439 - logf("audio_new_file: %s", filename); 440 - queue_send(&pcmrec_queue, PCMREC_NEW_FILE, (void *)filename); 441 - logf("audio_new_file done"); 442 - } /* audio_new_file */ 443 - 444 - /** 445 427 * Stop current recording if recording 446 428 */ 447 429 void audio_stop_recording(void) ··· 470 452 queue_send(&pcmrec_queue, PCMREC_RESUME, NULL); 471 453 logf("audio_resume_recording done"); 472 454 } /* audio_resume_recording */ 455 + 456 + /** 457 + * Note that microphone is mono, only left value is used 458 + * See audiohw_set_recvol() for exact ranges. 459 + * 460 + * @param type AUDIO_GAIN_MIC, AUDIO_GAIN_LINEIN 461 + * 462 + */ 463 + void audio_set_recording_gain(int left, int right, int type) 464 + { 465 + //logf("rcmrec: t=%d l=%d r=%d", type, left, right); 466 + audiohw_set_recvol(left, right, type); 467 + } /* audio_set_recording_gain */ 473 468 474 469 /** Information about current state **/ 475 470 ··· 1203 1198 } 1204 1199 } /* pcmrec_set_recording_options */ 1205 1200 1206 - /* PCMREC_START/PCMREC_NEW_FILE - start recording (not gapless) 1207 - or split stream (gapless) */ 1208 - static void pcmrec_start(const char *filename) 1201 + /* PCMREC_RECORD - start recording (not gapless) 1202 + or split stream (gapless) */ 1203 + static void pcmrec_record(const char *filename) 1209 1204 { 1210 1205 unsigned long pre_sample_ticks; 1211 1206 int rd_start; 1212 1207 1213 - logf("pcmrec_start: %s", filename); 1208 + logf("pcmrec_record: %s", filename); 1214 1209 1215 1210 /* reset stats */ 1216 1211 num_rec_bytes = 0; ··· 1223 1218 pcmrec_new_stream(filename, 1224 1219 CHUNKF_START_FILE | CHUNKF_END_FILE, 1225 1220 0); 1226 - goto start_done; 1221 + goto record_done; 1227 1222 } 1228 1223 1229 1224 #if 0 ··· 1299 1294 (pre_sample_ticks > 0 ? CHUNKF_PRERECORD : 0), 1300 1295 enc_rd_index); 1301 1296 1302 - start_done: 1303 - logf("pcmrec_start done"); 1304 - } /* pcmrec_start */ 1297 + record_done: 1298 + logf("pcmrec_record done"); 1299 + } /* pcmrec_record */ 1305 1300 1306 1301 /* PCMREC_STOP */ 1307 1302 static void pcmrec_stop(void) ··· 1445 1440 (struct audio_recording_options *)ev.data); 1446 1441 break; 1447 1442 1448 - case PCMREC_START: 1449 - case PCMREC_NEW_FILE: 1450 - pcmrec_start((const char *)ev.data); 1443 + case PCMREC_RECORD: 1444 + pcmrec_record((const char *)ev.data); 1451 1445 break; 1452 1446 1453 1447 case PCMREC_STOP:
+1 -14
firmware/target/coldfire/iaudio/x5/audio-x5.c
··· 19 19 #include "system.h" 20 20 #include "cpu.h" 21 21 #include "audio.h" 22 - #include "tlv320.h" 23 - 24 - /** 25 - * Note that microphone is mono, only left value is used 26 - * See audiohw_set_recvol() for exact ranges. 27 - * 28 - * @param type AUDIO_GAIN_MIC, AUDIO_GAIN_LINEIN 29 - * 30 - */ 31 - void audio_set_recording_gain(int left, int right, int type) 32 - { 33 - //logf("rcmrec: t=%d l=%d r=%d", type, left, right); 34 - audiohw_set_recvol(left, right, type); 35 - } /* audio_set_recording_gain */ 22 + #include "sound.h" 36 23 37 24 void audio_set_output_source(int source) 38 25 {
+1 -14
firmware/target/coldfire/iriver/audio-iriver.c
··· 19 19 #include "system.h" 20 20 #include "cpu.h" 21 21 #include "audio.h" 22 - #include "uda1380.h" 23 - 24 - /** 25 - * Note that microphone is mono, only left value is used 26 - * See audiohw_set_recvol() for exact ranges. 27 - * 28 - * @param type AUDIO_GAIN_MIC, AUDIO_GAIN_LINEIN 29 - * 30 - */ 31 - void audio_set_recording_gain(int left, int right, int type) 32 - { 33 - //logf("rcmrec: t=%d l=%d r=%d", type, left, right); 34 - audiohw_set_recvol(left, right, type); 35 - } /* audio_set_recording_gain */ 22 + #include "sound.h" 36 23 37 24 void audio_set_output_source(int source) 38 25 {