Rockbox

Tasklist

FS#9066 - Threads hanging if force track switching near buffer emptyness

Attached to Project: Rockbox
Opened by Sergey Babichev (bsl84) - Tuesday, 03 June 2008, 05:08 GMT
Last edited by Andree Buschmann (Buschel) - Sunday, 13 February 2011, 20:10 GMT
Task Type Bugs
Category Music playback
Status Closed
Assigned To Nicolas Pennequin (nicolas_p)
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Build 17661 (and earlier) on Gigabeat F20, iCatcher.
Playing directory containing FLAC files. Last file ends.
In file browser select and load another track/directory (File still plays).
Result - 'Unknown track', 'Unknown album', valid file name. Silence ...
Debug|Show buffering thread - all empty, except bottom one.
In this state select/play does not work, any next file would get the same 'Unknown album' and still silence.
Only reboot helps.
I suppose it happens when buffering thread filling (or just filled) buffers, forcing track switching must empty filled buffers and refill it. Empty is OK, but filling is no..
Switch to rockbox dated before 2007/08 - the error gone.
This task depends upon

Closed by  Andree Buschmann (Buschel)
Sunday, 13 February 2011, 20:10 GMT
Reason for closing:  Works For Me
Additional comments about closing:  I close this bug report as outdated and because I cannot reproduce such failure. We have other issues right now which are covered in several bug reports.
Comment by Nicolas Pennequin (nicolas_p) - Sunday, 29 June 2008, 11:55 GMT
Does this still happen after r17875?
Comment by Sergey Babichev (bsl84) - Sunday, 29 June 2008, 18:19 GMT
build 17876.
The problem persists.
The same sympthoms.
Problem with hanging when playing long files seems gone.
Comment by Nicolas Pennequin (nicolas_p) - Thursday, 03 July 2008, 15:21 GMT
Could you report the exact values displayed on the buffering debug screen?
I'm especially interested in the number of handles, but the other values might be useful too.
Comment by Sergey Babichev (bsl84) - Friday, 04 July 2008, 04:02 GMT
Exact values on the buffering screen all zeros.
RAM usage, handles count, all zeros.
By the way, this error happens only in the end of directory.
My directory layout is:
music
Brahms
Op025 ...
1- Allegro.flac
2- ...
...
4- ...
...
Op054 ...
Song of destiny ... flac
...
Spohr
...
...

e.t.c

There are many directories that contain only one track. I think, it is why this error hard to reproduce by others...

For example, playing Song of destiny.flac, the only track in directory, while it playing, I browse file system and when Song of destiny ends press play on selected track in Spohr directory, the buffering thread dies with beforementioned sympthoms. I can walk, delete - all I want except play ANY track - until reboot.
Comment by Steve Bavin (pondlife) - Tuesday, 08 July 2008, 14:43 GMT
Is this still happening with a brand new build? Does enabling or disabling directory cache make any difference?
Comment by Sergey Babichev (bsl84) - Wednesday, 09 July 2008, 12:29 GMT
It happens also in build 17987.
I'll try to disable directory cache (slo-o-o-ow)

Comment by Sergey Babichev (bsl84) - Wednesday, 09 July 2008, 16:09 GMT
Yet again. Now on iAudio X5. Last build. Disabled dircache. D2 WPS.

When I press PLAY on selected (in browser) track just about end of playing track, it is happens. Now playing screen points to first track on device.

Gigabeat F20/iCatcher/dircache
iAudio X5L/D2/no dircache

Here is my config.cfg on Gigabeat
# .cfg file created by rockbox r17671-080531 - http://www.rockbox.org

