I'm finalizing a game for the Kindle Fire. The graphics are working fine (fantastic performance, in fact!), but I'm having some issues with audio.
Per this thread:
http://www.glbasic.com/forum/index.php?topic=7359.msg61486#msg61486
Quote from: AlienMenace on 2011-Dec-16
I think it may still be a sound buffer issue. The sounds are choppy and seem to cause a bit of a program delay when too many are played at once.
Quote from: Kitty Hello on 2011-Dec-16
what sample format are you loading? Try 44KHz, 16 bit (mono/stereo).
I think I'm seeing the exact same sound issue: sounds sometimes play choppy, other times they lag by about 1/2 to 1 second behind where they should be. I'm using 44.1KHz 16 bit stereo Windows *.wav files.
In addition, I can't get my *.mp3 files to play at all:
PLAYMUSIC "Media/music.mp3", TRUE
The file is 44.1KHz, stereo, 128kbps. The music plays fine when I compile for Windows; it just doesn't play on the Kindle.
Has anyone discovered a workaround for either of these audio issues?
For WAV - can you try 22050 Hz, 16bit, mono/stereo files?
sounds like a bit rate problem to me.
I tried to look around for a more specific sound spec on this device but no luck.
44KHz or 48KHz, 16 bit mono or stereo should do fine.
I´m not sure about the 128kbps, so try 256 or 64.
You may want to search the net for exactly what is a more native bit rate for this device.
Newer devices are all about processors ou gfx chips, it has been a while people don´t talk about what sound capabilities it can cope with other then formats.
Mp3 is a problem format for Android generally in apps, so you should try to use ogg files for music. Its dont play on Sony Expira Play as well. I mind still have issue, but its simply because I have not got feedback from friend as well. but ogg should been the way.
For sfx I use 22khz mono samples and only use few channels (actuelly no more 2 channels is played sametime). Dont try to play 30 channels or such, which might cause issues with some devices. Hold them in few channels as possible.
As I mentioned in other threads some weeks back, there are serious Kindle Fire issues...
Sprite collisions locks up Fire, same issue that was present on the iPad before it was fixed. Crash is to the point that it requires a hard-reset to regain control of device.
See attached example code.
Sounds are delayed and choppy and it seems only 1 or 2 will play at a time.
Changed all samples to mono 22K, made no difference.
I have a control panel graphic that displays at 0,0. Every once in a while the program executes and it places the graphic origin correctly in the upper left corner of the screen where 0,0 is suppose to be.. at other times, 0,0 is pushed up offscreen. It is looks to me as though the Fire's mandatory menu bar at the bottom is screwing up the display screen somehow. Sometimes, GLB plays nice with it and everything is fine but at other times, it lets the menu bar push everything up off the screen.
Related I think to the previous issue is the touch coordinates are not always correctly reported. All these issues are related to the Y-axis, the X-axis is fine. It seems to be related to the screen offset issue mentioned above.
Would be great to see these things fixed...
[attachment deleted by admin]
Quote from: Kitty Hello on 2012-Jan-02
For WAV - can you try 22050 Hz, 16bit, mono/stereo files?
I converted my WAV files all the way down to 16 kHz 8bit mono, and they're still lagging by about 1 second. :( For the record, I'm mainly playing only a single sound at a time, and the lag is still entirely there.
Quote from: spacefractal on 2012-Jan-02
Mp3 is a problem format for Android generally in apps, so you should try to use ogg files for music. Its dont play on Sony Expira Play as well. I mind still have issue, but its simply because I have not got feedback from friend as well. but ogg should been the way.
Thanks, Spacefractal! You were right, it seems to be the MP3. I had tried converting it to different rates, but it just would not play. I finally used an uncompressed WAV file (22kHz 16-bit) as a test, and it worked! ...although it made my APK file almost 40mb. I don't currently have a way to create OGG files, but I'll definitely look into that!
Quote from: AlienMenace on 2012-Jan-02
As I mentioned in other threads some weeks back, there are serious Kindle Fire issues...
Sprite collisions locks up Fire, same issue that was present on the iPad before it was fixed. Crash is to the point that it requires a hard-reset to regain control of device.
See attached example code.
Sounds are delayed and choppy and it seems only 1 or 2 will play at a time.
Changed all samples to mono 22K, made no difference.
I have a control panel graphic that displays at 0,0. Every once in a while the program executes and it places the graphic origin correctly in the upper left corner of the screen where 0,0 is suppose to be.. at other times, 0,0 is pushed up offscreen. It is looks to me as though the Fire's mandatory menu bar at the bottom is screwing up the display screen somehow. Sometimes, GLB plays nice with it and everything is fine but at other times, it lets the menu bar push everything up off the screen.
Related I think to the previous issue is the touch coordinates are not always correctly reported. All these issues are related to the Y-axis, the X-axis is fine. It seems to be related to the screen offset issue mentioned above.
Would be great to see these things fixed...
I don't use sprite collisions, so I can't speak to that. But I have encountered the Y-axis offset you mentioned. I also think I identified what seemed to cause it in my case, at least most of the time.
I used to test my app by creating my APK, copying it to the Kindle, and using a 3rd-party app (ES File Explorer) to install it. I would then launch it immediately after it finished the install. I noticed that these first-launches were the times I would primarily see the Y-axis offset.
So what I do now is finish installing it, exit the installer without launching, quit ES File Explorer, and then launch it from the icon on the Kindle's home page. Since doing this, I've launched my app numerous times, and so far I have not encountered the Y-axis offset issue again (knocking heavily on wood). Once it's in the Amazon store, users will probably only launch it from the home page, so I'm hoping it won't be an issue.
I suppose I'll find out for sure once it's in the store... :|
try wav with the adpcm compression.
other then that, 11khz 8bit mono should be enough for sound fx,
specially coming out of small speakers.
ogg or the acc could help out on quality and size.
Adpcm is not supported. Look like driver issues as well it's not follow android standard, which can been annoying. I guess it's can only been fixed when kitty have one to test?
Quote from: erico on 2012-Jan-02
try wav with the adpcm compression.
other then that, 11khz 8bit mono should be enough for sound fx,
specially coming out of small speakers.
ogg or the acc could help out on quality and size.
Yes, I also can confirm that ADPCM is a no-go on the Kindle. Also, 11kHz 8bit mono might sound okay coming from the speaker, but it sounds terrible when using headphones. But it seems to be moot anyway, because the bitrate of the audio files doesn't seem to impact the 1/2 to 1 second lag issue.
However, OGG works great for music! I used open source Audacity to convert it.
For now, I'll probably remove all sound effects from my game, keep the background music in, and put it in the store as a 1.0 release. But it would be great to get synced sound effects down the road... :)
Quote from: BasicMe on 2012-Jan-02
I don't use sprite collisions, so I can't speak to that. But I have encountered the Y-axis offset you mentioned. I also think I identified what seemed to cause it in my case, at least most of the time.
I used to test my app by creating my APK, copying it to the Kindle, and using a 3rd-party app (ES File Explorer) to install it. I would then launch it immediately after it finished the install. I noticed that these first-launches were the times I would primarily see the Y-axis offset.
So what I do now is finish installing it, exit the installer without launching, quit ES File Explorer, and then launch it from the icon on the Kindle's home page. Since doing this, I've launched my app numerous times, and so far I have not encountered the Y-axis offset issue again (knocking heavily on wood). Once it's in the Amazon store, users will probably only launch it from the home page, so I'm hoping it won't be an issue.
I suppose I'll find out for sure once it's in the store... :|
I am just installing directly from GLB, running the app from the home screen. The first time after install it seems to orientate on the y-axis okay but subsequent runs are all screwed up. Weird.
Quote from: AlienMenace on 2012-Jan-03
I am just installing directly from GLB, running the app from the home screen. The first time after install it seems to orientate on the y-axis okay but subsequent runs are all screwed up. Weird.
Hmm...I never install directly from GLB. I'd be curious if you still get the same issue installing the APK manually.
Don't try 11khz, but really 22050 Hz samples. I "think" SDL will have to convert the samples when running otherwise and that might choke the cpu.
It's should not been that much anyway. If 200mhz old pentium could play an 32 channels xm module nice, then kindle fire should could handle it as least for one channel. So its could been buffer, mixer or even sld driver issue or a known issue?
however my game don't support it because it's us only anyway (and no android market), so I can't test it.
I think SDL has to inject Java code for the sound mixer, so there's a huge overhead. It's a known Android problem.
Sound works fine on the Sony and Samsung I tested. For me it's sound a buffer issue? If its mix and play fine without cutting, but only lags, then nothing with mixer itself. Do you use newest version of sdl? Or do we need openal for sound?
Also those devices require various set of buffer length? Can you set mixer sample rate? That could been why it's could been cool to detect kind of device it is (I do the same in ios to set graphics as well frame rate setting). On android I let user set graphics detail manually.
try disabling some services in the background.
This is a solution?
Yes, I heard that some background tasks take too much CPU power.
Gernot,
My Kindle is running stock, same background tasks as anybody else who is going to buy it. The display runs well, I would think if background tasks were at fault then we would surely see it affect more than just sound effects being played. For what it's worth, I don't think the update where you increased the sound buffer sized fixed this issue on other Android tablets either as the sound is still is not quite right on my other tablets. Do you have any ideas on the other issues? Obviously sprite collisions crashing the tablet are a terminal issue for any type of action game. The screen/mouse co-ords not reporting correctly are also a pretty big deal.
Thanks.
I gonna ask, which framerate do you using?
I think those sound issues might happens if the game have been lagged somewhere, and then sound buffer might got full instead. etc LIMITFPS actulley just slow down if there going too much, and hence you would hear those sound issues.
That is one the reason I choiced to "only" run 25fps for Android to prevent slowdowns, which is still nice for the kind of gametype I doing. Here I have not heard any sound issues. So my guess mightbeen the SOUNDBUFFER quicky got full due slowdowns and hence those stutters and delays?
Wondering if any of these issues are going to be addressed any time soon?
Thanks.
don't use sprcoll for an action game. Usually Boxcoll is totally enough. SPRCOLL costs a lot of CPU time.
So I take it you don't intend to fix the sprite collision bug? Any hope for the other issues being fixed?
I have to check why this happens. I hope I can reproduce it.
I think
Quote from: AlienMenace on 2012-Jan-09
So I take it you don't intend to fix the sprite collision bug? Any hope for the other issues being fixed?
The Kindle Fire offers a potential new app market, so I think it would be great to get GLBasic working with it as well as possible. We all benefit from trying to help each other, so, have you asked if Gernot even has a Kindle Fire for testing? If you have asked and he is lacking, have you offered to lend yours so he could see what the issues are? Such things might help.
Quote from: Wampus on 2012-Jan-10
The Kindle Fire offers a potential new app market, so I think it would be great to get GLBasic working with it as well as possible.
Yeah, ya think? Some of us have games ready to be released but are having to sit on them due to these serious issues.
I first reported the sound and screen issues almost 2 months ago. I would really like to get my game out someday. :)
Gernot, do you have a Kindle Fire?
Should be able to help with troubleshooting myself soon. Will have a Kindle Fire one in about...a fortnight at most. I'm in Canada so acquiring one requires multiple steps. One does not simply order a Kindle Fire.
...as for a market, it seems it only accepts EUA and only sells there.
Is it still that way?
AFAIK The Kindle Fire won't let you download music, video, movies or apps outside the US, so the market is a bit limited for now. However, I've been told by someone from the Amazon Appstore Account team that you can definitely upload your apps for distribution. If you're looking at paid apps then the amount you need to sell has to be $100 after taxes before a check is sent out for international devs.
Thanks for clarifying Wampus, so I guess that counts as an extra store too.
I will be checking a list of them as soon as game is done.
Maybe then I post a list of stores we can sell things on another thread.