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.

Commit the kinds of changes that queue_send is mean for.


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

+101 -121
+68 -63
apps/playback.c
··· 141 141 Q_AUDIO_LOAD_ENCODER, 142 142 #endif 143 143 144 + #if 0 144 145 Q_CODEC_REQUEST_PENDING, 146 + #endif 145 147 Q_CODEC_REQUEST_COMPLETE, 146 148 Q_CODEC_REQUEST_FAILED, 147 149 ··· 195 197 /* TBD: Split out "audio" and "playback" (ie. calling) threads */ 196 198 197 199 /* Main state control */ 198 - static struct event_queue codec_callback_queue; /* Queue for codec callback responses */ 199 200 static volatile bool audio_codec_loaded; /* Is codec loaded? (C/A-) */ 200 201 static volatile bool playing; /* Is audio playing? (A) */ 201 202 static volatile bool paused; /* Is audio paused? (A/C-) */ ··· 251 252 static size_t conf_preseek; /* Codec pre-seek margin (A/C) FIXME */ 252 253 static size_t buffer_margin; /* Buffer margin aka anti-skip buffer (A/C-) */ 253 254 static bool v1first = false; /* ID3 data control, true if V1 then V2 (A) */ 255 + #if MEM > 8 256 + static size_t high_watermark; /* High watermark for rebuffer (A/V/other) */ 257 + #endif 254 258 255 259 /* Multiple threads */ 256 260 static const char *get_codec_filename(int enc_spec); /* Returns codec filename (A-/C-/V-) */ 257 261 static void set_filebuf_watermark(int seconds); /* Set low watermark (A/C) FIXME */ 258 262 259 263 /* Audio thread */ 260 - static struct event_queue audio_queue; 264 + static struct event_queue audio_queue; 265 + static struct queue_sender_list audio_queue_sender_list; 261 266 static long audio_stack[(DEFAULT_STACK_SIZE + 0x1000)/sizeof(long)]; 262 267 static const char audio_thread_name[] = "audio"; 263 268 ··· 832 837 #endif 833 838 834 839 queue_init(&audio_queue, true); 840 + queue_enable_queue_send(&audio_queue, &audio_queue_sender_list); 835 841 queue_init(&codec_queue, true); 836 - /* create a private queue */ 837 - queue_init(&codec_callback_queue, false); 838 842 839 843 create_thread(audio_thread, audio_stack, sizeof(audio_stack), 840 844 audio_thread_name IF_PRIO(, PRIORITY_BUFFERING)); ··· 1569 1573 1570 1574 if (amount > CUR_TI->available) 1571 1575 { 1572 - struct event ev; 1576 + int result; 1577 + LOGFQUEUE("codec >| audio Q_AUDIO_REBUFFER_SEEK"); 1573 1578 1574 - LOGFQUEUE("codec > audio Q_AUDIO_REBUFFER_SEEK"); 1575 - queue_post(&audio_queue, 1576 - Q_AUDIO_REBUFFER_SEEK, (void *)(ci.curpos + amount)); 1577 - 1578 - queue_wait(&codec_callback_queue, &ev); 1579 - switch (ev.id) 1579 + result = (int)queue_send(&audio_queue, Q_AUDIO_REBUFFER_SEEK, 1580 + (void *)(ci.curpos + amount)); 1581 + 1582 + switch (result) 1580 1583 { 1581 1584 case Q_CODEC_REQUEST_FAILED: 1582 - LOGFQUEUE("codec < Q_CODEC_REQUEST_FAILED"); 1585 + LOGFQUEUE("codec |< Q_CODEC_REQUEST_FAILED"); 1583 1586 ci.stop_codec = true; 1584 1587 return; 1585 1588 1586 1589 case Q_CODEC_REQUEST_COMPLETE: 1587 - LOGFQUEUE("codec < Q_CODEC_REQUEST_COMPLETE"); 1590 + LOGFQUEUE("codec |< Q_CODEC_REQUEST_COMPLETE"); 1588 1591 return; 1589 1592 1590 1593 default: 1591 - LOGFQUEUE("codec < default"); 1594 + LOGFQUEUE("codec |< default"); 1592 1595 ci.stop_codec = true; 1593 1596 return; 1594 1597 } ··· 1713 1716 /* We need to reload the song. */ 1714 1717 if (newpos < CUR_TI->start_pos) 1715 1718 { 1716 - struct event ev; 1719 + int result; 1717 1720 1718 - LOGFQUEUE("codec > audio Q_AUDIO_REBUFFER_SEEK"); 1719 - queue_post(&audio_queue, Q_AUDIO_REBUFFER_SEEK, (void *)newpos); 1721 + LOGFQUEUE("codec >| audio Q_AUDIO_REBUFFER_SEEK"); 1722 + result = (int)queue_send(&audio_queue, Q_AUDIO_REBUFFER_SEEK, 1723 + (void *)newpos); 1720 1724 1721 - queue_wait(&codec_callback_queue, &ev); 1722 - switch (ev.id) 1725 + switch (result) 1723 1726 { 1724 1727 case Q_CODEC_REQUEST_COMPLETE: 1725 - LOGFQUEUE("codec < Q_CODEC_REQUEST_COMPLETE"); 1728 + LOGFQUEUE("codec |< Q_CODEC_REQUEST_COMPLETE"); 1726 1729 return true; 1727 1730 1728 1731 case Q_CODEC_REQUEST_FAILED: 1729 - LOGFQUEUE("codec < Q_CODEC_REQUEST_FAILED"); 1732 + LOGFQUEUE("codec |< Q_CODEC_REQUEST_FAILED"); 1730 1733 ci.stop_codec = true; 1731 1734 return false; 1732 1735 1733 1736 default: 1734 - LOGFQUEUE("codec < default"); 1737 + LOGFQUEUE("codec |< default"); 1735 1738 return false; 1736 1739 } 1737 1740 } ··· 1831 1834 1832 1835 static bool codec_load_next_track(void) 1833 1836 { 1834 - struct event ev; 1837 + int result; 1835 1838 1836 1839 prev_track_elapsed = CUR_TI->id3.elapsed; 1837 1840 ··· 1851 1854 } 1852 1855 1853 1856 trigger_cpu_boost(); 1854 - LOGFQUEUE("codec > audio Q_AUDIO_CHECK_NEW_TRACK"); 1855 - queue_post(&audio_queue, Q_AUDIO_CHECK_NEW_TRACK, 0); 1857 + LOGFQUEUE("codec >| audio Q_AUDIO_CHECK_NEW_TRACK"); 1858 + result = (int)queue_send(&audio_queue, Q_AUDIO_CHECK_NEW_TRACK, NULL); 1859 + 1860 + #if 0 /* Q_CODEC_REQUEST_PENDING never posted anyway */ 1856 1861 while (1) 1857 1862 { 1858 1863 queue_wait(&codec_callback_queue, &ev); ··· 1864 1869 else 1865 1870 break; 1866 1871 } 1872 + #endif 1867 1873 1868 - switch (ev.id) 1874 + switch (result) 1869 1875 { 1870 1876 case Q_CODEC_REQUEST_COMPLETE: 1871 - LOGFQUEUE("codec < Q_CODEC_REQUEST_COMPLETE"); 1877 + LOGFQUEUE("codec |< Q_CODEC_REQUEST_COMPLETE"); 1872 1878 codec_track_skip_done(!automatic_skip); 1873 1879 return true; 1874 1880 1875 1881 case Q_CODEC_REQUEST_FAILED: 1876 - LOGFQUEUE("codec < Q_CODEC_REQUEST_FAILED"); 1882 + LOGFQUEUE("codec |< Q_CODEC_REQUEST_FAILED"); 1877 1883 ci.new_track = 0; 1878 1884 ci.stop_codec = true; 1879 1885 return false; 1880 1886 1881 1887 default: 1882 - LOGFQUEUE("codec < default"); 1888 + LOGFQUEUE("codec |< default"); 1883 1889 ci.stop_codec = true; 1884 1890 return false; 1885 1891 } ··· 2945 2951 static void audio_rebuffer(void) 2946 2952 { 2947 2953 logf("Forcing rebuffer"); 2948 - 2954 + 2955 + #if 0 2949 2956 /* Notify the codec that this will take a while */ 2950 2957 /* Currently this can cause some problems (logf in reverse order): 2951 2958 * Codec load error:-1 ··· 2962 2969 * Clearing tracks:5/5, 1 2963 2970 * Re-buffering song w/seek 2964 2971 */ 2965 - //if (!filling) 2966 - // queue_post(&codec_callback_queue, Q_CODEC_REQUEST_PENDING, 0); 2972 + if (!filling) 2973 + queue_post(&codec_callback_queue, Q_CODEC_REQUEST_PENDING, 0); 2974 + #endif 2967 2975 2968 2976 /* Stop in progress fill, and clear open file descriptor */ 2969 2977 if (current_fd >= 0) ··· 2991 2999 audio_fill_file_buffer(false, true, 0); 2992 3000 } 2993 3001 2994 - static void audio_check_new_track(void) 3002 + static int audio_check_new_track(void) 2995 3003 { 2996 3004 int track_count = audio_track_count(); 2997 3005 int old_track_ridx = track_ridx; ··· 3009 3017 } 3010 3018 else 3011 3019 { 3012 - LOGFQUEUE("audio > codec Q_CODEC_REQUEST_FAILED"); 3013 - queue_post(&codec_callback_queue, Q_CODEC_REQUEST_FAILED, 0); 3014 - return; 3020 + LOGFQUEUE("audio >|= codec Q_CODEC_REQUEST_FAILED"); 3021 + return Q_CODEC_REQUEST_FAILED; 3015 3022 } 3016 3023 } 3017 3024 ··· 3023 3030 { 3024 3031 if (ci.new_track >= 0) 3025 3032 { 3026 - LOGFQUEUE("audio > codec Q_CODEC_REQUEST_FAILED"); 3027 - queue_post(&codec_callback_queue, Q_CODEC_REQUEST_FAILED, 0); 3028 - return; 3033 + LOGFQUEUE("audio >|= codec Q_CODEC_REQUEST_FAILED"); 3034 + return Q_CODEC_REQUEST_FAILED; 3029 3035 } 3030 3036 /* Find the beginning backward if the user over-skips it */ 3031 3037 while (!playlist_check(++ci.new_track)) 3032 3038 if (ci.new_track >= 0) 3033 3039 { 3034 - LOGFQUEUE("audio > codec Q_CODEC_REQUEST_FAILED"); 3035 - queue_post(&codec_callback_queue, Q_CODEC_REQUEST_FAILED, 0); 3036 - return; 3040 + LOGFQUEUE("audio >|= codec Q_CODEC_REQUEST_FAILED"); 3041 + return Q_CODEC_REQUEST_FAILED; 3037 3042 } 3038 3043 } 3039 3044 /* Update the playlist */ ··· 3041 3046 3042 3047 if (playlist_next(ci.new_track) < 0) 3043 3048 { 3044 - LOGFQUEUE("audio > codec Q_CODEC_REQUEST_FAILED"); 3045 - queue_post(&codec_callback_queue, Q_CODEC_REQUEST_FAILED, 0); 3046 - return; 3049 + LOGFQUEUE("audio >|= codec Q_CODEC_REQUEST_FAILED"); 3050 + return Q_CODEC_REQUEST_FAILED; 3047 3051 } 3048 3052 3049 3053 if (new_playlist) ··· 3127 3131 3128 3132 skip_done: 3129 3133 audio_update_trackinfo(); 3130 - LOGFQUEUE("audio > codec Q_CODEC_REQUEST_COMPLETE"); 3131 - queue_post(&codec_callback_queue, Q_CODEC_REQUEST_COMPLETE, 0); 3134 + LOGFQUEUE("audio >|= codec Q_CODEC_REQUEST_COMPLETE"); 3135 + return Q_CODEC_REQUEST_COMPLETE; 3132 3136 } 3133 3137 3134 - static void audio_rebuffer_and_seek(size_t newpos) 3138 + static int audio_rebuffer_and_seek(size_t newpos) 3135 3139 { 3136 3140 size_t real_preseek; 3137 3141 int fd; ··· 3142 3146 fd = open(trackname, O_RDONLY); 3143 3147 if (fd < 0) 3144 3148 { 3145 - LOGFQUEUE("audio > codec Q_CODEC_REQUEST_FAILED"); 3146 - queue_post(&codec_callback_queue, Q_CODEC_REQUEST_FAILED, 0); 3147 - return; 3149 + LOGFQUEUE("audio >|= codec Q_CODEC_REQUEST_FAILED"); 3150 + return Q_CODEC_REQUEST_FAILED; 3148 3151 } 3149 3152 3150 3153 if (current_fd >= 0) ··· 3188 3191 3189 3192 buf_ridx = RINGBUF_ADD(buf_ridx, real_preseek); 3190 3193 3191 - LOGFQUEUE("audio > codec Q_CODEC_REQUEST_COMPLETE"); 3192 - queue_post(&codec_callback_queue, Q_CODEC_REQUEST_COMPLETE, 0); 3194 + LOGFQUEUE("audio >|= codec Q_CODEC_REQUEST_COMPLETE"); 3195 + return Q_CODEC_REQUEST_COMPLETE; 3193 3196 } 3194 3197 3195 3198 void audio_set_track_buffer_event(void (*handler)(struct mp3entry *id3, ··· 3424 3427 filebuflen -= offset; 3425 3428 filebuflen &= ~3; 3426 3429 3430 + #if MEM > 8 3431 + high_watermark = (3*filebuflen)/4; 3432 + #endif 3433 + 3427 3434 /* Clear any references to the file buffer */ 3428 3435 buffer_state = BUFFER_STATE_NORMAL; 3429 3436 } ··· 3539 3546 static void audio_thread(void) 3540 3547 { 3541 3548 struct event ev; 3542 - #if MEM > 8 3543 - size_t high_watermark; 3544 - #endif 3545 3549 /* At first initialize audio system in background. */ 3546 3550 audio_playback_init(); 3547 - #if MEM > 8 3548 - high_watermark = (3*filebuflen)/4; 3549 - #endif 3550 3551 3551 3552 while (1) 3552 3553 { 3554 + void *result = NULL; 3555 + 3553 3556 if (filling) 3554 3557 { 3555 3558 queue_wait_w_tmo(&audio_queue, &ev, 0); ··· 3622 3625 3623 3626 case Q_AUDIO_REBUFFER_SEEK: 3624 3627 LOGFQUEUE("audio < Q_AUDIO_REBUFFER_SEEK"); 3625 - audio_rebuffer_and_seek((size_t)ev.data); 3628 + result = (void *)audio_rebuffer_and_seek((size_t)ev.data); 3626 3629 break; 3627 3630 3628 3631 case Q_AUDIO_CHECK_NEW_TRACK: 3629 3632 LOGFQUEUE("audio < Q_AUDIO_CHECK_NEW_TRACK"); 3630 - audio_check_new_track(); 3633 + result = (void *)audio_check_new_track(); 3631 3634 break; 3632 3635 3633 3636 case Q_AUDIO_DIR_SKIP: ··· 3677 3680 3678 3681 default: 3679 3682 LOGFQUEUE("audio < default"); 3680 - } 3681 - } 3683 + } /* end switch */ 3684 + 3685 + queue_reply(&audio_queue, result); 3686 + } /* end while */ 3682 3687 } 3683 3688
+33 -58
firmware/pcm_record.c
··· 222 222 223 223 /***************************************************************************/ 224 224 225 - static struct event_queue pcmrec_queue; 225 + static struct event_queue pcmrec_queue; 226 + static struct queue_sender_list pcmrec_queue_send; 226 227 static long pcmrec_stack[3*DEFAULT_STACK_SIZE/sizeof(long)]; 227 228 static const char pcmrec_thread_name[] = "pcmrec"; 228 229 229 230 static void pcmrec_thread(void); 230 231 231 - /* Event values which are also single-bit flags */ 232 - #define PCMREC_INIT 0x00000001 /* enable recording */ 233 - #define PCMREC_CLOSE 0x00000002 /* close recording */ 234 - #define PCMREC_OPTIONS 0x00000004 /* set recording options */ 235 - #define PCMREC_START 0x00000008 /* start recording */ 236 - #define PCMREC_STOP 0x00000010 /* stop the current recording */ 237 - #define PCMREC_PAUSE 0x00000020 /* pause the current recording */ 238 - #define PCMREC_RESUME 0x00000040 /* resume the current recording */ 239 - #define PCMREC_NEW_FILE 0x00000080 /* start new file */ 240 - #define PCMREC_FLUSH_NUM 0x00000100 /* flush a number of files out */ 241 - #define PCMREC_FINISH_STOP 0x00000200 /* finish the stopping recording */ 242 - 243 - /* mask for signaling events */ 244 - static volatile long pcm_thread_event_mask = PCMREC_CLOSE; 245 - 246 - static void pcm_thread_sync_post(long event, void *data) 247 - { 248 - pcm_thread_event_mask &= ~event; 249 - queue_post(&pcmrec_queue, event, data); 250 - while(!(event & pcm_thread_event_mask)) 251 - yield(); 252 - } /* pcm_thread_sync_post */ 253 - 254 - static inline void pcm_thread_signal_event(long event) 232 + enum 255 233 { 256 - pcm_thread_event_mask |= event; 257 - } /* pcm_thread_signal_event */ 234 + PCMREC_NULL = 0, 235 + PCMREC_INIT, /* enable recording */ 236 + PCMREC_CLOSE, /* close recording */ 237 + PCMREC_OPTIONS, /* set recording options */ 238 + PCMREC_START, /* start recording */ 239 + PCMREC_STOP, /* stop the current recording */ 240 + PCMREC_FINISH_STOP, /* finish the stopping recording */ 241 + PCMREC_PAUSE, /* pause the current recording */ 242 + PCMREC_RESUME, /* resume the current recording */ 243 + PCMREC_NEW_FILE, /* start new file */ 244 + #if 0 245 + PCMREC_FLUSH_NUM, /* flush a number of files out */ 246 + #endif 247 + }; 258 248 259 - static inline void pcm_thread_unsignal_event(long event) 260 - { 261 - pcm_thread_event_mask &= ~event; 262 - } /* pcm_thread_unsignal_event */ 263 - 264 - static inline bool pcm_thread_event_state(long signaled, long unsignaled) 265 - { 266 - return ((signaled | unsignaled) & pcm_thread_event_mask) == signaled; 267 - } /* pcm_thread_event_state */ 268 - 269 249 /*******************************************************************/ 270 250 /* Functions that are not executing in the pcmrec_thread first */ 271 251 /*******************************************************************/ ··· 401 381 void pcm_rec_init(void) 402 382 { 403 383 queue_init(&pcmrec_queue, true); 384 + queue_enable_queue_send(&pcmrec_queue, &pcmrec_queue_send); 404 385 create_thread(pcmrec_thread, pcmrec_stack, sizeof(pcmrec_stack), 405 386 pcmrec_thread_name, PRIORITY_RECORDING); 406 387 } /* pcm_rec_init */ ··· 417 398 void audio_init_recording(unsigned int buffer_offset) 418 399 { 419 400 logf("audio_init_recording"); 420 - pcm_thread_sync_post(PCMREC_INIT, NULL); 401 + queue_send(&pcmrec_queue, PCMREC_INIT, NULL); 421 402 logf("audio_init_recording done"); 422 403 (void)buffer_offset; 423 404 } /* audio_init_recording */ ··· 428 409 void audio_close_recording(void) 429 410 { 430 411 logf("audio_close_recording"); 431 - pcm_thread_sync_post(PCMREC_CLOSE, NULL); 412 + queue_send(&pcmrec_queue, PCMREC_CLOSE, NULL); 432 413 logf("audio_close_recording done"); 433 414 } /* audio_close_recording */ 434 415 ··· 438 419 void audio_set_recording_options(struct audio_recording_options *options) 439 420 { 440 421 logf("audio_set_recording_options"); 441 - pcm_thread_sync_post(PCMREC_OPTIONS, (void *)options); 422 + queue_send(&pcmrec_queue, PCMREC_OPTIONS, (void *)options); 442 423 logf("audio_set_recording_options done"); 443 424 } /* audio_set_recording_options */ 444 425 ··· 448 429 void audio_record(const char *filename) 449 430 { 450 431 logf("audio_record: %s", filename); 451 - pcm_thread_sync_post(PCMREC_START, (void *)filename); 432 + queue_send(&pcmrec_queue, PCMREC_START, (void *)filename); 452 433 logf("audio_record_done"); 453 434 } /* audio_record */ 454 435 ··· 458 439 void audio_new_file(const char *filename) 459 440 { 460 441 logf("audio_new_file: %s", filename); 461 - pcm_thread_sync_post(PCMREC_NEW_FILE, (void *)filename); 442 + queue_send(&pcmrec_queue, PCMREC_NEW_FILE, (void *)filename); 462 443 logf("audio_new_file done"); 463 444 } /* audio_new_file */ 464 445 ··· 468 449 void audio_stop_recording(void) 469 450 { 470 451 logf("audio_stop_recording"); 471 - pcm_thread_sync_post(PCMREC_STOP, NULL); 452 + queue_send(&pcmrec_queue, PCMREC_STOP, NULL); 472 453 logf("audio_stop_recording done"); 473 454 } /* audio_stop_recording */ 474 455 ··· 478 459 void audio_pause_recording(void) 479 460 { 480 461 logf("audio_pause_recording"); 481 - pcm_thread_sync_post(PCMREC_PAUSE, NULL); 462 + queue_send(&pcmrec_queue, PCMREC_PAUSE, NULL); 482 463 logf("audio_pause_recording done"); 483 464 } /* audio_pause_recording */ 484 465 ··· 488 469 void audio_resume_recording(void) 489 470 { 490 471 logf("audio_resume_recording"); 491 - pcm_thread_sync_post(PCMREC_RESUME, NULL); 472 + queue_send(&pcmrec_queue, PCMREC_RESUME, NULL); 492 473 logf("audio_resume_recording done"); 493 474 } /* audio_resume_recording */ 494 475 ··· 1137 1118 is_stopping = false; 1138 1119 1139 1120 buffer = audio_get_recording_buffer(&rec_buffer_size); 1121 + 1140 1122 /* Line align pcm_buffer 2^4=16 bytes */ 1141 1123 pcm_buffer = (unsigned char *)ALIGN_UP_P2((unsigned long)buffer, 4); 1142 1124 enc_buffer = pcm_buffer + ALIGN_UP_P2(PCM_NUM_CHUNKS*PCM_CHUNK_SIZE + ··· 1145 1127 rec_buffer_size -= pcm_buffer - buffer; 1146 1128 1147 1129 pcm_init_recording(); 1148 - pcm_thread_unsignal_event(PCMREC_CLOSE); 1149 - pcm_thread_signal_event(PCMREC_INIT); 1150 1130 } /* pcmrec_init */ 1151 1131 1152 1132 /* PCMREC_CLOSE */ ··· 1158 1138 pcm_close_recording(); 1159 1139 reset_hardware(); 1160 1140 audio_remove_encoder(); 1161 - pcm_thread_unsignal_event(PCMREC_INIT); 1162 - pcm_thread_signal_event(PCMREC_CLOSE); 1163 1141 } /* pcmrec_close */ 1164 1142 1165 1143 /* PCMREC_OPTIONS */ ··· 1218 1196 errors |= PCMREC_E_LOAD_ENCODER; 1219 1197 } 1220 1198 1221 - pcm_thread_signal_event(PCMREC_OPTIONS); 1222 1199 } /* pcmrec_set_recording_options */ 1223 1200 1224 1201 /* PCMREC_START/PCMREC_NEW_FILE - start recording (not gapless) 1225 1202 or split stream (gapless) */ 1226 - static void pcmrec_start(int event, const char *filename) 1203 + static void pcmrec_start(const char *filename) 1227 1204 { 1228 1205 unsigned long pre_sample_ticks; 1229 1206 int rd_start; ··· 1318 1295 enc_rd_index); 1319 1296 1320 1297 start_done: 1321 - pcm_thread_signal_event(event); 1322 1298 logf("pcmrec_start done"); 1323 1299 } /* pcmrec_start */ 1324 1300 ··· 1343 1319 queue_post(&pcmrec_queue, PCMREC_FINISH_STOP, NULL); 1344 1320 1345 1321 not_recording_or_stopping: 1346 - pcm_thread_signal_event(PCMREC_STOP); 1347 1322 logf("pcmrec_stop done"); 1348 1323 } /* pcmrec_stop */ 1349 1324 ··· 1419 1394 is_paused = true; 1420 1395 1421 1396 not_recording_or_paused: 1422 - pcm_thread_signal_event(PCMREC_PAUSE); 1423 1397 logf("pcmrec_pause done"); 1424 1398 } /* pcmrec_pause */ 1425 1399 ··· 1444 1418 dma_lock = false; 1445 1419 1446 1420 not_recording_or_not_paused: 1447 - pcm_thread_signal_event(PCMREC_RESUME); 1448 1421 logf("pcmrec_resume done"); 1449 1422 } /* pcmrec_resume */ 1450 1423 ··· 1491 1464 1492 1465 case PCMREC_START: 1493 1466 case PCMREC_NEW_FILE: 1494 - pcmrec_start(ev.id, (const char *)ev.data); 1467 + pcmrec_start((const char *)ev.data); 1495 1468 break; 1496 1469 1497 1470 case PCMREC_STOP: ··· 1509 1482 case PCMREC_RESUME: 1510 1483 pcmrec_resume(); 1511 1484 break; 1512 - 1485 + #if 0 1513 1486 case PCMREC_FLUSH_NUM: 1514 1487 pcmrec_flush((unsigned)ev.data); 1515 1488 break; 1516 - 1489 + #endif 1517 1490 case SYS_USB_CONNECTED: 1518 1491 if (is_recording) 1519 1492 break; ··· 1523 1496 usb_wait_for_disconnect(&pcmrec_queue); 1524 1497 break; 1525 1498 } /* end switch */ 1499 + 1500 + queue_reply(&pcmrec_queue, NULL); 1526 1501 } /* end while */ 1527 1502 } /* pcmrec_thread */ 1528 1503