Skip to content

Commit f45ad1d

Browse files
Merge branch 'master' into hdr_fixes
2 parents 7ed926f + a458d7e commit f45ad1d

116 files changed

Lines changed: 6833 additions & 2895 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/webOS.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ jobs:
2525
uses: actions/checkout@v4
2626

2727
- name: Download ares-cli-rs
28-
uses: robinraju/release-downloader@v1.11
28+
uses: robinraju/release-downloader@v1
2929
with:
3030
repository: "webosbrew/ares-cli-rs"
3131
latest: true
3232
fileName: "ares-package_*.deb"
3333
out-file-path: "temp"
3434

3535
- name: Download Manifest Generator
36-
uses: robinraju/release-downloader@v1.9
36+
uses: robinraju/release-downloader@v1
3737
with:
3838
repository: "webosbrew/dev-toolbox-cli"
3939
latest: true
@@ -47,7 +47,7 @@ jobs:
4747
run: sudo apt-get -yq install ./temp/*.deb
4848

4949
- name: Download webOS NDK
50-
uses: robinraju/release-downloader@v1.11
50+
uses: robinraju/release-downloader@v1
5151
with:
5252
repository: "openlgtv/buildroot-nc4"
5353
latest: true
@@ -68,38 +68,40 @@ jobs:
6868
RARCH_VERSION=$(grep -Po '(?<=#define PACKAGE_VERSION ")[^"]+' version.all)
6969
echo "RARCH_VERSION=$RARCH_VERSION" >> "$GITHUB_ENV"
7070
71-
- name: Compile RA (GLES3 and Wayland variant)
71+
- name: Compile RA (GLES2, no wayland legacy variant)
7272
shell: bash
7373
run: |
7474
. /tmp/arm-webos-linux-gnueabi_sdk-buildroot/environment-setup
7575
export SDK_PATH=/tmp/arm-webos-linux-gnueabi_sdk-buildroot
7676
make -f Makefile.webos clean
77-
bash gfx/common/wayland/generate_wayland_protos.sh
7877
make -f Makefile.webos ipk PACKAGE_NAME=${PACKAGE_NAME} ADD_SDL2_LIB=1 \
79-
HAVE_XKBCOMMON=1 HAVE_USERLAND=1 HAVE_EGL=1 HAVE_WAYLAND=1 \
80-
HAVE_OPENGLES3=1 HAVE_OPENGLES3_1=1 HAVE_OPENGLES3_2=1 -j"$(getconf _NPROCESSORS_ONLN)"
78+
-j"$(getconf _NPROCESSORS_ONLN)"
8179
mv webos/com.retroarch.webos_${RARCH_VERSION}_arm.ipk \
82-
webos/com.retroarch.webos.gles3w_${RARCH_VERSION}_arm.ipk
80+
webos/com.retroarch.webos-legacy-gles2-no-wayland_${RARCH_VERSION}_arm.ipk
8381
env:
8482
DEBUG: ${{ github.event_name == 'release' && '0' || '1' }}
8583

86-
- name: Upload GLES3 and Wayland artifact
87-
uses: actions/upload-artifact@v4
84+
- name: Upload GLES2 artifact
85+
uses: actions/upload-artifact@v6
8886
with:
89-
name: com.retroarch.webos.gles3w_${{ env.RARCH_VERSION }}_${{ github.sha }}_arm.ipk
90-
path: webos/com.retroarch.webos.gles3w_${{ env.RARCH_VERSION }}_arm.ipk
87+
name: com.retroarch.webos-legacy-gles2-no-wayland_${{ env.RARCH_VERSION }}_${{ github.sha }}_arm.ipk
88+
path: webos/com.retroarch.webos-legacy-gles2-no-wayland_${{ env.RARCH_VERSION }}_arm.ipk
9189

9290
- name: Compile RA (default)
9391
shell: bash
9492
run: |
9593
. /tmp/arm-webos-linux-gnueabi_sdk-buildroot/environment-setup
94+
export SDK_PATH=/tmp/arm-webos-linux-gnueabi_sdk-buildroot
9695
make -f Makefile.webos clean
97-
make -f Makefile.webos ipk PACKAGE_NAME=${PACKAGE_NAME} ADD_SDL2_LIB=1 -j"$(getconf _NPROCESSORS_ONLN)"
96+
bash gfx/common/wayland/generate_wayland_protos.sh
97+
make -f Makefile.webos ipk PACKAGE_NAME=${PACKAGE_NAME} ADD_SDL2_LIB=1 \
98+
HAVE_XKBCOMMON=1 HAVE_USERLAND=1 HAVE_EGL=1 HAVE_WAYLAND=1 \
99+
HAVE_OPENGLES3=1 HAVE_OPENGLES3_1=1 HAVE_OPENGLES3_2=1 -j"$(getconf _NPROCESSORS_ONLN)"
98100
env:
99101
DEBUG: ${{ github.event_name == 'release' && '0' || '1' }}
100102

101103
- name: Upload default artifact
102-
uses: actions/upload-artifact@v4
104+
uses: actions/upload-artifact@v6
103105
with:
104106
name: com.retroarch.webos_${{ env.RARCH_VERSION }}_${{ github.sha }}_arm.ipk
105107
path: webos/com.retroarch.webos_${{ env.RARCH_VERSION }}_arm.ipk
@@ -125,5 +127,5 @@ jobs:
125127
omitPrereleaseDuringUpdate: true
126128
artifacts: |
127129
webos/com.retroarch.webos_${{ env.RARCH_VERSION }}_arm.ipk
128-
webos/com.retroarch.webos.gles3w_${{ env.RARCH_VERSION }}_arm.ipk
130+
webos/com.retroarch.webos-legacy-gles2-no-wayland_${{ env.RARCH_VERSION }}_arm.ipk
129131
webos/${{ env.PACKAGE_NAME }}.manifest.json

Makefile.common

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,10 @@ ifeq ($(HAVE_WAYLAND), 1)
13071307
DEF_FLAGS += $(LIBDECOR_CFLAGS)
13081308
endif
13091309

1310+
ifeq ($(HAVE_WAYLAND_BACKPORT),1)
1311+
DEFINES += -DHAVE_WAYLAND_BACKPORT=1
1312+
OBJ += gfx/common/wayland_common_backport.o
1313+
endif
13101314
endif
13111315

13121316
# XML

Makefile.webos

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ HAVE_USERLAND ?= 0
136136
HAVE_WEBOS_EXTRA_PROTOS ?= 0
137137
HAVE_CORE_INFO_CACHE = 1
138138
HAVE_WAYLAND ?= 0
139+
HAVE_WAYLAND_BACKPORT ?= 1
139140

140141
OS = Linux
141142
TARGET = retroarch
@@ -325,9 +326,13 @@ clean:
325326

326327
sdl2: $(TARGET)
327328
ifeq ($(ADD_SDL2_LIB), 1)
328-
@echo "Downloading SDL2 prebuilt"
329-
mkdir -p SDL
330-
wget -qO - $(SDL2_PREBUILT_ARCHIVE) | tar -C SDL -zxvf -
329+
@if [ ! -f SDL/lib/libSDL2-2.0.so.0 ]; then \
330+
echo "Downloading SDL2 prebuilt"; \
331+
mkdir -p SDL; \
332+
wget -qO - $(SDL2_PREBUILT_ARCHIVE) | tar -C SDL -zxvf -; \
333+
else \
334+
echo "SDL2 prebuilt already exists, skipping download"; \
335+
fi
331336
endif
332337

333338
ipk: prebuild $(TARGET) sdl2
@@ -336,6 +341,9 @@ ipk: prebuild $(TARGET) sdl2
336341
echo "$$APPINFO" > webos/dist/appinfo.json
337342
cp -t webos/dist -vf $(TARGET) webos/icon160.png
338343
cp -t webos/dist/lib -vf $(WEBOS_USR_LIB_DIR)/libstdc++.so.6
344+
ifeq ($(HAVE_XKBCOMMON), 1)
345+
cp -t webos/dist/lib -vf $(WEBOS_USR_LIB_DIR)/libxkbcommon.so.0
346+
endif
339347
cp -t webos/dist/lib -vf $(WEBOS_LIB_DIR)/libatomic.so.1
340348
ifeq ($(ADD_SDL2_LIB), 1)
341349
cp -t webos/dist/lib -vf SDL/lib/libSDL2-2.0.so.0

audio/drivers/coreaudio.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ typedef struct coreaudio
7272
/* Temporary buffer for converter output */
7373
float *conv_buffer;
7474
size_t conv_buffer_frames;
75+
bool converter_needs_reset;
7576

