Re: [Musicpd-dev-team] vtx plugin decoder
2009/11/2, kernel error k3rn3l.3r...@gmail.com: 2009/11/2, Max Kellermann m...@duempel.org: On 2009/11/02 13:57, kernel error k3rn3l.3r...@gmail.com wrote: Technically, SNDNEED = SNDBUF/(channels*(bits/8)), i assume that mean the number of instructions to execute ? but I'm really not sure, I take xmms-plugin as an example and I confess I don't understood completly his working. If you copy'n'paste code from another module, you have to write that in a comment. And, please do not submit code you do not understand (yet). It looks like the code tries to fill the buffer completely, even if an input frame is smaller than the buffer. MPD can handle partial buffers fine, in fact, MPD does not even regulate the buffer size - submit any non-empty decoded buffer to decoder_data(), as much as you have at any given time. After take a lookt at source code, I'm guessing the code doen't fill completly the buffer, it fill only a part of song frame by frame, so thats an essential part of code, i can't remove this loop. I guess the whole loop can be eliminated, replaced with a single ayemu_vtx_getframe() / ayemu_set_regs() / ayemu_gen_sound() call. Oh, and please check your variable types. e.g. don't use signed integers for counting stuff (bytes, frames, ...). Max -- Regards, kernel_error -- Regards, kernel_error -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
Re: [Musicpd-dev-team] vtx plugin decoder
/* pos = current frame. */ pos = 0; /* number of frames can be played with the current AY register.*/ left = 0; rate = audio_format.channels * ( audio_format.bits / 8 ); /*number of frames played.*/ donow = 0; do { stream = sndbuf; /* fill partialy sound buffer frame by frame. need is the number of frames remaining.*/ for ( need = SNDNEED ; need 0 ; need -= donow ) { if ( left 0 ) { /* stream current frame. */ donow = ( need left ) ? left : need; left -= donow; stream = ayemu_gen_sound ( ay , (char*)stream , donow * rate ); } else { /* get next frame clean buffer. */ if ( pos++ vtx-frames ) { end = 1; donow = need; memset (stream , 0 , donow*rate ); } else { /* get current frame and unpack data. */ ayemu_vtx_getframe ( vtx , pos , regs ); /* left = audio_frequency/player_frequency ??? */ left = 44100 / vtx-playerFreq; ayemu_set_regs ( ay , regs ); donow = 0; } } } Thats all i can know. Now its simple, you need more informations about weirds operations? need more informations about his working, you have 2 solutions, either you studying under AY/YM sound chip or you simply forget this plugin. I've contacted the author about these weird operations and i'm waiting reply since yesturday. 2009/11/3, Max Kellermann m...@duempel.org: On 2009/11/03 16:10, kernel error k3rn3l.3r...@gmail.com wrote: After take a lookt at source code, I'm guessing the code doen't fill completly the buffer, it fill only a part of song frame by frame, so thats an essential part of code, i can't remove this loop. Stop guessing. - I don't see any frame by frame code, please point me to it. - what is the meaning of need, donow, left, pos? - why does the loop call memset()? Why does it generate zeroes after the end of the song? - why does the loop alternate between two states? (gen_sound and getframe) Why not just call these two sequentially? - what if ayemu_gen_sound() generates less than the specified number of bytes? - 44100 / vtx-playerFreq what does that formula do? -- Regards, kernel_error -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
Re: [Musicpd-dev-team] vtx plugin decoder
On 2009/11/03 18:04, kernel error k3rn3l.3r...@gmail.com wrote: Thats all i can know. So you copied somebody else's code without giving credit, removed the comments and submitted it here without actually understanding it? No, thanks. -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
Re: [Musicpd-dev-team] vtx plugin decoder
oh, Game Music Emu libraries, need to try it. 2009/11/2, Max Kellermann m...@duempel.org: On 2009/11/02 03:37, kernel error k3rn3l.3r...@gmail.com wrote: I suggest you a new plugin decoder which is able to read vtx chiptune format (Zx Spectrum music format). I used libayemu (http://sashnov.nm.ru/libayemu.html), it was released under GPLv2, so I suppose its compatible with your current license. Decoder plugin and patch can be found here: http://git.tuxfamily.org/kernelblog/vtxplugin.git As well, I checked some possible errors through valgrind, it founds 3 errors directly from libayemu but nothing in my code. Your code looks good, but I don't understand the complicated SNDNEED loop. What's the point of that? Please add some source comments explaining that. Technically, SNDNEED = SNDBUF/(channels*(bits/8)), i assume that mean the number of instructions to execute ? but I'm really not sure, I take xmms-plugin as an example and I confess I don't understood completly his working. Please add the library dependency to the INSTALL file. Your patch misses the required Makefile.am and configure.ac change. Well, I never used autotools, always cmake or written my own Makefile, so I'll try something clean but I promise nothing. And what's your real name, by the way? We use real names for commits in our git repository. You're using git in a funny way. Why not clone our master repository, and create one commit for your plugin? This way, we could just pull your patch with one command. Thats a great idea :) Max -- Regards, kernel_error -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
Re: [Musicpd-dev-team] vtx plugin decoder
On 2009/11/02 13:57, kernel error k3rn3l.3r...@gmail.com wrote: Technically, SNDNEED = SNDBUF/(channels*(bits/8)), i assume that mean the number of instructions to execute ? but I'm really not sure, I take xmms-plugin as an example and I confess I don't understood completly his working. If you copy'n'paste code from another module, you have to write that in a comment. And, please do not submit code you do not understand (yet). It looks like the code tries to fill the buffer completely, even if an input frame is smaller than the buffer. MPD can handle partial buffers fine, in fact, MPD does not even regulate the buffer size - submit any non-empty decoded buffer to decoder_data(), as much as you have at any given time. I guess the whole loop can be eliminated, replaced with a single ayemu_vtx_getframe() / ayemu_set_regs() / ayemu_gen_sound() call. Oh, and please check your variable types. e.g. don't use signed integers for counting stuff (bytes, frames, ...). Max -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
Re: [Musicpd-dev-team] vtx plugin decoder
2009/11/2, Max Kellermann m...@duempel.org: On 2009/11/02 13:57, kernel error k3rn3l.3r...@gmail.com wrote: Technically, SNDNEED = SNDBUF/(channels*(bits/8)), i assume that mean the number of instructions to execute ? but I'm really not sure, I take xmms-plugin as an example and I confess I don't understood completly his working. If you copy'n'paste code from another module, you have to write that in a comment. And, please do not submit code you do not understand (yet). Sorry, I'm not used to doing this but libayemu is poorly documented. It looks like the code tries to fill the buffer completely, even if an input frame is smaller than the buffer. MPD can handle partial buffers fine, in fact, MPD does not even regulate the buffer size - submit any non-empty decoded buffer to decoder_data(), as much as you have at any given time. I guess the whole loop can be eliminated, replaced with a single ayemu_vtx_getframe() / ayemu_set_regs() / ayemu_gen_sound() call. Hmm okay, no problem, I will improve that. Oh, and please check your variable types. e.g. don't use signed integers for counting stuff (bytes, frames, ...). Max -- Regards, kernel_error -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
Re: [Musicpd-dev-team] vtx plugin decoder
On 2009/11/02 03:37, kernel error k3rn3l.3r...@gmail.com wrote: I suggest you a new plugin decoder which is able to read vtx chiptune format (Zx Spectrum music format). I used libayemu (http://sashnov.nm.ru/libayemu.html), it was released under GPLv2, so I suppose its compatible with your current license. Decoder plugin and patch can be found here: http://git.tuxfamily.org/kernelblog/vtxplugin.git As well, I checked some possible errors through valgrind, it founds 3 errors directly from libayemu but nothing in my code. Your code looks good, but I don't understand the complicated SNDNEED loop. What's the point of that? Please add some source comments explaining that. Please add the library dependency to the INSTALL file. Your patch misses the required Makefile.am and configure.ac change. And what's your real name, by the way? We use real names for commits in our git repository. You're using git in a funny way. Why not clone our master repository, and create one commit for your plugin? This way, we could just pull your patch with one command. Max -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team