QCP playback crashing Audiovox 8900 | developer.brewmp.com QCP playback crashing Audiovox 8900 | developer.brewmp.com

Developer

QCP playback crashing Audiovox 8900

Forums:

Hi all,

My sound playing module is working fine on the emulator and on every handset I've tried other than the Audiovox 8900 and Hyundai Tx95c (8900 clone)

I'm currently loading a QCP file into a buffer in memory and playing using standard soundplayer code:

AEESoundPlayerInfo spInfo;

spInfo.dwSize = size;
spInfo.pData = pData;
spInfo.eInput = SDT_BUFFER;
ISOUNDPLAYER_SetInfo(m_pISoundPlayer, &spInfo);
ISOUNDPLAYER_Play(m_pISoundPlayer);

On the 8900 it crashes the handset. I also tried playing from a stream using IMemAStream but with the same result - fine on everything except the 8900.

However, if I play the QCP from file it plays fine!

I have two questions:

1. Has anyone else experienced this on the 8900 and, if so, is there a workaround or something I'm doing wrong?
2. Would converting/wrapping the QCP to/in CMX and using IMediaPlayer make a difference and, if so, are there any free CMX authoring tools available? [I've emailed eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%63%6d%78%2e%2e%2e%40%71%75%61%6c%63%6f%6d%6d%2e%63%6f%6d%22%3e%63%6d%78%2e%2e%2e%40%71%75%61%6c%63%6f%6d%6d%2e%63%6f%6d%3c%2f%61%3e%27%29%3b')) as mentioned in the CMX FAQ and am awaiting a reply]

This is my last hurdle before I finally have a single app that runs on all my target handsets, so any help in this matter would be hugely appreciated.

Cheers,

Matt

Wrapping QCELP into CMX is the best way to play it for several reasons. Some phones (like VX6000) are only capable of playing QCELP via earpiece, so the only way to make sure QCELP is played via speaker is CMX.
The only disadvantage is that CMX supports only full-rate QCELP.
Conversion is very easy. I have created a few CMX files with embedded QCP using CMX studion and figured out the format of such file, and now I am doing conversion on the phone.
Btw, on what handsets have you managed to play QCP? Did it play via speaker or earpiece?
Zim

Wrapping QCELP into CMX is the best way to play it for several reasons. Some phones (like VX6000) are only capable of playing QCELP via earpiece, so the only way to make sure QCELP is played via speaker is CMX.
The only disadvantage is that CMX supports only full-rate QCELP.
Conversion is very easy. I have created a few CMX files with embedded QCP using CMX studion and figured out the format of such file, and now I am doing conversion on the phone.
Btw, on what handsets have you managed to play QCP? Did it play via speaker or earpiece?
Zim

Thanks for the reply, Zim.
I managed to find what was causing the crash. The size of the buffer I MALLOC to hold the QCP file has to be 4-byte aligned on the 8900. I.e. when loading a 630 byte QCP file, it will crash if I malloc 630 bytes when I play SoundPlayer. However, allocating 632 bytes works fine.
I've so far tested QCP playback on the following handsets, all of which played through the speaker:
Kyocera KZ850
Kyocera KZ820
Curitel CX839
Curitel CX850
Audiovox 8900 (and Hyundai TX95c, an 8900 clone)
LG8280
Samsung X609
I'll be moving onto Verizon handsets soon, including the VX6000, so I daresay I'll
need to start using a CMX wrapper then.
Is CMX Studio free to registered Brew developers? I've still not heard back from Qualcomm regarding a CMX authoring tool.
If you could provide some information, or a link to some information, on the CMX format it would be greatly appreciated. I've heard it's fairly simple but at the moment have no method of converting my QCPs to CMX so that I can work it out.
Cheers,
Matt

Thanks for the reply, Zim.
I managed to find what was causing the crash. The size of the buffer I MALLOC to hold the QCP file has to be 4-byte aligned on the 8900. I.e. when loading a 630 byte QCP file, it will crash if I malloc 630 bytes when I play SoundPlayer. However, allocating 632 bytes works fine.
I've so far tested QCP playback on the following handsets, all of which played through the speaker:
Kyocera KZ850
Kyocera KZ820
Curitel CX839
Curitel CX850
Audiovox 8900 (and Hyundai TX95c, an 8900 clone)
LG8280
Samsung X609
I'll be moving onto Verizon handsets soon, including the VX6000, so I daresay I'll
need to start using a CMX wrapper then.
Is CMX Studio free to registered Brew developers? I've still not heard back from Qualcomm regarding a CMX authoring tool.
If you could provide some information, or a link to some information, on the CMX format it would be greatly appreciated. I've heard it's fairly simple but at the moment have no method of converting my QCPs to CMX so that I can work it out.
Cheers,
Matt

Disregard that last reply. I'm confused. The QCP playback crash now seems only to be happening when a midi has been played from file prior to playing the QCP. The malloc'd size now seems fine whether or not it is a multiple of 4.
This is really odd because last week I'm SURE that the size of the malloc'd buffer was causing it to crash or fail, and the app i was testing wasn't touching midi files.
If i manage to figure out what the hell's going on I'll post again... :p

Disregard that last reply. I'm confused. The QCP playback crash now seems only to be happening when a midi has been played from file prior to playing the QCP. The malloc'd size now seems fine whether or not it is a multiple of 4.
This is really odd because last week I'm SURE that the size of the malloc'd buffer was causing it to crash or fail, and the app i was testing wasn't touching midi files.
If i manage to figure out what the hell's going on I'll post again... :p

Well everything is working now and it appears to be playing a midi from file that causes the problems. It seems to leave the soundplayer in a weird state. Still not sure why the 4-byte aligned malloc was working though.

Well everything is working now and it appears to be playing a midi from file that causes the problems. It seems to leave the soundplayer in a weird state. Still not sure why the 4-byte aligned malloc was working though.