7677
bool dev_alive;
7778
bool is_paused;
@@ -202,6 +203,7 @@ static bool coreaudio_update_converter(coreaudio_t *dev, double effective_input_
202203
}
203204

204205
dev->current_ratio = effective_input_rate;
206+
dev->converter_needs_reset = false;
205207

206208
/* Set high quality resampling */
207209
UInt32 quality = kAudioConverterQuality_High;
@@ -617,10 +619,6 @@ static ssize_t coreaudio_write_raw(void *data, const int16_t *samples,
617619
if (!coreaudio_update_converter(dev, effective_rate))
618620
return -1;
619621

620-
/* Reset converter state to clear any "end of stream" condition
621-
* from the previous write_raw call */
622-
AudioConverterReset(dev->converter);
623-
624622
/* Set up callback context */
625623
ctx.data = samples;
626624
ctx.frames_left = frames;
@@ -645,8 +643,20 @@ static ssize_t coreaudio_write_raw(void *data, const int16_t *samples,
645643
break;
646644
}
647645

646+
/* If converter returned 0 output while we have input, it may be stuck
647+
* in "end of stream" state (tvOS 13/14 issue). Reset and retry once. */
648648
if (output_frames == 0)
649+
{
650+
if (ctx.frames_left > 0 && !dev->converter_needs_reset)
651+
{
652+
AudioConverterReset(dev->converter);
653+
dev->converter_needs_reset = true;
654+
continue;
655+
}
649656
break;
657+
}
658+
659+
dev->converter_needs_reset = false;
650660

651661
/* Apply volume to converted samples */
652662
if (volume != 1.0f)

audio/drivers/coreaudio3.m

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ @interface CoreAudio3 : NSObject {
184184
double _lastRateAdjust;
185185
float *_convBuffer;
186186
size_t _convBufferFrames;
187+
BOOL _converterNeedsReset;
187188
}
188189

189190
@property (nonatomic, readwrite) BOOL nonBlock;
@@ -221,6 +222,7 @@ - (instancetype)initWithRate:(NSUInteger)rate
221222
_lastInputRate = 0;
222223
_lastRateAdjust = 1.0;
223224
_interleaved = NO;
225+
_converterNeedsReset = NO;
224226

225227
desc.componentType = kAudioUnitType_Output;
226228
#if TARGET_OS_IPHONE
@@ -424,7 +426,7 @@ - (ssize_t)writeRawInt16:(const int16_t *)samples
424426
effectiveRate = inputRate / rateAdjust;
425427
if (_converter == NULL
426428
|| _lastInputRate != inputRate
427-
|| fabs(_lastRateAdjust - rateAdjust) > 0.0001)
429+
|| fabs(_lastRateAdjust - rateAdjust) > 0.005)
428430
{
429431
AudioStreamBasicDescription inputDesc, outputDesc;
430432

@@ -471,12 +473,9 @@ - (ssize_t)writeRawInt16:(const int16_t *)samples
471473

472474
_lastInputRate = inputRate;
473475
_lastRateAdjust = rateAdjust;
476+
_converterNeedsReset = NO;
474477
}
475478