volume: -25
balance: 0
bass: 0
treble: 0
channels: stereo
stereo_width: 100
shuffle: off
repeat: off
contrast: 47
backlight timeout: 10
backlight timeout plugged: 60
flip display: off
selector type: bar (inverse)
statusbar: on
scrollbar: on
volume display: numeric
battery display: numeric
time format: 24hour
show icons: on
idle poweroff: 3
max files in playlist: 1000
max files in dir: 800
battery capacity: 2250
car adapter mode: off
backlight filters first keypress: off
caption backlight: off
brightness: 6
scroll speed: 10
scroll delay: 100
bidir limit: 0
Screen Scrolls Out Of View: off
scroll step: 7
screen scroll step: 16
scroll paginated: off
foreground color: 000000
background color: FFFFFF
line selector start color: FFEB9C
line selector end color: B58E00
line selector text color: 000000
play selected: on
party mode: off
volume fade: on
scan min step: 1
scan accel: 3
antiskip: 5s
disk spindown: 5
show files: supported
sort case: off
show filename exts: on
follow playlist: on
playlist viewer icons: on
playlist viewer indices: on
playlist viewer track display: track name
recursive directory insert: on
autocreate bookmarks: off
autoload bookmarks: off
use most-recent-bookmarks: off
peak meter clip hold: 60
peak meter hold: 500ms
peak meter release: 8
peak meter dbfs: on
peak meter min: 60
peak meter max: 0
talk menu: off
talk dir: off
talk dir clip: off
talk file: off
talk file clip: off
talk filetype: off
Announce Battery Level: off
sort files: alpha
sort dirs: alpha
folder navigation: on
gather runtime data: off
replaygain: off
replaygain type: album
replaygain noclip: off
replaygain preamp: 0
beep: off
crossfade: off
crossfade fade in delay: 0
crossfade fade out delay: 0
crossfade fade in duration: 3
crossfade fade out duration: 3
crossfade fade out mode: crossfade
crossfeed: off
crossfeed direct gain: -15
crossfeed cross gain: -30
crossfeed hf attenuation: 160
crossfeed hf cutoff: 700
eq enabled: off
eq precut: 50
eq band 0 cutoff: 60
eq band 1 cutoff: 200
eq band 2 cutoff: 800
eq band 3 cutoff: 4000
eq band 4 cutoff: 12000
eq band 0 q: 7
eq band 1 q: 10
eq band 2 q: 10
eq band 3 q: 10
eq band 4 q: 7
eq band 0 gain: 50
eq band 1 gain: 40
eq band 2 gain: -20
eq band 3 gain: 10
eq band 4 gain: 20
dithering enabled: on
dircache: on
tagcache_ram: on
tagcache_autoupdate: on
default codepage: cp1251
warn when erasing dynamic playlist: on
backlight on button hold: off
hold_lr_for_scroll_in_list: on
show path in browser: current directory
pause on headphone unplug: pause and resume
rewind duration on pause: 3
disable autoresume if phones not present: on
Last.fm Logging: off
font: /.rockbox/fonts/nimbus-19.fnt
wps: /.rockbox/wps/iCatcher.wps
lang: /.rockbox/langs/english.lng
backdrop:
kbd:
usb charging: on
cuesheet support: off
Study mode: off
Study hop step: 6
start in screen: wps
iconset:
viewers iconset:
filetype colours: /.rockbox/themes/-.colours
button light timeout: off
button light brightness: 1
list_accel_start_delay: 2
list_accel_wait: 3
keyclick: off
keyclick repeats: off
playlist catalog directory: /Playlists
touchpad sensitivity: normal
Comment by Sergey Babichev (bsl84) - Wednesday, 30 July 2008, 18:39 GMT
Build 18148.
It happens again and again...
Comment by Sergey Babichev (bsl84) - Wednesday, 29 October 2008, 18:30 GMT
Situation the same.
Very anoying with my method of listening (browse files near the end of directory for to decide what to listen next.
Where can I get version before this !@#$%^ change (near april 2007, there was very good and stable version)? I need it at least for Gigabeat F20.
Comment by Steve Bavin (pondlife) - Wednesday, 29 October 2008, 20:38 GMT
Does this only happen with FLAC? I couldn't repro it (with your settings), but I was using only MP3s.
Comment by Sergey Babichev (bsl84) - Wednesday, 29 October 2008, 21:27 GMT
Any format (testing mp3, flac, ogg, aac, mpc).
If you try to browse files at the end of directory (directories I have contain 1-5 files usually), the buffering thread hanged.
There are 'Unknown artist' and 'Unknown album' on the screen. Only shutdown helps.
ANY new build, 18789 at least.
On X5L and on F20.
I wonder, is there anybody to observe this error, or all using random or album-oriented style.
Comment by Steve Bavin (pondlife) - Wednesday, 29 October 2008, 21:39 GMT
I think I've just reproduced *something* in the simulator (H300) with MP3s.

Basically I select a file from the file browser in the last 4 seconds of the last track in a playlist. This initial selection then fails to play (I return straight back to the browser), and if I then select the same track again it plays ok but the track index is out by 1 for subsequent tracks (i.e. it displays 1,1,2,3 rather than 1,2,3,4 - and the playlist viewer is similarly confused).

Pressing STOP and restarting sorts it out in this case though, so not as bad as you're suffering.
Comment by Sergey Babichev (bsl84) - Wednesday, 10 December 2008, 12:19 GMT
build r19377 get the situation much worse...
Now, F20 and X5L deadly hanged, I have to switching the battery off on F20 or reset on X5L...
I hope, you are on right direction...
Comment by Sergey Babichev (bsl84) - Wednesday, 10 December 2008, 12:20 GMT
I think, I have to switch to versions before, but, unfortunatelly haven't ones. Where can I get it? For F20 at least...
Comment by Steve Bavin (pondlife) - Wednesday, 10 December 2008, 12:28 GMT
Sounds like something didn't upgrade properly - maybe try renaming your .rockbox directory and re-installing?
Comment by Sergey Babichev (bsl84) - Friday, 19 December 2008, 06:05 GMT
It looks like that 19377 had solved the problem at least.
Comment by Steve Bavin (pondlife) - Friday, 19 December 2008, 07:34 GMT
I'm confused, you said before that this problem was still happening in r19377 ("much worse"). Is this not the case?
Comment by Sergey Babichev (bsl84) - Friday, 19 December 2008, 07:38 GMT
I had removed old .rockbox and installed all new at scratch - include configuring. Did this just after your recipe. No problem since (I hope).

Comment by Sergey Babichev (bsl84) - Thursday, 25 December 2008, 10:10 GMT
I'm sorry, but the problem yet exists....
Yes, it happens much less frequently, but if it is happens - dead hang. The message 'Loading' is on the screen. Keys do not work except when the screen luminance goes off - then the luminance goes on.
I waited for 5 minutes then had to reset...

Comment by Sergey Babichev (bsl84) - Sunday, 22 February 2009, 14:38 GMT
Well.
There is a really serious bug in all new builds (I mention only FX).
Hangs now appear in just playing - suddenly the music stops and the player does not respond to keys. Always HDD is spinning this time. I have to switch battery off then on.
Being tired of all this, I downloaded all SDK's, SVN and got build 15305.
A week came without a flaw...
So, developers, get some attention to synchronization issues in code (race conditions/deadlocks/resource locks e.t.c)
Comment by Nicolas Pennequin (nicolas_p) - Sunday, 22 February 2009, 16:03 GMT
@bsl84: If you actually want to help us fix the bugs, at least giving an estimation of when the new issue started happening would be a good start.
Comment by Sergey Babichev (bsl84) - Tuesday, 24 February 2009, 22:21 GMT
@nicolas_p
You probably misunderstand me. I download all the stuff ONLY to compile the version I know to work for me.
As I see, there are many developers here and no one (mee too) want make really stable and robust RockBox operating system...
I will not participate to develop, too many efforts to get through this C language code with endless #ifdef and #define, global and static variables and cooperative multitasking...
Thanks for great product (it much more stable than production COWON firmware), but it is not for me.
Comment by Michael Sevakis (MikeS) - Wednesday, 25 February 2009, 01:33 GMT
Sergey, you have my vote for preemptive multitasking! I'll jump on that and implement it in a hearbeat. As far as it being as formally divided between user and supervisor modes, I can't say I would go for that. It's not really a general-purpose operating system and there are advantages to not turning it into something like Linux or Windows or whatever. That's a bit excessive. The threading change has distinct advantages and if code is properly written for that, it really is not much more complex (in most cases not at all).

We'll never fully remove #ifdef and also support so many devices and we're not going to duplicate tons of code to do it. You can global and static variables and still have good abstraction. It just requires planning and planning ahead rather than evolution and just getting the immediate task at hand to work. What's the difference if they're part of some global object or global as a variable? Effectively none. Too much focus on form of the code rather than quality of the code can just give you bloated code that isn't really any better than the C.

Remaining lightweight is a worthy goal for this particular application.

Loading...