# Defold 1.4.0 BETA

**URL:** <https://forum.defold.com/t/defold-1-4-0-beta/71987>\
**Category:** Release notes\
**Created:** [November 1, 2022, 10:52am UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987 "2022-11-01T10:52:39Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [November 1, 2022, 10:52am UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/1 "2022-11-01T10:52:39Z")

</div>

# Defold 1.4.0 BETA

The latest beta is now released, and we invite those interested in beta testing the new features in the editor and engine to join now.

The beta period will be 2 weeks and the next planned stable release is two weeks from now.

Please report any engine issues in this thread or in [issues](https://github.com/defold/defold/issues) using Help → Report Issue

# ATTENTION: This release contains breaking changes!

Please pay extra attention to the release notes and the three breaking changes, as one or more of them may affect your projects. The breaking changes (listed in more detail further down) are:

- **BREAKING CHANGE** : ([#7081](https://github.com/defold/defold/pull/7081)) Added `physics.max_collision_object_count` field in `game.project`
- **BREAKING CHANGE** : ([#7095](https://github.com/defold/defold/pull/7095)) Use lua-cjson for both json.encode/json.decode. We’ve also removed the C++ `dmJson` namespace and `json.h`.
- **BREAKING CHANGE** : ([#6963](https://github.com/defold/defold/pull/6963)) Improved GUI clipping with layers
- **BREAKING CHANGE** : ([#7054](https://github.com/defold/defold/pull/7054)) Made dmObjectPool into a class, with new access function GetRawObjects()

## Disclaimer

This is a BETA release, and it might have issues that could potentially be disruptive for you and your teams workflow. Use with caution. Use of source control for your projects is strongly recommended.

## Access to the beta

Download the editor or bob.jar from [Releases · defold/defold · GitHub](https://github.com/defold/defold/releases?q=beta&expanded=true)

Set your build server to [https://build-stage.defold.com](https://build-stage.defold.com/)

# Release notes

## Summary

- **BREAKING CHANGE** : ([#7081](https://github.com/defold/defold/pull/7081)) Added `physics.max_collision_object_count` field in `game.project`
- **BREAKING CHANGE** : ([#7095](https://github.com/defold/defold/pull/7095)) Use lua-cjson for both json.encode/json.decode
- **BREAKING CHANGE** : ([#6963](https://github.com/defold/defold/pull/6963)) Improved GUI clipping with layers
- **NEW** : ([#7002](https://github.com/defold/defold/pull/7002)) Added option to pass additional headers to the build server
- **NEW** : ([#7036](https://github.com/defold/defold/pull/7036)) Option for bundling without resources to use as a build target.
- **FIX** : ([#7091](https://github.com/defold/defold/pull/7091)) Fix issue when bundling projects with models
- **FIX** : ([#7114](https://github.com/defold/defold/pull/7114)) Fix bug on iOS when profiler doesn’t show CPU and Memory usage
- **FIX** : ([#7064](https://github.com/defold/defold/pull/7064)) Remove partially cached HTTP response on timeout
- **FIX** : ([#7097](https://github.com/defold/defold/pull/7097)) Crash when using sound resource properties
- **FIX** : ([#7105](https://github.com/defold/defold/pull/7105)) Close application when stop debugging
- **FIX** : ([#7049](https://github.com/defold/defold/pull/7049)) Fix editor exception during build if a referenced collection overrides a resource script property
- **FIX** : ([#7100](https://github.com/defold/defold/pull/7100)) Fix atlas image deduplication
- **FIX** : ([#7027](https://github.com/defold/defold/pull/7027)) Make editor more resilient when opening files
- **FIX** : ([#7062](https://github.com/defold/defold/pull/7062)) Fix slow loading of sprite data in the editor
- **FIX** : ([#7074](https://github.com/defold/defold/pull/7074)) Copied collision 3d box doesn’t show properly in the editor
- **FIX** : ([#7044](https://github.com/defold/defold/pull/7044)) Updated to stb\_vorbis.c 1.22

## Engine

**BREAKING CHANGE** : ([#7081](https://github.com/defold/defold/pull/7081)) **Added `physics.max_collision_object_count` field in `game.project`**

> **Details**
>
> Added `physics.max_collision_object_count` field in `game.project` to set maximum count of collision objects per physics world. This prevents a crash which would happen in earlier versions when using more than 1024 collision objects in a physics world.
> 
> **IMPORTANT** : This is a breaking change. The default value for `physics.max_collision_object_count` is 128. Make sure you adjust the value to suit the needs of your project.
> 
> * * *

**BREAKING CHANGE** : ([#7095](https://github.com/defold/defold/pull/7095)) **Use lua-cjson for both json.encode/json.decode**

> **Details**
>
> The internal library used in Defold for json encoding and decoding is [lua-cjson](https://github.com/openresty/lua-cjson). The decoding performance improvement is about 10x faster than before (when using jsmn). With this change a number of changes have been introduced, one of which is considered a breaking change:
> 
> - BREAKING: The `dmJson` namespace and functionality has been removed from our C++ `dmSdk` due to its poor performance and lack of features.
> - NEW: Added the keyword `json.null` in order to support `null` values in a Lua table.
> - NEW: Added `dmScript::LuaToJson(lua_State* L, char** json, size_t* length)` as a new function in the C++`dmSdk`.
> 
> * * *

**BREAKING CHANGE** : ([#6963](https://github.com/defold/defold/pull/6963)) **Improved GUI clipping with layers**

> **Details**
>
> The behaviour regarding how clipping interacts with layers in GUI scenes has been modified. Instead of treating each clipping node as its own isolated node tree, where the layers only affect the child nodes, using layers can now change the ordering of the nodes freely.
> 
> * * *

**FIX** : ([#7091](https://github.com/defold/defold/pull/7091)) **Fix issue when bundling projects with models**

> **Details**
>
> Fixes an issue when bundling projects with model components.
> 
> * * *

**FIX** : ([#7114](https://github.com/defold/defold/pull/7114)) **Fix bug on iOS when profiler doesn’t show CPU and Memory usage**

> **Details**
>
> Fix a regression bug introduced in 1.3.7 when profiler doesn’t show CPU and Memory usage on iOS.
> 
> * * *

**FIX** : ([#7064](https://github.com/defold/defold/pull/7064)) **Remove partially cached HTTP response on timeout**

> **Details**
>
> This fixes an issue where a network request is interrupted due to a network error or timeout still left a partial response stored in the HTTP cache. Subsequent requests for the same resource would in such a case return the partial and most likely corrupted response stored in the cache. The cache will now remove any partial response on error.
> 
> * * *

**FIX** : ([#7097](https://github.com/defold/defold/pull/7097)) **Crash when using sound resource properties**

> **Details**
>
> Fix crash that happening when set a sound resource for a sound component that has playing sounds.
> 
> * * *

**FIX** : ([#7105](https://github.com/defold/defold/pull/7105)) **Close application when stop debugging**

> **Details**
>
> Fix issue introduced in 1.3.7 (regression) when Debugger stop button doesn’t close the application.
> 
> * * *

## Editor

**NEW** : ([#7002](https://github.com/defold/defold/pull/7002)) **Added option to pass additional headers to the build server**

> **Details**
>
> It is now possible to pass additional headers to the build server when building native extensions using command line tools and the editor. The editor has a new Build Server Headers field in the Extensions tab of the Preferences menu. The bob.jar command line tool has a new `--build-server-header` option.
> 
> In the editor headers are added line by line in a multi-line text text area. In bob.jar headers are added one by one using multiple `--build-server-header` options.
> 
> Example:
> 
> ```lua
> java -jar bob.jar `--build-server-header="x-my-header1: header1_value" --build-server-header="x-my-header2: My name is Bob"
> 
> ```
> 
> Will set two headers:
> 
> ```lua
> x-my-header1: header1_value
> x-my-header2: My name is Bob
> 
> ```
> 
> * * *

**NEW** : ([#7036](https://github.com/defold/defold/pull/7036)) **Option for bundling without resources to use as a build target.**

> **Details**
>
> New option for Bob `--exclude-archive` and a checkbox in the Bundle popup for bundling without resources. This bundle may be used as a build target.
> 
> * * *

**FIX** : ([#7049](https://github.com/defold/defold/pull/7049)) **Fix editor exception during build if a referenced collection overrides a resource script property**

> **Details**
>
> Fixed an editor exception during build if a referenced collection overrides a resource script property.
> 
> * * *

**FIX** : ([#7100](https://github.com/defold/defold/pull/7100)) **Fix atlas image deduplication**

> **Details**
>
> Atlases with duplicate images in different animations will no longer have the images duplicated in the atlas image.
> 
> * * *

**FIX** : ([#7027](https://github.com/defold/defold/pull/7027)) **Make editor more resilient when opening files**

> **Details**
>
> We used to save all recent files of all projects in a single user preference key. Since preference keys have a size limit, this is clearly a problem. This commit makes the editor use a different preference key per every project root, and also decreases the history limit just to be extra safe.
> 
> User-facing changes: Hopefully none 😅 . If no files in the editor could be opened before, they will now.
> 
> * * *

**FIX** : ([#7062](https://github.com/defold/defold/pull/7062)) **Fix slow loading of sprite data in the editor**

> **Details**
>
> Fixed slow project load times introduced by the addition of slice-9 support for sprites.
> 
> * * *

**FIX** : ([#7074](https://github.com/defold/defold/pull/7074)) **Copied collision 3d box doesn’t show properly in the editor**

> **Details**
>
> Collision objects are correctly copy-pasted in projects with 3D physics.
> 
> * * *

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [November 1, 2022, 9:35pm UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/2 "2022-11-01T21:35:59Z")

</div>



---

<div class="post-metadata">

**Author:** ![SkaterDad](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/skaterdad/32/41137_2.png) [@SkaterDad](https://forum.defold.com/u/SkaterDad)\
**Post date:** [November 2, 2022, 2:58am UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/3 "2022-11-02T02:58:51Z")

</div>

> [@britzl](#):
>
> New option for Bob `--exclude-archive` and a checkbox in the Bundle popup for bundling without resources. This bundle may be used as a build target.

Can someone explain the use for this? Sounds interesting, but not sure why.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [November 2, 2022, 7:02am UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/4 "2022-11-02T07:02:36Z")

</div>

> [@SkaterDad](#):
>
> Can someone explain the use for this? Sounds interesting, but not sure why.

When bundling the project with this option you get an application without resources but with native extensions. This is useful when you need an empty target application to hot-reload code and content to while developing and testing on device.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [November 2, 2022, 8:08am UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/5 "2022-11-02T08:08:32Z")

</div>

Edit:  
Added link to another dmSDK change regarding dmObjectPool that didn’t have a function for retrieving the internal objects.

---

<div class="post-metadata">

**Author:** ![Alex\_8BitSkull](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/alex_8bitskull/32/5424_2.png) [@Alex\_8BitSkull](https://forum.defold.com/u/Alex_8BitSkull)\
**Post date:** [November 2, 2022, 8:24am UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/6 "2022-11-02T08:24:54Z")

</div>

Does the JSON breaking change only affect extension developers, or us mere mortals too (i.e. users of json.decode()/json.encode())?

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [November 2, 2022, 8:27am UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/7 "2022-11-02T08:27:48Z")

</div>

> [@Alex\_8BitSkull](#):
>
> Does the JSON breaking change only affect extension developers, or us mere mortals too (i.e. users of json.decode()/json.encode())

The change primarily affects extension developers (ie users of the C++ API).

For the “mere mortals” using `json.decode()` there will be a noticeable performance increase when working with large json structures.

For `json.encode()` we added `json.null` so that you can encode a null value if needed.

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [November 2, 2022, 12:44pm UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/8 "2022-11-02T12:44:17Z")

</div>

Jstodef need update:) @AGulev

```lua
ERROR: jstodef/src/jstodef.cpp:81: 'use of undeclared identifier 'dmJson'
            dmJson::Document doc;'

ERROR: jstodef/src/jstodef.cpp:82: 'use of undeclared identifier 'dmJson'
            dmJson::Result r = dmJson::Parse(message, length, &doc);'

ERROR: jstodef/src/jstodef.cpp:82: 'use of undeclared identifier 'dmJson'
            dmJson::Result r = dmJson::Parse(message, length, &doc);'

ERROR: jstodef/src/jstodef.cpp:83: 'use of undeclared identifier 'dmJson'
            if (r == dmJson::RESULT_OK && doc.m_NodeCount > 0) {'

ERROR: jstodef/src/jstodef.cpp:93: 'use of undeclared identifier 'dmJson'
            dmJson::Free(&doc);'

ERROR: jstodef/src/jstodef.cpp:93: 'declaration of reference variable 'doc' requires an initializer
            dmJson::Free(&doc);'

```

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [November 2, 2022, 1:21pm UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/9 "2022-11-02T13:21:17Z")

</div>

> [@britzl](#):
>
> [https://build-stage.defold.com](https://build-stage.defold.com)

Yes, I know. Thank you.  
We are working on extensions update.

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [November 2, 2022, 1:24pm UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/10 "2022-11-02T13:24:51Z")

</div>

I have crash in windows build. But html build worked  
[\_crash.txt](https://forum.defold.com/uploads/short-url/obyiTUDyrXqjszKYefwHafWJb73.txt) (50.0 KB)

```lua
C:\Users\user\defold\3d-experiments\bob\releases\dev\windows\3d experiments dev>3dexperimentsdev.exe
INFO:DLIB: Log server started on port 53841
INFO:ENGINE: Target listening with name: LAPTOP-K0DFPU0P - fe80::1d3f:20c6:95fb:bc74 - Windows
INFO:ENGINE: Engine service started on port 8001
INFO:GRAPHICS: Initialised graphics device 'opengl'
INFO:ENGINE: Defold Engine 1.4.0 (1dbf756)
INFO:ENGINE: Loading data from: dmanif:game.dmanifest
INFO:xMath: Registered xmath Extension

Registered lua_script_instance Extension
INFO:LFS: Registered lfs Extension

Registered game Extension
INFO:ENGINE: Initialised sound device 'default'
DEBUG:SCRIPT: [WARN 16:23:37] LOCALIZATION: libs/common.lua:22: set locale:en
DEBUG:SCRIPT: [INFO 16:23:37] LOCALIZATION: assets/localization/localization.lua:39: system locale:ru
DEBUG:SCRIPT: [WARN 16:23:37] LOCALIZATION: libs/common.lua:22: set locale:ru
DEBUG:SCRIPT: [INFO 16:23:37] WORLD: world/world.lua:15: init
DEBUG:SCRIPT: [INFO 16:23:37] Storage: world/storage/storage.lua:92: load
DEBUG:SCRIPT: [INFO 16:23:37] Storage: world/storage/storage.lua:97: from file:
{"data":"{\"debug\":{\"draw_available_cells\":false,\"draw_frustum_box\":false,\"show_mobile_input\":false,\"draw_physics\":false,\"developer\":false,\"draw_debug_info\":false},\"options\":{\"music\":true,\"sound\":true},\"version\":11,\"game\":{}}","encrypted":false}
DEBUG:SCRIPT: [INFO 16:23:37] Storage: world/storage/storage.lua:128: data:
{"debug":{"draw_available_cells":false,"draw_frustum_box":false,"show_mobile_input":false,"draw_physics":false,"developer":false,"draw_debug_info":false},"options":{"music":true,"sound":true},"version":11,"game":{}}
DEBUG:SCRIPT: [INFO 16:23:37] Storage: world/storage/storage.lua:233: save
DEBUG:SCRIPT: [INFO 16:23:37] EVENT_BUS: libs/event_bus.lua:23: event:STORAGE_SAVED
DEBUG:SCRIPT: [INFO 16:23:37] Storage: world/storage/storage.lua:137: loaded
DEBUG:SCRIPT: [INFO 16:23:37] none: libs/rendercam_camera.lua:382: camera:game recalculate_viewport
DEBUG:SCRIPT: [INFO 16:23:37] none: libs/rendercam_camera.lua:382: camera:game recalculate_viewport
INFO:GRAPHICS: Transcoding: /assets/images/debug/debug.texturec from 21 to 6 (TEXTURE_FORMAT_RGBA_BC7 -> cTFBC7_RGBA)
DEBUG:SCRIPT: [INFO 16:23:37] INIT_CONTROLLER: init_controller.script:66: version:0.0.1
DEBUG:SCRIPT: [INFO 16:23:37] ContextManager: libs/contexts_manager.lua:59: Context register:MAIN
DEBUG:SCRIPT: [INFO 16:23:37] none: init_controller.script:99: init time:0.10093688964844
DEBUG:SCRIPT: [INFO 16:23:37] none: libs/sdk/sdk.lua:143: ads_commercial
DEBUG:SCRIPT: [INFO 16:23:37] ContextManager: libs/contexts_manager.lua:59: Context register:CURTAINS_GUI
WARNING:GAMESYS: Failed to set group gain (-13)
DEBUG:SCRIPT: [INFO 16:23:37] SCENE: libs/sm/scene_loader.lua:22: start load:[main:/game_scene#collectionproxy]
INFO:DLIB: SSDP: Started on address 10.3.172.140
INFO:DLIB: SSDP: Started on address 192.168.1.57
DEBUG:SCRIPT: [INFO 16:23:38] RESIZER: features/resizer/resizer.gui_script:54: change size to:16.0x9.0 960x540 scaled:1440x810
DEBUG:SCRIPT: [INFO 16:23:38] none: debug/view/scene_debug_view.lua:16: enable:false
DEBUG:SCRIPT: [INFO 16:23:38] Render: render/my.render_script:108: screen size changed. from w:1200 h:675 to w:1440 h:810
DEBUG:SCRIPT: [INFO 16:23:38] none: libs/rendercam_camera.lua:382: camera:game recalculate_viewport
DEBUG:SCRIPT: [INFO 16:23:38] EVENT_BUS: libs/event_bus.lua:23: event:WINDOW_RESIZED
DEBUG:SCRIPT: [INFO 16:23:38] SCENE: libs/sm/scene.lua:43: GameScene loaded
DEBUG:SCRIPT: [INFO 16:23:38] SCENE: libs/sm/scene.lua:44: GameScene load time 0.41580009460449
DEBUG:SCRIPT: [INFO 16:23:38] ContextManager: libs/contexts_manager.lua:59: Context register:GAME
DEBUG:SCRIPT: [INFO 16:23:38] ContextManager: libs/contexts_manager.lua:59: Context register:GAME_GUI
DEBUG:SCRIPT: [INFO 16:23:38] LEVELS: scenes/game/game_scene_controller.script:20: total level load:0.0069999694824219
DEBUG:SCRIPT: [INFO 16:23:38] none: world/game/levels/level_creator.lua:225: Location:CITY_1 load data time:0.017017364501953
DEBUG:SCRIPT: [INFO 16:23:38] SCENE: libs/sm/scene.lua:91: GameScene show
DEBUG:SCRIPT: [INFO 16:23:38] none: libs/sdk/sdk.lua:69: gameplay_start
DEBUG:SCRIPT: [INFO 16:23:38] SCENE: libs/sm/scene.lua:111: GameScene resumed
DEBUG:SCRIPT: [INFO 16:23:38] EVENT_BUS: libs/event_bus.lua:23: event:SCENE_CHANGED
Assertion failed: instance->m_FrameCount == mix_buffer_count, file ..\src\sound.cpp, line 1012
INFO:CRASH: Successfully wrote Crashdump to file: C:\Users\user\AppData\Roaming\Defold/_crash
ERROR:CRASH: CALL STACK:

ERROR:CRASH: 0 0x7FF616723CD0 dmCrash::GenerateCallstack D:\a\defold\defold\engine\crash\src\backtrace_win32.cpp:144

ERROR:CRASH: 1 0x7FF616A1CDD0 raise /tmp/job2753162768795877154/minkernel/crts/ucrt/src/appcrt/misc/signal.cpp:547

ERROR:CRASH: 2 0x7FF616A0FE4C abort /tmp/job2753162768795877154/minkernel/crts/ucrt/src/appcrt/startup/abort.cpp:71

ERROR:CRASH: 3 0x7FF616A0F098 common_assert_to_stderr<wchar_t> /tmp/job2753162768795877154/minkernel/crts/ucrt/src/appcrt/startup/assert.cpp:175

ERROR:CRASH: 4 0x7FF616A0EBBC _wassert /tmp/job2753162768795877154/minkernel/crts/ucrt/src/appcrt/startup/assert.cpp:443

ERROR:CRASH: 5 0x7FF616717690 dmSound::MixResampleIdentityStereo<short,0,1> D:\a\defold\defold\engine\sound\src\sound.cpp:1014

ERROR:CRASH: 6 0x7FF6167179E0 dmSound::Mix D:\a\defold\defold\engine\sound\src\sound.cpp:1109

ERROR:CRASH: 7 0x7FF616717D20 dmSound::MixInstance D:\a\defold\defold\engine\sound\src\sound.cpp:1237

ERROR:CRASH: 8 0x7FF616718190 dmSound::MixInstances D:\a\defold\defold\engine\sound\src\sound.cpp:1289

ERROR:CRASH: 9 0x7FF616714B20 dmSound::SoundThread D:\a\defold\defold\engine\sound\src\sound.cpp:1484

ERROR:CRASH: 10 0x7FFF13B57020 BaseThreadInitThunk <unknown>:0

ERROR:CRASH: 11 0x7FFF14542680 RtlUserThreadStart <unknown>:0

ERROR:CRASH:

```

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [November 2, 2022, 1:44pm UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/11 "2022-11-02T13:44:20Z")

</div>

Would it be possible to share the project with us?  
We updated our sound system to fix a crash, and it’s possible we messed something else up instead.

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [November 2, 2022, 1:47pm UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/12 "2022-11-02T13:47:52Z")

</div>

I make simple repro case.  
Problem with fade\_in for music.  
Crashed on different frames.

[win\_sound\_crash.zip](https://forum.defold.com/uploads/short-url/hluYyG6oLINeuPIbRV5YNPLf6sP.zip) (58.8 KB)

```lua
INFO:DLIB: Log server started on port 51804
INFO:ENGINE: Target listening with name: LAPTOP-K0DFPU0P - fe80::1d3f:20c6:95fb:bc74 - Windows
INFO:ENGINE: Engine service started on port 51805
INFO:GRAPHICS: Initialised graphics device 'opengl'
INFO:ENGINE: Defold Engine 1.4.0 (1dbf756)
INFO:DLIB: Initialized Remotery (ws://127.0.0.1:17815/rmt)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device 'default'
DEBUG:SCRIPT: 0
INFO:DLIB: SSDP: Started on address 10.3.172.140
INFO:DLIB: SSDP: Started on address 192.168.1.57
DEBUG:SCRIPT: 0
Assertion failed: instance->m_FrameCount == mix_buffer_count, file ..\src\sound.cpp, line 1012
DEBUG:SCRIPT: 0.017005000263453
DEBUG:SCRIPT: 0.034016000106931
DEBUG:SCRIPT: 0.051008000969887
DEBUG:SCRIPT: 0.071012001484632
DEBUG:SCRIPT: 0.085014001466334
DEBUG:SCRIPT: 0.10102200228721
DEBUG:SCRIPT: 0.11802500206977
DEBUG:SCRIPT: 0.13403000216931
DEBUG:SCRIPT: 0.1510620014742
DEBUG:SCRIPT: 0.16806300077587
INFO:CRASH: Successfully wrote Crashdump to file: C:\Users\user\AppData\Roaming\Defold/_crash
ERROR:CRASH: CALL STACK:

ERROR:CRASH: 0 0x7FF63A276BA0 dmCrash::GenerateCallstack D:\a\defold\defold\engine\crash\src\backtrace_win32.cpp:144

ERROR:CRASH: 1 0x7FF63A34E95C raise minkernel\crts\ucrt\src\appcrt\misc\signal.cpp:547

ERROR:CRASH: 2 0x7FF63A3370C4 abort minkernel\crts\ucrt\src\appcrt\startup\abort.cpp:71

ERROR:CRASH: 3 0x7FF63A2F42A0 common_assert_to_stderr<wchar_t> minkernel\crts\ucrt\src\appcrt\startup\assert.cpp:186

ERROR:CRASH: 4 0x7FF63A2F4A24 _wassert minkernel\crts\ucrt\src\appcrt\startup\assert.cpp:443

ERROR:CRASH: 5 0x7FF63A2B3850 dmSound::MixResampleIdentityStereo<short,0,1> D:\a\defold\defold\engine\sound\src\sound.cpp:1014

ERROR:CRASH: 6 0x7FF63A2B77C0 dmSound::Mix D:\a\defold\defold\engine\sound\src\sound.cpp:1109

ERROR:CRASH: 7 0x7FF63A2B7A90 dmSound::MixInstance D:\a\defold\defold\engine\sound\src\sound.cpp:1237

ERROR:CRASH: 8 0x7FF63A2B8020 dmSound::MixInstances D:\a\defold\defold\engine\sound\src\sound.cpp:1289

ERROR:CRASH: 9 0x7FF63A2B9530 dmSound::SoundThread D:\a\defold\defold\engine\sound\src\sound.cpp:1484

ERROR:CRASH: 10 0x7FFF13B57020 BaseThreadInitThunk <unknown>:0

ERROR:CRASH: 11 0x7FFF14542680 RtlUserThreadStart <unknown>:0

ERROR:CRASH: 

```

```lua
function init(self)
	...
	sound.play("/music#game")
	sound.set_gain("/music#game", 0)
	self.fade_in_time = 1
end

function update(self,dt)
	local a = 1 - self.fade_in_time / 1
	a = math.max(0,math.min(a,1)) --clamp
	pprint(a)
	sound.set_gain("/music#game", a)
	self.fade_in_time = self.fade_in_time - dt
end

```

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [November 2, 2022, 2:15pm UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/13 "2022-11-02T14:15:45Z")

</div>

Due to the changes to the dmJson api, we’ve released new versions of these extensions for use with the Defold 1.4.0+:

- [Release Updated to use dmScript::LuaToJson() · defold/extension-admob · GitHub](https://github.com/defold/extension-admob/releases/tag/3.0.0)
- [Release Build fix for js-web · defold/extension-facebook · GitHub](https://github.com/defold/extension-facebook/releases/tag/7.0.1)
- [Release Updated to use new Lua json decoder · defold/extension-gpgs · GitHub](https://github.com/defold/extension-gpgs/releases/tag/3.0.0)
- [Release Updated to use new Lua json decoder · defold/extension-iap · GitHub](https://github.com/defold/extension-iap/releases/tag/5.0.0)
- [Release Updated to support Defold 1.4.0 · defold/extension-push · GitHub](https://github.com/defold/extension-push/releases/tag/4.0.0)
- [Release Updated to support Defold 1.4.0 · defold/extension-webmonetization · GitHub](https://github.com/defold/extension-webmonetization/releases/tag/3.0.0)
- [Release Updated to use new Lua json decoder · AGulev/jstodef · GitHub](https://github.com/AGulev/jstodef/releases/tag/2.0.0)
- [Release Updated to use new Lua json decoder · AGulev/defold-extension-unity-ads · GitHub](https://github.com/AGulev/DefVideoAds/releases/tag/4.5.0)

If we’ve missed an extension please let us know!

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [November 2, 2022, 2:24pm UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/14 "2022-11-02T14:24:33Z")

</div>

Thanks!  
I can reproduce the issue.  
It seems related to the update to the latest ogg decoder, and I’m looking into it now.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [November 2, 2022, 4:47pm UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/15 "2022-11-02T16:47:25Z")

</div>

I now have a PR for the fix, and most likely the beta will be updated tomorrow with it:  
[https://github.com/defold/defold/pull/7119](https://github.com/defold/defold/pull/7119)

---

<div class="post-metadata">

**Author:** ![gianmichele](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gianmichele/32/24028_2.png) [@gianmichele](https://forum.defold.com/u/gianmichele)\
**Post date:** [November 2, 2022, 6:35pm UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/16 "2022-11-02T18:35:15Z")

</div>

TBH this is why I use Defold. The beta/feedback/fix loop at every new beta is fantastic!

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [November 2, 2022, 6:57pm UTC](https://forum.defold.com/t/defold-1-4-0-beta/71987/17 "2022-11-02T18:57:18Z")

</div>

We really appreciate this process as well. The feedback and help we get to test changes “in the wild” is invaluable!