476-
/* Reset converter state to clear any "end of stream" condition
477-
* from the previous writeRawInt16 call */
478-
AudioConverterReset(_converter);
479-
480479
/* Set up callback context */
481480
ctx.data = samples;
482481
ctx.frames_left = frames;
@@ -504,8 +503,20 @@ - (ssize_t)writeRawInt16:(const int16_t *)samples
504503
break;
505504
}
506505

506+
/* If converter returned 0 output while we have input, it may be stuck
507+
* in "end of stream" state (tvOS 13/14 issue). Reset and retry once. */
507508
if (outputFrames == 0)
509+
{
510+
if (ctx.frames_left > 0 && !_converterNeedsReset)
511+
{
512+
AudioConverterReset(_converter);
513+
_converterNeedsReset = YES; /* Mark that we've already reset */
514+
continue; /* Retry with reset converter */
515+
}
508516
break;
517+
}
518+
519+
_converterNeedsReset = NO; /* Converter is working, clear retry flag */
509520

510521
/* Apply volume to converted samples */
511522
outputSamples = outputFrames * 2;

cheevos/cheevos.c

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ static rcheevos_locals_t rcheevos_locals =
102102
true, /* hardcore_allowed */
103103
false,/* hardcore_requires_reload */
104104
false,/* hardcore_being_enabled */
105-
true /* core_supports */
105+
true, /* core_supports */
106+
false,/* badges_loaded */
107+
false /* badges_loading */
106108
};
107109

