RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account
Forums → Bugs →

Maestro crash

Subscribe to Maestro crash 36 posts, 7 voices

Posts per page:

Pages: 1 2

 
Feb 23, 2021 10:28am
Avatar David Pitt (3386) 878 posts

RPi good – Titanium crashes. Why the difference?

A search of built sources shows different versions of the SoundChannel modules, filenamed Sound1.

BCM2835.RiscOS.Sources.HWSupport.Sound.Sound1.rm.RPi.Sound1 Titanium.RiscOS.Sources.HWSupport.Sound.Sound1.rm.CortexA7.Sound1

 
Feb 23, 2021 10:35am
Avatar Martin Avison (27) 1081 posts

That test is indeed simpler. I realised yesterday that *ChannelVoice would trigger the same problem, and it seems that it does not matter which voice is used.

After failing to see from the SoundChannel source what the problem was (I think it disappears into DMAstuff, so I gave up) I did some (laborious) comparisons of memory blocks. My conclusion is that it is a typical out-by-one bug. The memory block just before the overwrite is 2,144 long. As channels 1-7 get allocated, the last 7 words of that block are populated, probably with an RMA address. When channel 8 gets allocated, the first word of the next block (which was a length of x20) is overwritten with the 8th address. This is the error trapped by *ReportHeap, and it causes anything else that traverses the RMA heap to fail.

Why it only seems to affect the Titanium, I have no idea, but the clue must be in the different sources.
However I think we have enough evidence to raise a bug report, referring to this thread. I will do that. Edit: Done – ticket #505

 
Feb 23, 2021 12:32pm
Avatar Chris (121) 437 posts

Nice work!

 
Feb 23, 2021 1:12pm
Avatar Jeffrey Lee (213) 5846 posts

Looks like a 24+ year old bug in StringLib & Percussion. They both work by copying their handler code to the RMA, and the handler code is directly followed by 8 words of data (1 word for the state of each channel the voice can be assigned to). But between the end of the code block (End_Of_Code) and the label which marks the start of the 8-word channel data (Instance0), a couple of extra words have snuck in, causing the handler code to access beyond the end of the allocated area if the voices are assigned to channels 7 or 8.

Presumably the bug’s remained hidden until now because on most systems the OS is adding two or more words of padding to the allocated block length (there will be some slight variation in handler code length on different platforms because a few years ago I changed the DivRem macro to use hardware divide where possible).

 
Feb 24, 2021 10:04am
Avatar David Feugey (2125) 2570 posts

That reminds me a strange problem I did have a few months ago: things in predesk were ignored and some Meastro tunes crashed. A voice module loaded at startup was the problem. I have no idea why it was working for years and stopped working suddenly.

 
Feb 24, 2021 10:38am
Avatar Martin Avison (27) 1081 posts

some Meastro tunes crashed.

Crashed in what way?
And on what machine, and OS version?
What was the voice module?

 
Feb 24, 2021 1:11pm
Avatar David Feugey (2125) 2570 posts

Crashed: Abort on data, etc.
Machine: Pi4 and ROS 5.28 (before: Pi3 and ROS 5.27)
Voice module: a specific one, generated with SoundCon.

Nota: the sound module worked, on some Pi1 and Pi2, with older versions of RISC OS.
It’s difficult to know when it began to crash, as I don’t use Maestro everyday.

https://www.riscosopen.org/forum/forums/3/topics/15236?page=1
https://www.riscosopen.org/forum/forums/4/topics/15247

 
Feb 24, 2021 1:19pm
Avatar Martin Avison (27) 1081 posts

@David: If you could send me the voice module, I could easily check if it was a symptom of the same problem.

 
Feb 24, 2021 5:58pm
Avatar David Pitt (3386) 878 posts

@Chris.

Jeffrey’s fixes are in git, a locally built ROM including them has Maestro playing music on the Titanium.

 
Feb 24, 2021 7:49pm
Avatar Chris (121) 437 posts

Thanks David – great to hear. And thanks to Jeffrey for the speedy fix too.

 
Feb 24, 2021 11:07pm
Avatar DavidS (1854) 2090 posts

Makes me want to play with Meastro to see if there is any issues, though I doubt it on a RPi 1B+ in ARMv5 Emulation mode for the CPU setting.

Pages: 1 2

Reply

To post replies, please first log in.

Forums → Bugs →

Search forums

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Description

Bug discussions that aren’t covered by the bugs database.

Voices

  • David Pitt (3386)
  • Martin Avison (27)
  • Chris (121)
  • Jeffrey Lee (213)
  • David Feugey (2125)
  • DavidS (1854)

Options

  • Forums
  • Login
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Beast theme is based on Beast's default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Beast © 2006 Josh Goebel and Rick Olson
This site runs on Rails

Hosted by Arachsys