Author Topic: XMPlay SID plugin  (Read 299809 times)

WillGraham

  • Posts: 5
Re: XMPlay SID plugin
« Reply #500 on: 5 Jan '14 - 23:48 »
Hm, if it's the engine issue, then I remember SIDPlay offering a selection between regular emulation and reSID... perhaps this selection could be added to XMP-SID as well?

Dhry

  • Posts: 80
Re: XMPlay SID plugin
« Reply #501 on: 6 Jan '14 - 02:51 »
Sounds to me like you could either have the v26 version installed if you prefer seek speed over accurate filtering, and keep v32 if you want better audio. Personally I'd prefer v32 to support multicore CPUs so those of us with quadcores or faster could have them fully taken advantage of during processor-intensive tasks such as this.

Dhry

Fraggie

  • Posts: 714
Re: XMPlay SID plugin
« Reply #502 on: 7 Jan '14 - 17:36 »
I'm not sure how would you want to parallelise seeking...?

Anyway, the new library is more accurate, so it's more demanding. Seeking is just a bonus (it's even disabled by default!).

piovrauz

  • Posts: 969
Re: XMPlay SID plugin
« Reply #503 on: 7 Jan '14 - 18:34 »
Oh, Fraggie, btw, could you check thos 2 "old" post of mine (sid plugin related)?

http://www.un4seen.com/forum/?topic=3838.msg107321#msg107321
http://www.un4seen.com/forum/?topic=3838.msg107334#msg107334

Thanks.
Also thanks for fixing delix plugin (Your webby was saying "don't bother me", so double thanks)

Fraggie

  • Posts: 714
Re: XMPlay SID plugin
« Reply #504 on: 8 Jan '14 - 13:36 »
Still many drivers aren't detected, for example:
The sidid configuration that is being used has been amended, so driver names fit nicely in XMPlay's windows. Also some more "obscure" drivers were commented out. I'll look into bringing most of them back. In the meantime you can use your own sidid.cfg file and put it in the same directory as xmp-sid.dll.

- If I set a song to play indefinitely (putting 0 on the default duration) it still reads from the SLDB and ignores it. If I check "force" the file won't play and XMPlay will just show zeroes (it's forcing zero lenght?) I tried this with /MUSICIANS/R/Randy/Illusion.sid. Is this expected?
I suppose you have "skip very short songs" enabled? (Default song time is only used when song duration is unknown, unless "force" is selected.)

if I close XMPlay while a song is playing, then reopen XMPlay, it'll hang.
I think it's the song that starts to play, but for some reason fails.
If the song is stopped then XMPlay starts fine.
Yes, this seems to happen if you're closing XMPlay with saving playback position.

I'll fix both issues for the next revision.

piovrauz

  • Posts: 969
Re: XMPlay SID plugin
« Reply #505 on: 8 Jan '14 - 13:51 »
- Yes, I have "skip very short songs" enabled.
- To be clear: I'm fine without .sid resuming from position (I disabled seeking after all). You can have it start from the beginning, that would be fine.

Thanks for next revision in advance.

Jace

  • Posts: 825
Re: XMPlay SID plugin
« Reply #506 on: 8 Jan '14 - 14:36 »
Was wonderin' if it'd be possible for the plugin to temporarily disable all filters and other cpu hungry options while seeking to speed things up? Or does it do that already?

Fraggie

  • Posts: 714
Re: XMPlay SID plugin
« Reply #507 on: 8 Jan '14 - 15:14 »
I was experimenting with that, but the results were very discouraging. Well, you can try yourself and compare (disable filters, switch to normal quality and sampling lower resolution). But I'll look into it again, maybe something more can be disabled (i.e. something that is not switchable from the public interface of libsidplayfp).
« Last Edit: 8 Jan '14 - 17:28 by Fraggie »

Fraggie

  • Posts: 714
Re: XMPlay SID plugin
« Reply #508 on: 8 Jan '14 - 17:13 »
OK, here's something to try: the attached build comes with a hack that disables output generating and all filter clocking during seeking. I'm not sure if emulation quality is degraded after seeking, but it is a bit faster. Please let me know how does it work for you.
« Last Edit: 8 Jan '14 - 17:18 by Fraggie »

piovrauz

  • Posts: 969
Re: XMPlay SID plugin
« Reply #509 on: 8 Jan '14 - 17:29 »
Tried it. Doesn't seem to improve the situation that much, but XMPlay doesn't completely freeze.
It still is unresponsive, and CPU one core goes 100%, but the skin doesn't show black area anymore.
Still, placebo or not, the tune seems kind of different, exp the puncying bassline and the hihats.
EDIT: used /MUSICIANS/R/Randy/Illusion.sid to test.
Btw, does the plugin use only 1 CPU core? is it normal behaviour?
« Last Edit: 8 Jan '14 - 17:31 by piovrauz »