108110
rcheevos_locals_t* get_rcheevos_locals(void)
@@ -227,25 +229,24 @@ bool rcheevos_is_pause_allowed(void)
227229
return rc_client_can_pause(rcheevos_locals.client, NULL);
228230
}
229231

230-
static void rcheevos_show_mastery_placard(void)
232+
static void rcheevos_show_completion_placard(const char* title, const char* badge_name)
231233
{
232234
const settings_t* settings = config_get_ptr();
233235
if (settings->bools.cheevos_visibility_mastery)
234236
{
235-
const rc_client_game_t* game = rc_client_get_game_info(rcheevos_locals.client);
236-
char title[256];
237-
size_t _len = snprintf(title, sizeof(title),
237+
char message[256];
238+
size_t _len = snprintf(message, sizeof(message),
238239
msg_hash_to_str(rc_client_get_hardcore_enabled(rcheevos_locals.client)
239240
? MSG_CHEEVOS_MASTERED_GAME
240241
: MSG_CHEEVOS_COMPLETED_GAME),
241-
game->title);
242-
title[sizeof(title) - 1] = '\0';
242+
title);
243+
message[sizeof(message) - 1] = '\0';
243244

244245
#if defined (HAVE_GFX_WIDGETS)
245246
if (gfx_widgets_ready())
246247
{
247248
char msg[128];
248-
char badge_name[32];
249+
char badge[32];
249250
const char* displayname = rc_client_get_user_info(rcheevos_locals.client)->display_name;
250251
const bool content_runtime_log = settings->bools.content_runtime_log;
251252
const bool content_runtime_log_aggr = settings->bools.content_runtime_log_aggregate;
@@ -276,9 +277,10 @@ static void rcheevos_show_mastery_placard(void)
276277
}
277278
}
278279

279-
__len = strlcpy(badge_name, "i", sizeof(badge_name));
280-
strlcpy(badge_name + __len, game->badge_name, sizeof(badge_name) - __len);
281-
gfx_widgets_push_achievement(title, msg, badge_name);
280+
/* badge image = "iBADGENAME" */
281+
badge[0] = 'i';
282+
strlcpy(&badge[1], badge_name, sizeof(badge) - 1);
283+
gfx_widgets_push_achievement(title, msg, badge);
282284
}
283285
else
284286
#endif
@@ -287,6 +289,22 @@ static void rcheevos_show_mastery_placard(void)
287289
}
288290
}
289291

