Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
BlueSkyLightProgrammer
Posts: 3
Registered: ‎11-13-2013
My Device: Blackberry Dev Alpha
Accepted Solution

Sound working on Dev Alpha, but not working on Z10

Hey there everyone! First of all, thanks for this forum, I've had some problems on the past and I've found out the some solutions here. Well, this time I coudn't find any, so I'm making my own post!

Well, me and my team we're having a problem. Our app has several sounds on it. We're doing it with HTML5/JS/CSS3/Phonegap. The sound works fine on my PC when it should play and it also works on our Dev Alpha's. We have a Z10 to test the app later on a final device in order to be certain if the app works fine. But when we put it on the Z10, wow!!! The sound doesn't work and worse, there's a high chance that the app stops working, it gets frozen. Once it even restarted the Z10!!!

So, does anyone have a clue? We're not using libs like jQuery. And also, I have another doubt. How could I make the screen not to resize when the background is double clicked and how to lock the screen in order to don't allow the user to change vertical view to horizontal view, I want to lock it to vertical view only.

Thanks in advance!

BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: Sound working on Dev Alpha, but not working on Z10

[ Edited ]

Audio Rendering

 

Regarding the audio, this likely has to do with the audio channel limits of OMAP (Dev Alpha B, Z10 STL100-1) and Qualcomm (Z10 STL100-2/3/4). Very likely, the Z10 you are testing on is STL100-3 which is the Qualcomm set.

For OMAP hardware, there are 64 multimedia rendering contexts available, which is a fair amount.

 

For Qualcomm (and this is a limitation for any device leveraging this hardware) there are 6 audio streams available device-wide. Anytime you preload/play a new audio file, this takes up an additional audio stream. You can see how this could cause issues quickly.

 

Crashing/resetting is a pretty drastic effect though, and I would log a JIRA issue against it because, at the worst, I would expect the audio not to play; not crash the device.

The current workaround would be to use an OpenAL extension, which we currently have one available as a Cordova plugin:
http://devblog.blackberry.com/2013/07/pglowlatencyaudio-port-for-blackberry-10/

 

If you don't want to use Cordova and direct WebWorks, you would need to explore your own custom extension. OpenAL circumvents the mm-renderer layer, and isn't held up by the same limitations.

 

Unfortunately, the performance hit and side effects of mixing too many simultaneous sounds on the Qualcomm chipset is rather drastic. Being a hardware issue, the problem becomes quite complex, but our teams are working to improve this; I just don't have a timeline on this yet.

 

 

Screen Resizing

 

To prevent this, there are two options. The first is to assign a <meta> viewport where you lock the initial-scale, minimum-scale, and maximum-scale values. Along the lines of:

 

<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">

 

It's also a good idea to wrap your content inside of a <div> container. Example:

 

<!DOCTYPE html>
<html>
    <head>
        ...
    </head>
    <body>
        <div id="container">
            ...
        </div>
    </body>
</html>

 

And use some styling on that container to ensure the contents do not exceed the screen dimensions. Example:

 

...
<head>
    ...
    <style type="text/css">
        html, body, #container {
            border: 0xp; margin: 0px; padding: 0px;
        }

        #container {
            position: fixed;
            left: 0px; right: 0px; top: 0px; bottom: 0px;
            overflow: SET AS REQUIRED;
        }
    </style>
</head>
...

 

The second option is to leverage touch-event-mode which should in theory disable the zooming:

http://developer.blackberry.com/html5/documentation/touch-event-mode.html

 

However, this was brough up recently and appears to be broken. A JIRA was recommended for this issue.

 

 

Locking Orientation

 

This can be done in the config.xml through the blackberry.app <feature> and specifying the appropriate <param> element:

http://developer.blackberry.com/html5/documentation/param_element.html


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
New Contributor
BlueSkyLightProgrammer
Posts: 3
Registered: ‎11-13-2013
My Device: Blackberry Dev Alpha

Re: Sound working on Dev Alpha, but not working on Z10

Hi there man! Thanks a lot for answering, it was very enlightening. I'll try to implement the solution above and then I'll come back here to say if it was successful or not.

Can I intend for this situation and ask one more question? How can I make the screen not to turn off? Example: the app is open, but the device is not being used for awhile and then, because of that, the screen gets dark and the device is kind of "logged off" or "hibernating" or "blocked", and you might have to put your password to unlock the device. How can I put the app to stay tunned/open all the time? Even without a person interaction?

Thanks again in advance!

BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: Sound working on Dev Alpha, but not working on Z10

To prevent dimming, you can leverage the PreventSleep community API here:

https://github.com/blackberry/WebWorks-Community-APIs/tree/master/BB10/PreventSleep


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
New Contributor
BlueSkyLightProgrammer
Posts: 3
Registered: ‎11-13-2013
My Device: Blackberry Dev Alpha

Re: Sound working on Dev Alpha, but not working on Z10

oros, thanks a lot man for all your help! I still need to try to implement all these solutions. Working or not, I'll come back to say the feedback. If it works, I'll soon press "Accept as Solution", ok?? Thank you!

BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: Sound working on Dev Alpha, but not working on Z10

Sounds good. Just jet us know if you hit any issues, it's what we're here for :-)


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.