Fraggie

  • Posts: 714
Re: XMPlay SID plugin
« Reply #510 on: 8 Jan '14 - 18:18 »
True, the sound is different. In that case there's no point in going that direction. The hard way is to actually improve libsidplayfp performance-wise, but that's not in the scope of maintaining a plugin, I'm afraid.

And yes, it uses one core since it's one thread. :) Everything's sequential and cannot be parallelised without major changes in the engine (and even then synchronisation efforts would probably eat up most of the gains of multi-threading).

piovrauz

  • Posts: 969
Re: XMPlay SID plugin
« Reply #511 on: 8 Jan '14 - 18:24 »
OK, np for me, I'll keep seeking disble and anjoy the Hi-Q sid tunes. ;)

lukop

  • Guest
Re: XMPlay SID plugin
« Reply #512 on: 15 Jan '14 - 13:05 »
Hi guys,
I have already contacted the developer pieknyman and asked him for that. He knows about this problem..
We all know that SIDs can not be easily seeked but there is a solution! But it depends on many people will cooperate and this seems to me impossible :( That guys are not as easily to be contacted..
The solution I see is if the developers of libsidplay-fp (Vice team) and mainly BeRo and also pieknyman (he is very kind guy, but has not much time for it) could work together that Vice team will improve the libsidplay-fp to add the code for fast seeking using BeRo Hyper64 code - this will solve this as this emulator is the fastest ever as it emulates c64 instructions using x86 instruction set and also to make the emulation more simple and not so precise while seeking (e.g. disabling filters - because not necessary if not hearable while seeking) and then pieknyman could use this new modified lib for the player plugin..

I am still using v31 of this sid plugin because v32 donīt work in my older (v3.6) XMPlay and while I use newest XMPlay 3.8 it crashes a lot with it.. The v31 then works for me good enough yet!

Dhry

  • Posts: 80
Re: XMPlay SID plugin
« Reply #513 on: 15 Jan '14 - 19:47 »
I'm trying the seek-hack version. It does appear to improve seek speed somewhat, and I haven't noticed any audio artefacts, but it still takes about 20 seconds to seek to near the end of Lightforce (a 7-minute track).

While testing I noticed something very interesting. I started Lightforce playing then seeked to about 90% of the way. It took quite a while, as expected. Then I seeked backward to about 10 seconds in and the seek happened very fast indeed. Seeked to 90%, took forever. I seeked back just a little, to maybe 85% in, and it took forever again - even though the previous seek position was seconds away in track time. What appears to be happening is that every time you seek, it seeks from the beginning of the song, instead of from your current playback position.

Having said that, is it possible to "decode as fast as possible" from the current playback point, rather than from the beginning of the song? And, when seeking backward from the current point, is there a way of "reverse-decoding"? If so, this would at least make multiple shorter-jump seeks potentially a LOT faster.

Certain serially-decoded video files have functionality, I think it has to do with I/B/P frames, which allow seeking within the files. If only there was a way of generating similar metadata for SID tracks that allows playback to synchronize quickly with seek frames the same way. I can dream..

Dhry

saga

  • Posts: 2251
Re: XMPlay SID plugin
« Reply #514 on: 15 Jan '14 - 20:17 »
Quote
I have already contacted the developer pieknyman and asked him for that. He knows about this problem..
Just so you know, the plugin author is called "Fraggie" on this forum and does read the thread, just look up a few responses. :)

Quote
Seeked to 90%, took forever. I seeked back just a little, to maybe 85% in, and it took forever again - even though the previous seek position was seconds away in track time. What appears to be happening is that every time you seek, it seeks from the beginning of the song, instead of from your current playback position.
Again, you cannot seek SID files, which is why they have to be decoded from scratch anytime you seek to a position in the past like in that example. The plugin doesn't keep a buffer of what has already been played, that would be rather wasteful. Seeking five seconds forward shouldn't be a problem - but backwards seeking as well as skipping minutes of audio will always be.

Dhry

  • Posts: 80
