hiby: r3proii: fix crash on playback when no headphones are detected

0 is an invalid value to set on Hiby as "Output Port Switch". For devices with multiple outputs, we need to ensure it is set to a valid port.

Change-Id: I16ea2e620fae3034dccf3267d316924d8e2c0a95
This commit is contained in:
Roman Artiukhin 2026-07-15 15:50:10 +03:00 • committed by Solomon Peachy
parent c35271a3f0
commit 8923f479d0

View file

@ -86,6 +86,12 @@ void hiby_set_output(int ps)
{
if (!hw_init || muted) return;
// Default to headset if nothing was ever inserted; otherwise, R3 Pro II crashes on playback
if (ps == 0)
{
ps = last_ps > 0 ? last_ps : 2;
}
if (last_ps != ps)
{
logf("set out %d/%d", ps, last_ps);