Skip to content

Commit

Permalink
Audio demos/tests: Only limit latency adjustment to Linux + ARM.
Browse files Browse the repository at this point in the history
IsARM() is insufficient to decide if latency requirements should be loosened.
The assumption was that IsARM == RaspberryPi, but now IsARM can also mean
rather powerful Apple Silicon ARM SoC's like M1/M2/M3/M4/... and those do not
need loose latency requirements. So only loosen if ARM + Linux. This is still a bit
ham fisted as there are many other ARM SoC's under Linux than RaspberryPi
which are swept up in this wide net. Baby steps.
  • Loading branch information
kleinerm committed Jan 12, 2025
1 parent 5292fc2 commit ca9dcc3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Psychtoolbox/PsychDemos/BasicAMAndMixScheduleDemo.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function BasicAMAndMixScheduleDemo(device)
nrchannels = 2;
sugLat = [];

if IsARM
if IsARM && IsLinux
% ARM processor, probably the RaspberryPi SoC. The Pi can not quite handle the
% low latency settings of a desktop PC, so be more lenient:
sugLat = 0.025;
Expand Down
2 changes: 1 addition & 1 deletion Psychtoolbox/PsychDemos/BasicSoundScheduleDemo.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function BasicSoundScheduleDemo(wavfilenames, device)
InitializePsychSound;

suggestedLatencySecs = [];
if IsARM
if IsARM && IsLinux
% ARM processor, probably the RaspberryPi SoC. This can not quite handle the
% low latency settings of a Intel PC, so be more lenient:
suggestedLatencySecs = 0.025;
Expand Down
2 changes: 1 addition & 1 deletion Psychtoolbox/PsychTests/PsychPortAudioDataPixxTimingTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function PsychPortAudioDataPixxTimingTest(waitTime, exactstart, deviceid, latbia
buffersize = 0; % Pointless to set this. Auto-selected to be optimal.
suggestedLatencySecs = [];

if IsARM
if IsARM && IsLinux
% ARM processor, probably the RaspberryPi SoC. This can not quite handle the
% low latency settings of a Intel PC, so be more lenient:
suggestedLatencySecs = 0.025;
Expand Down
2 changes: 1 addition & 1 deletion Psychtoolbox/PsychTests/PsychPortAudioTimingTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function PsychPortAudioTimingTest(exactstart, deviceid, latbias, waitframes, use
buffersize = 0; % Pointless to set this. Auto-selected to be optimal.
suggestedLatencySecs = [];

if IsARM
if IsARM && IsLinux
% ARM processor, probably the RaspberryPi SoC. This can not quite handle the
% low latency settings of a Intel PC, so be more lenient:
suggestedLatencySecs = 0.025;
Expand Down

0 comments on commit ca9dcc3

Please sign in to comment.