Re: XMPlay SID plugin
« Reply #515 on: 15 Jan '14 - 21:06 »
Quote
Seeked to 90%, took forever. I seeked back just a little, to maybe 85% in, and it took forever again - even though the previous seek position was seconds away in track time. What appears to be happening is that every time you seek, it seeks from the beginning of the song, instead of from your current playback position.
Again, you cannot seek SID files, which is why they have to be decoded from scratch anytime you seek to a position in the past like in that example. The plugin doesn't keep a buffer of what has already been played, that would be rather wasteful. Seeking five seconds forward shouldn't be a problem - but backwards seeking as well as skipping minutes of audio will always be.
No need to repeat, I think I and just about everyone else understand this, which is the reason for the creative suggestions on how to improve (such as removing all filter processing before decoding). A buffer of what has already been played is not necessary, and the reason is this: if I play a SID and then press the pause button halfway through, when I unpause, the track immediately starts playing back without having to spool/decode from the beginning again - the reason is that it knows the current position and can therefore instantly resume decoding from it. Given this fact, seeking ten seconds forward once the halfway point has already been reached (== decoded to) should also not need the track to be decoded from the beginning because the start point for the decoding is locked in. I get that it's probably not possible to decode in reverse, and that's fair enough.

Still trying to figure out here why Acid64 with jSidDevice 1.4.2 (Antti Lankila and Dag Lem contributed to the project) can seek so fast, both backward and forward, and still have excellent filtering.

Dhry

piovrauz

  • Posts: 969
Re: XMPlay SID plugin
« Reply #516 on: 15 Jan '14 - 22:41 »
1. Turning off filtering when "seeking" is a bad idea, just tried the build Fraggie put out and it does make the tune sound wrong.
(seems like you didn't read the previous few posts)

2. You don't seem to understant what .sid files are, nor what "seeking" means for those, nor how it's done.
(sorry, but it's like that)

Fraggie

  • Posts: 714
Re: XMPlay SID plugin
« Reply #517 on: 16 Jan '14 - 10:54 »
If you seek backwards the song is restarted and silently decoded until the seek position is reached. If you seek forward then it is silently decoded from the current decode position. You must, however, take the output and cross-fade buffers size into account. So if you're seeking forward within these buffers limits then you're actually seeking backwards from the plugin's point of view.

lukop

  • Guest
Re: XMPlay SID plugin
« Reply #518 on: 16 Jan '14 - 12:55 »
1. Turning off filtering when "seeking" is a bad idea, just tried the build Fraggie put out and it does make the tune sound wrong.
(seems like you didn't read the previous few posts)

I have not read the previous few posts also as I donīt know which once.. But I still can not see any reason to sounds wrong - if SID self will stay emulated (the data written to the memory for filters) without exact sound emulation of the filters, why it may sound wrong??

I see the only solution to be faster to be using Hyper64 code from BeRo and the more simply emulation self while seeking..

inagy

  • Posts: 14
Re: XMPlay SID plugin
« Reply #519 on: 26 Feb '14 - 14:12 »
Hi!

Very nice plugin, thank you very much for making it! I really like how it supports stereo emulation and fading out. I can now export my favourite SID tunes to FLAC :)

I have one feature request though. It would be really nice if i could say "repeat looped songs [n] times before fadeout" where n is configurable.
Some SIDs have very short subtunes and i would really like to repeat these subtunes possibly twice, especially when exporting to FLAC.

Is it possible to do this? ???

Knurek

  • Posts: 525
Re: XMPlay SID plugin
« Reply #520 on: 26 Feb '14 - 14:21 »
Is it possible to do this? ???

Not really, SLDB does not provide looping information, just duration of the song. Multiplying the data won't work as tunes often have an intro portion which is only played once.
It's still a standard text file, so you can edit the data on your own if you feel the need.

inagy

  • Posts: 14
Re: XMPlay SID plugin
« Reply #521 on: 2 Mar '14 - 11:41 »
It's still a standard text file, so you can edit the data on your own if you feel the need.

Goog idea. I haven't thought about that. Because i'm already preparing FLAC export by specifying stereo mode and the amount of reverb applied to not sound bad on headphones it's not a big additional step :)

Earthworm Gym

  • Posts: 12
Re: XMPlay SID plugin
« Reply #522 on: 24 Mar '14 - 13:33 »
Alot of songs don't play for their correct / full duration. but they play correctly with sid play 2, so I know that it isn't the sids from HVSC.

And Subsong 1 of Robocop 3 by Jeroen Tel doesn't play at all, it crashes xmplay. The remaining subsongs do.
There are probably alot more.

Thanks for letting me listen to awesome c64 memories!

Fraggie

  • Posts: 714
Re: XMPlay SID plugin
« Reply #523 on: 24 Mar '14 - 16:51 »
Alot of songs don't play for their correct / full duration. but they play correctly with sid play 2, so I know that it isn't the sids from HVSC.
It's easier for me if you name the files that you are having problems with.

piovrauz

  • Posts: 969
Re: XMPlay SID plugin
« Reply #524 on: 24 Mar '14 - 20:08 »
Yeah, Fraggie is fast fixing stuff, but naming the "offender" is the bare minimum he needs. ;)