FS#6024 - Fix for voice crash after playback stops - take 2

Attached to Project: Rockbox
Opened by Steve Bavin (pondlife) - Tuesday, 19 September 2006, 08:59 GMT
Last edited by Steve Bavin (pondlife) - Wednesday, 20 September 2006, 10:55 GMT
Task Type Patches
Category Music playback
Status Closed
Assigned To Steve Bavin (pondlife)
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This is an addendum to  FS#5992  - - read that for full explanation.

The previous patch was committed too early (breaking recording) and was then partially reverted, so it was not effective against the bug it was aimed at fixing.

The problem was caused by swap_codec being called when no audio codec is loaded; thus nothing ever takes over from the voice codec and swap_codec never completes.

The attached patch resolves that bug, but may again break recording (although I cannot reproduce that here on the sim, probably because the simulator does not simulate recording enough - another job!).

Please can someone with access to a recording target test this patch and report back. I should get my H300 back soon and will test on that.

This task depends upon

Closed by  Steve Bavin (pondlife)
Tuesday, 26 September 2006, 07:28 GMT
Reason for closing:  Accepted
Additional comments about closing:  Committed, nobody has reported any problems and it fixes 3 issues.
Comment by Steve Bavin (pondlife) - Wednesday, 20 September 2006, 09:12 GMT
Here's a slightly updated version. I've tested this on an H340 and recording still works. Can others please test too?
Comment by Steve Bavin (pondlife) - Wednesday, 20 September 2006, 09:14 GMT
Comment by Steve Bavin (pondlife) - Wednesday, 20 September 2006, 14:23 GMT
Here's an updated version that will allow recording to be monitored, even if voice menus are still talking...
Comment by Rani Hod (RaeNye) - Wednesday, 20 September 2006, 15:26 GMT
Bottom line: doesn't crash X5.

All OK when recording Mic/FM radio without voice;

If voice plays while entering recording screen:
- the peakmeters are max'ed out
- recording comes out as noise
- voice doesn't play anymore
- voice thread is running continuously (*R)
- CPU boost is stuck at 1
but still player doesn't crash.
Comment by Steve Bavin (pondlife) - Wednesday, 20 September 2006, 17:00 GMT
Hi Rani,

I can't reproduce anything like that on the H300. Does it happen if you just enable voice menus (rather than file/dir voicing)? I assume you hover on "Recording Screen" and then press select before speech completes?
Comment by Steve Bavin (pondlife) - Wednesday, 20 September 2006, 17:31 GMT
OK, I've added waits to ensure that both audio and voice playback completes before recording begins. Please try this version of the patch.
Comment by Rani Hod (RaeNye) - Thursday, 21 September 2006, 17:41 GMT
make says:
CC pcmbuf.c
pcmbuf.c: In function `pcmbuf_boost':
pcmbuf.c:124: warning: implicit declaration of function `cpu_boost_id'
pcmbuf.c:124: error: `CPUBOOSTID_PCMBUF' undeclared (first use in this function)
pcmbuf.c:124: error: (Each undeclared identifier is reported only once
pcmbuf.c:124: error: for each function it appears in.)
make[1]: *** [rockbox-6024/build/apps/pcmbuf.o] Error 1
make: *** [all] Error 2

I guess you were using  FS#6033  as well?
Comment by Steve Bavin (pondlife) - Thursday, 21 September 2006, 17:47 GMT
D'OH! Yes - my next aim is to fix the problem where the PCMBUF boost remains enabled after stop... The attached update should apply cleanly.
Comment by Rani Hod (RaeNye) - Friday, 22 September 2006, 15:46 GMT
Tested on X5, no problems found.
Comment by Steve Bavin (pondlife) - Saturday, 23 September 2006, 14:19 GMT
Here's today's version! This should also fix the reported problem where CPU remains boosted after stop if voice is in use.
Comment by Steve Bavin (pondlife) - Saturday, 23 September 2006, 21:50 GMT
One more fix - audio_stop now returns only once playback has stopped, otherwise the playlist viewer got confused. (lostlogic already fixed this bug back in April, but I brought it back for a while...)