Sound cuts out on Raspberry Pi
Pages: 1 2
Alan Griffin (2213) 6 posts |
I have been running my bellringing progam (which I wrote on the BBC 28 years ago) on my Raspberry Pi. |
William Harden (2174) 244 posts |
Interesting – the same is also true of the background music in !Zool (cuts out but then starts again once a different track has been briefly used, eg. between levels). I wonder whether this is the same issue? |
Michael Emerton (483) 136 posts |
I have also noticed this behaviour from ArcEm, but not tested it off of a Raspberry Pi, so I am not sure if this is limited to the Pi. Whilst I am thinking about it, I did noticed that DiskSample appeared to go silent on my Mk1 Pi, from time to time, and only a reboot fixed it. The same setup (card moved over) worked fine on a MkII. Sadly my MkI has died. |
Chris Hall (132) 3559 posts |
I seem to (vaguely) recall that this can happen if you overfill the sound buffer. Are you checking to make sure it has space available? |
William Harden (2174) 244 posts |
Chris: As this seems to be happening in software that worked previously, perhaps the question could be rephrased as: - Is there a reason the RPi’s sound buffer might become exhausted more rapidly than on other variants? |
Sprow (202) 1158 posts |
In September, I spent some time adding a status of each of the ports. Reading the Raspberry Pi one seems relevant here. |
Chris Hall (132) 3559 posts |
It is not a case of the buffer being exhausted. It is a case of the buffer being overfilled and therefore thinking that it is exhausted. Slower machines did not seem able to stuff so much data into the sound buffer quickly enough to fill it. Newer machine are now fast enough for this to happen. Simply check the sound buffer has some space before stuffing it. The call SYS “Sound_QFree” can help, or restrict BASIC in the number of queued sounds it places in the buffer at one time. |
John Norris (2243) 10 posts |
I too now have the same problem as Alan on my bellringing program Stringing. I’ve been running Stringing on my Pi since February and in over fifty hours of use had never had a problem until a recent upgrade to the RISCOS/IMG. Now I have exactly the same symptoms as Alan. |
John Norris (2243) 10 posts |
I have today reported the problem as a bug, Ticket #376 |
Jon Abbott (1421) 2651 posts |
Chris mentioned it being the buffer being overfilled, why would the RO Channel Handler call the buffer fill code more than it needs too? It was my understanding that if your fill code is called, you add another N bytes to the buffer. N being the buffer length you’ve previously got from Sound_Configure. I’ve recently modified TrackerModule to get Magic Pockets working on RO5 and as part of that work, I recoded it to query the buffer size and the frequency, so it worked on any machine. It however goes silent after a while randomly. When it stops, other sound carries on working, so either RO has stopped calling the buffer fill code or it’s not merging the buffer with the sound output. At the point it stops, no other sound is occuring. For example sitting it the intro sequence of Magic Pockets it may randomly go silent before it gets to demo mode. |
Alan Griffin (2213) 6 posts |
I attended the MUG meeting yesterday. |
Doug Webb (190) 1180 posts |
Hi Alan, As discussed yesterday it is a little long winded. First best to upgrade to the latest beta harddisc image from the software downloads section on this site. Download the self extracting version and change it’s file type to &FFC and then double click on it to extract the hard disc image. Double click on !Boot, select Boot and then install and then open up the directory just created and drag the new !Boot to the install window and merge the files. Next copy all the new applications over the existing ones on your hard drive. Note you may need to change the access to unprotect on your existing ones to enable this to happen. Then shut down you machine and check it works OK, if you get issues with the monitor either not displaying correctly or not saving the monitor type then you may need to rename the !Boot>Choices>Boot directory to something else and then reboot and reconfigure your system from scratch. Finally once you have a working copy of a system then Shift>Select the mouse on !Boot and locate and open up the Resources and then the PCLoader directory. This will display contents that include a file name RISCOS/IMG. Open up the new ROM zip file and extract the file named riscos to the RAMDisc and then change it’s name to RISCOS/IMG. Then change it’s file type to &692 and copying it over the old RISCOS/IMG file. Finally reboot and you should have a new ROM and harddisc image running. If this is a little daunting then wait until ROOL produce a later version of the official Pi image or bring your Pi along to the next MUG meeting in March or along to the South West show on 1st March where I’m sure people can help update the Pi setup you have. |
Jon Abbott (1421) 2651 posts |
I tested sound on the 14-01-14 alpha and found other issues, SoundDMA for example would hang during the boot sequence and a lot of sound wasn’t outputting at all. I couldn’t see any documented changes listed on the revisions list recently, so I’m not entirely sure why I was seeing these issues. |
Jon Abbott (1421) 2651 posts |
Has anything changed on the audio stack since the 04-12-13 alpha? Previously in-game music would stall at a random point, now it stalls after the first buffer fill. WaveSynth, StringLib and Percussion however seem to be unaffected. |
Jeffrey Lee (213) 6048 posts |
Jon: Have you tried today’s ROM? Both 8-bit and 16-bit sound seems to be working fine for me. However, I have recently been seeing the occasional hang on startup initialising SoundDMA, and I haven’t yet checked if the “sound suddenly stops” issue still occurs. If you were only testing with an older ROM then it’s possible the video bug was causing some sound issues as well. |
Jon Abbott (1421) 2651 posts |
Yes, have tried today’s ROM, which promoted me to raise it. Is it possible to download previous nightly builds so I can see at what point it started being an issue? I know it started after 04-12-13 and prior to 14-01-13 |
Jeffrey Lee (213) 6048 posts |
Unfortunately not; only the latest builds are kept on the server. |
Steve Pampling (1551) 8172 posts |
What dates? Silly, boy Steven – read further up… 14 revisions, totalling 33.4MB (first 2013-12-04, last 2014-01-13) |
Jon Abbott (1421) 2651 posts |
I do…drop me a mail for details: jon at jaspp dot org dot uk |
Steve Pampling (1551) 8172 posts |
Avoiding filling a mailbox – let me know which. |
Steve Pampling (1551) 8172 posts |
Hi John, eek! 39MB post MIME. |
Jon Abbott (1421) 2651 posts |
Jeffrey – I’ve tested the following builds. Steve – thanks for eMailing them. 07-12-13 – in-game music working All we can say is that this issue (which is a separate issue to the OP) started sometime between 11-12-13 and 01-01-14. There’s obviously a gap I’ve not tested between 11-12-13 and 15-12-13 unless someone has the builds and can eMail them to me. With regard to SoundDMA hanging, I’ve not seen it happen on the 04-12-13 build which I boot several hundred times a day. I did see it on the 14-01-14 build after a few boots and haven’t tested inbetween due to the previously mentioned MODE change issue. With regard to the OP issue, it’s been there as long as I can recall. It’s reproducible simply by leaving something with sound running. I’ve seen/heard it in Zarch when it’s in demo mode for example, Zarch doesn’t do anything fancy with audio – it uses Percussion and WaveSynth and barely touches the OS other than via OS_WriteC / OS_WriteS and OS_Byte 112 / 113 to swap frames. What I haven’t established, is if the buffer fill code is still being called after it goes silent, so at this stage I’m unsure if it’s an internal RO issue or related to RO’s interaction with the hardware. |
Chris Hall (132) 3559 posts |
What I haven’t established, is if the buffer fill code is still being called after it goes silent, so at this stage I’m unsure if it’s an internal RO issue or related to RO’s interaction with the hardware. On 18 May 2006 I posted the item below on the A9home list, identifying the problem with BASIC sending lots of SOUND commands and no-one shot me down in flames. I presume the issue is still there in RISC OS?
|
Jon Abbott (1421) 2651 posts |
I can see why that would be a problem however I don’t believe this is the same issue. Sounds aren’t being flooded into the buffer, a soundtracker for example is simply fulfilling a buffer fill request made by the OS. The length of that buffer and frequency rate at which the fill code is called are under the control of the OS. |
Jeffrey Lee (213) 6048 posts |
The builds between those dates should be identical, it doesn’t look like anything was checked into CVS during that time. Is it just with ADFFS that you’re seeing sound immediately fail, or is it happening with other software too? The standard OS 8-bit sound generators, QTM, Zool (Iyonix version – which I’d assume still uses 8-bit sound) and ArcEm (16-bit sound) all seemed to be working fine when I tested the 20-01-14 build yesterday. Also, are you using HDMI audio or the 3.5mm socket? Unfortunately I don’t have anything to test HDMI audio with. Although if the 8-bit sound generators are continuing to function then that indicates it’s a RISC OS side issue rather than a GPU side one.
When I was able to reproduce the “sound suddenly stops” issue in the past, it looked like the GPU simply stopped returning processed sound buffers to us, without any obvious indication of an error occuring. This would then cause the OS to stop generating buffer fill requests, and stop it trying to send new buffers to the GPU. |
Pages: 1 2