292+
static void rcheevos_show_mastery_placard(void)
293+
{
294+
const rc_client_game_t* game = rc_client_get_game_info(rcheevos_locals.client);
295+
rcheevos_show_completion_placard(game->title, game->badge_name);
296+
}
297+
298+
static void rcheevos_show_subset_completion_placard(const rc_client_subset_t* subset)
299+
{
300+
char badge[32];
301+
badge[0] = 'i';
302+
strlcpy(&badge[1], subset->badge_name, sizeof(badge) - 1);
303+
rcheevos_client_download_badge_from_url(subset->badge_url, badge);
304+
305+
rcheevos_show_completion_placard(subset->title, subset->badge_name);
306+
}
307+
290308
static void rcheevos_award_achievement(const rc_client_achievement_t* cheevo)
291309
{
292310
const settings_t* settings = config_get_ptr();
@@ -588,6 +606,9 @@ static void rcheevos_client_event_handler(const rc_client_event_t* event, rc_cli
588606
case RC_CLIENT_EVENT_GAME_COMPLETED:
589607
rcheevos_show_mastery_placard();
590608
break;
609+
case RC_CLIENT_EVENT_SUBSET_COMPLETED:
610+
rcheevos_show_subset_completion_placard(event->subset);
611+
break;
591612
case RC_CLIENT_EVENT_SERVER_ERROR:
592613
rcheevos_server_error(event->server_error->api, event->server_error->error_message);
593614
break;
@@ -703,6 +724,8 @@ bool rcheevos_unload(void)
703724

704725
if (was_loaded)
705726
{
727+
rcheevos_locals.badges_loaded = rcheevos_locals.badges_loading = false;
728+
706729
#ifdef HAVE_MENU
707730
rcheevos_menu_reset_badges();
708731

@@ -1268,9 +1291,8 @@ static void rcheevos_show_game_placard(void)
12681291
if (gfx_widgets_ready())
12691292
{
12701293
char badge_name[32];
1271-
size_t __len = strlcpy(badge_name, "i", sizeof(badge_name));
1272-
strlcpy(badge_name + __len, game->badge_name,
1273-
sizeof(badge_name) - __len);
1294+
badge_name[0] = 'i';
1295+
strlcpy(&badge_name[1], game->badge_name, sizeof(badge_name) - 1);
12741296
gfx_widgets_push_achievement(game->title, msg, badge_name);
12751297
}
12761298
else
@@ -1406,13 +1428,21 @@ static void rcheevos_finalize_game_load(rc_client_t* client)
14061428
settings_t* settings = config_get_ptr();
14071429
bool want_badges = settings->bools.cheevos_badges_enable;
14081430
#if !defined(HAVE_GFX_WIDGETS)
1409-
/* Then badges are only needed for xmb and ozone menus */
1431+
/* Then badges are only needed for xmb, ozone, and rgui menus */
14101432
want_badges = want_badges &&
14111433
( string_is_equal(settings->arrays.menu_driver, "xmb")
1412-
|| string_is_equal(settings->arrays.menu_driver, "ozone"));
1434+
|| string_is_equal(settings->arrays.menu_driver, "ozone")
1435+
|| string_is_equal(settings->arrays.menu_driver, "rgui"));
14131436
#endif
1414-
if (want_badges)
1415-
rcheevos_client_download_achievement_badges(client);
1437+
if (want_badges) /* prefetch the game badge */
1438+
{
1439+
const rc_client_game_t* game = rc_client_get_game_info(client);
1440+
char badge[32];
1441+
1442+
badge[0] = 'i';
1443+
strlcpy(&badge[1], game->badge_name, sizeof(badge) - 1);
1444+
rcheevos_client_download_badge_from_url(game->badge_url, badge);
1445+
}
14161446

14171447
if (!rc_client_is_processing_required(client))
14181448
{

0 commit comments

Comments
 (0)