Results 1 to 16 of 16

Thread: So why DOES sound loop when your system hangs?

  1. #1
    HEXUS webmaster Steve's Avatar
    Join Date
    Nov 2003
    Posts
    14,283
    Thanks
    293
    Thanked
    841 times in 476 posts

    So why DOES sound loop when your system hangs?

    A friend and I were discussing this a while ago, and it just popped back into my head.

    And what the hell, I thought I'd share it with you.

    Your sound card, or more likely your sound card's driver, reads data from a portion of memory allocated as an output buffer for your audio. It's a ring buffer.

    That means, the sound card plays whatever's in there, and when it gets to the end of the section of memory, it jumps back to the beginning and carries on.

    So, as long as your system can update what's already been read before it gets read again, you won't get sound-looping.

    But if something goes wrong and your system becomes less responsive than it should be... the buffer under-runs, and because it's a ring buffer it just keeps getting read out.

    This post was brought to you by the fact that I'm a nerd, and wanted to show it.
    PHP Code:
    $s = new signature();
    $s->sarcasm()->intellect()->font('Courier New')->display(); 

  2. Received thanks from:

    badass (01-09-2008),digit (30-08-2008),Hicks12 (29-08-2008),Tetras (30-08-2008)

  3. #2
    Senior Member Hicks12's Avatar
    Join Date
    Jan 2008
    Location
    Plymouth-SouthWest
    Posts
    6,586
    Thanks
    1,070
    Thanked
    340 times in 293 posts
    • Hicks12's system
      • Motherboard:
      • Asus P8Z68-V
      • CPU:
      • Intel i5 2500k@4ghz, cooled by EK Supreme HF
      • Memory:
      • 8GB Kingston hyperX ddr3 PC3-12800 1600mhz
      • Storage:
      • 64GB M4/128GB M4 / WD 640GB AAKS / 1TB Samsung F3
      • Graphics card(s):
      • Palit GTX460 @ 900Mhz Core
      • PSU:
      • 675W ThermalTake ThoughPower XT
      • Case:
      • Lian Li PC-A70 with modded top for 360mm rad
      • Operating System:
      • Windows 7 Professional 64bit
      • Monitor(s):
      • Dell U2311H IPS
      • Internet:
      • 10mb/s cable from virgin media

    Re: So why DOES sound loop when your system hangs?

    Dont know why but tis popped into me head just now, wierd thought since im a bit tipsy atmmm. My sound card seems to hage died or not fitted in properly after movn it to fit a zalman fans adaptor, will have to check it later cos its causin pc to freeze randomly.
    Quote Originally Posted by snootyjim View Post
    Trust me, go into any local club and shout "I've got dual Nehalem Xeons" and all of the girls will practically collapse on the spot at the thought of your e-penis

  4. #3
    SiM
    SiM is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    London
    Posts
    7,787
    Thanks
    300
    Thanked
    633 times in 422 posts
    • SiM's system
      • Motherboard:
      • P5K Premium
      • CPU:
      • Q6600
      • Memory:
      • 8GB PC2-6400 OCZ ReaperX + Platinum
      • Storage:
      • 3 x 320gb HD322HJ single platter in Raid 0
      • Graphics card(s):
      • PNY GTX285
      • PSU:
      • Corsair TX650W
      • Case:
      • Antec 1200
      • Monitor(s):
      • 2407-HC

    Re: So why DOES sound loop when your system hangs?

    Interesting, although they must be able to make a workaround for it because it is damn annoying.

  5. #4
    HEXUS webmaster Steve's Avatar
    Join Date
    Nov 2003
    Posts
    14,283
    Thanks
    293
    Thanked
    841 times in 476 posts

    Re: So why DOES sound loop when your system hangs?

    Why would you work around something that only happens once something else is already broken, and goes away when that broken thing is fixed?
    PHP Code:
    $s = new signature();
    $s->sarcasm()->intellect()->font('Courier New')->display(); 

  6. #5
    SiM
    SiM is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    London
    Posts
    7,787
    Thanks
    300
    Thanked
    633 times in 422 posts
    • SiM's system
      • Motherboard:
      • P5K Premium
      • CPU:
      • Q6600
      • Memory:
      • 8GB PC2-6400 OCZ ReaperX + Platinum
      • Storage:
      • 3 x 320gb HD322HJ single platter in Raid 0
      • Graphics card(s):
      • PNY GTX285
      • PSU:
      • Corsair TX650W
      • Case:
      • Antec 1200
      • Monitor(s):
      • 2407-HC

    Re: So why DOES sound loop when your system hangs?

    Quote Originally Posted by Steve View Post
    Why would you work around something that only happens once something else is already broken, and goes away when that broken thing is fixed?
    Well surely the sound card drivers can prevent it from looping when crashing. Its not something that hugely important but it would be nice imo. There is no real reason to work around it - I just find it rubs salt into the wound when something is wrong because its annoying.

    Actually, thinking about it bsod crashes normally don't suffer from this sound loop iirc

  7. #6
    HEXUS webmaster Steve's Avatar
    Join Date
    Nov 2003
    Posts
    14,283
    Thanks
    293
    Thanked
    841 times in 476 posts

    Re: So why DOES sound loop when your system hangs?

    But there's no way for them to know if the buffer is underrun... not without incurring a large overhead.

    As for BSOD, they're generally a STOP error, and so stuff... erm... stops.
    PHP Code:
    $s = new signature();
    $s->sarcasm()->intellect()->font('Courier New')->display(); 

  8. #7
    SiM
    SiM is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    London
    Posts
    7,787
    Thanks
    300
    Thanked
    633 times in 422 posts
    • SiM's system
      • Motherboard:
      • P5K Premium
      • CPU:
      • Q6600
      • Memory:
      • 8GB PC2-6400 OCZ ReaperX + Platinum
      • Storage:
      • 3 x 320gb HD322HJ single platter in Raid 0
      • Graphics card(s):
      • PNY GTX285
      • PSU:
      • Corsair TX650W
      • Case:
      • Antec 1200
      • Monitor(s):
      • 2407-HC

    Re: So why DOES sound loop when your system hangs?

    Quote Originally Posted by Steve View Post
    But there's no way for them to know if the buffer is underrun... not without incurring a large overhead.

    As for BSOD, they're generally a STOP error, and so stuff... erm... stops.
    Can't they just put some logic in saying that if the same thing is played twice then stop playing? I am not a programmer so I don't know if this is possible... I guess its one of those things that is easier said than done. Oh well, my comment about the workaround was just a random thought, don't read too much into it

  9. #8
    It's good to be bad pauldarkside's Avatar
    Join Date
    Oct 2006
    Location
    Cornwall
    Posts
    2,930
    Thanks
    295
    Thanked
    378 times in 259 posts
    • pauldarkside's system
      • Motherboard:
      • ASUS Maximus VI Hero
      • CPU:
      • Intel Core i7-4770K & Corsair Hydro H80i
      • Memory:
      • Corsair Vengeance 32GB (4x8GB) 1600MHz DDR3
      • Storage:
      • Corsair Force GS 128GB, Crucial M500 480GB, WD Black 4TB
      • Graphics card(s):
      • EVGA GeForce GTX 780 Ti Superclocked
      • PSU:
      • Corsair Professional HX850W
      • Case:
      • Corsair Graphite 780T (White)
      • Operating System:
      • Windows 8.1 Pro 64bit
      • Monitor(s):
      • Asus ROG Swift PG278Q
      • Internet:
      • BT Infinity @ 78Mbps

    Re: So why DOES sound loop when your system hangs?

    Quote Originally Posted by SiM View Post
    Can't they just put some logic in saying that if the same thing is played twice then stop playing? I am not a programmer so I don't know if this is possible... I guess its one of those things that is easier said than done. Oh well, my comment about the workaround was just a random thought, don't read too much into it
    But if everything's stopped (processes halted and further ones are not allowed) how would you check if it's still running after a crash like that... Your sound processor won't be given the instruction to flush the buffer and the "play" process is likely handled by the sound processor so until it's told it won't know.

    Edit: At least that's what I'd imagine is going on.
    My only concern is should I hide my true identity? A costume maybe?

    0iD: Plus weeing in it every now & again does it good
    scaryjim: 10" is just a little large to hold comfortably in one hand, which makes it a lot harder to tap, swipe and generally interact with.

  10. #9
    SiM
    SiM is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    London
    Posts
    7,787
    Thanks
    300
    Thanked
    633 times in 422 posts
    • SiM's system
      • Motherboard:
      • P5K Premium
      • CPU:
      • Q6600
      • Memory:
      • 8GB PC2-6400 OCZ ReaperX + Platinum
      • Storage:
      • 3 x 320gb HD322HJ single platter in Raid 0
      • Graphics card(s):
      • PNY GTX285
      • PSU:
      • Corsair TX650W
      • Case:
      • Antec 1200
      • Monitor(s):
      • 2407-HC

    Re: So why DOES sound loop when your system hangs?

    Quote Originally Posted by pauldarkside View Post
    But if everything's stopped (processes halted and further ones are not allowed) how would you check if it's still running after a crash like that... Your sound processor won't be given the instruction to flush the buffer and the "play" process is likely handled by the sound processor so until it's told it won't know.

    Edit: At least that's what I'd imagine is going on.
    Maybe the sound chip can check on a hardware level?

  11. #10
    It's good to be bad pauldarkside's Avatar
    Join Date
    Oct 2006
    Location
    Cornwall
    Posts
    2,930
    Thanks
    295
    Thanked
    378 times in 259 posts
    • pauldarkside's system
      • Motherboard:
      • ASUS Maximus VI Hero
      • CPU:
      • Intel Core i7-4770K & Corsair Hydro H80i
      • Memory:
      • Corsair Vengeance 32GB (4x8GB) 1600MHz DDR3
      • Storage:
      • Corsair Force GS 128GB, Crucial M500 480GB, WD Black 4TB
      • Graphics card(s):
      • EVGA GeForce GTX 780 Ti Superclocked
      • PSU:
      • Corsair Professional HX850W
      • Case:
      • Corsair Graphite 780T (White)
      • Operating System:
      • Windows 8.1 Pro 64bit
      • Monitor(s):
      • Asus ROG Swift PG278Q
      • Internet:
      • BT Infinity @ 78Mbps

    Re: So why DOES sound loop when your system hangs?

    Quote Originally Posted by SiM View Post
    Maybe the sound chip can check on a hardware level?
    Where is it going to get the instruction or confirmation from if the system has been suspended, even if it could then how without wasting valuable resources? Imagine if it didn't work like that (working how you mentioned earlier) and the sound chip was told to loop the buffer (small midi stuff for example) and the system crashed - it would only know if something had gone belly-up if it was constantly checking via a timer.

    Besides, it's the default in Windows set to automatically reboot upon a critical system failure? I seem to remember some version having that.
    My only concern is should I hide my true identity? A costume maybe?

    0iD: Plus weeing in it every now & again does it good
    scaryjim: 10" is just a little large to hold comfortably in one hand, which makes it a lot harder to tap, swipe and generally interact with.

  12. #11
    SiM
    SiM is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    London
    Posts
    7,787
    Thanks
    300
    Thanked
    633 times in 422 posts
    • SiM's system
      • Motherboard:
      • P5K Premium
      • CPU:
      • Q6600
      • Memory:
      • 8GB PC2-6400 OCZ ReaperX + Platinum
      • Storage:
      • 3 x 320gb HD322HJ single platter in Raid 0
      • Graphics card(s):
      • PNY GTX285
      • PSU:
      • Corsair TX650W
      • Case:
      • Antec 1200
      • Monitor(s):
      • 2407-HC

    Re: So why DOES sound loop when your system hangs?

    Quote Originally Posted by pauldarkside View Post
    Where is it going to get the instruction or confirmation from if the system has been suspended, even if it could then how without wasting valuable resources? Imagine if it didn't work like that (working how you mentioned earlier) and the sound chip was told to loop the buffer (small midi stuff for example) and the system crashed - it would only know if something had gone belly-up if it was constantly checking via a timer.

    Besides, it's the default in Windows set to automatically reboot upon a critical system failure? I seem to remember some version having that.
    Chill dude, no detailed analysis required... I was just saying a random thought! I thought that it would be possible given the technology of today, that is all... I am not a software or hardware developer, just a normal dude

  13. #12
    It's good to be bad pauldarkside's Avatar
    Join Date
    Oct 2006
    Location
    Cornwall
    Posts
    2,930
    Thanks
    295
    Thanked
    378 times in 259 posts
    • pauldarkside's system
      • Motherboard:
      • ASUS Maximus VI Hero
      • CPU:
      • Intel Core i7-4770K & Corsair Hydro H80i
      • Memory:
      • Corsair Vengeance 32GB (4x8GB) 1600MHz DDR3
      • Storage:
      • Corsair Force GS 128GB, Crucial M500 480GB, WD Black 4TB
      • Graphics card(s):
      • EVGA GeForce GTX 780 Ti Superclocked
      • PSU:
      • Corsair Professional HX850W
      • Case:
      • Corsair Graphite 780T (White)
      • Operating System:
      • Windows 8.1 Pro 64bit
      • Monitor(s):
      • Asus ROG Swift PG278Q
      • Internet:
      • BT Infinity @ 78Mbps

    Re: So why DOES sound loop when your system hangs?

    Quote Originally Posted by SiM View Post
    Chill dude, no detailed analysis required... I was just saying a random thought! I thought that it would be possible given the technology of today, that is all... I am not a software or hardware developer, just a normal dude
    Umm

    Quote Originally Posted by pauldarkside View Post
    At least that's what I'd imagine is going on.
    And I'll add that I couldn't be more chilled even if I was sedated. After a couple of schmokes, no pancakes - I'll have them later, I'm really not bothered. Kind of keeping myself entertained before heading out. Been a couple of tough weeks

    PS I was actually quite shocked not to find any poon, not even a smidgen of tang, on those two hard drives! You're letting yourself go dude
    My only concern is should I hide my true identity? A costume maybe?

    0iD: Plus weeing in it every now & again does it good
    scaryjim: 10" is just a little large to hold comfortably in one hand, which makes it a lot harder to tap, swipe and generally interact with.

  14. #13
    SiM
    SiM is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    London
    Posts
    7,787
    Thanks
    300
    Thanked
    633 times in 422 posts
    • SiM's system
      • Motherboard:
      • P5K Premium
      • CPU:
      • Q6600
      • Memory:
      • 8GB PC2-6400 OCZ ReaperX + Platinum
      • Storage:
      • 3 x 320gb HD322HJ single platter in Raid 0
      • Graphics card(s):
      • PNY GTX285
      • PSU:
      • Corsair TX650W
      • Case:
      • Antec 1200
      • Monitor(s):
      • 2407-HC

    Re: So why DOES sound loop when your system hangs?

    Quote Originally Posted by pauldarkside View Post
    And I'll add that I couldn't be more chilled even if I was sedated. After a couple of schmokes, no pancakes - I'll have them later, I'm really not bothered. Kind of keeping myself entertained before heading out. Been a couple of tough weeks
    Well what I really meant was that there was no need to over analyse my random thought...

    Quote Originally Posted by pauldarkside View Post
    PS I was actually quite shocked not to find any poon, not even a smidgen of tang, on those two hard drives! You're letting yourself go dude
    Well they wouldn't be new if I had done that
    But I am sure you will have fun filling them up on your own

  15. #14
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: So why DOES sound loop when your system hangs?

    ok, you really want to know?

    what effectively happens when a PC 'hangs' is that certain level of prioty tasks don't get executed.

    We must all of seen PCs (espesually pre NT days) hang with the mouse still working, or the keybord caps lock key still toggling the LED?

    This is because PCs have certain levels of important for the preodic tasks (called 'interupts'). Multi-Media is one of the highest level tasks, with something like a timer for a GUI app like the task manager graph in windows, been one of the lowest.

    What happens is the device driver that 'runs' the soundcard is a high priority, and able to keep going, but the application thats feeding it, can't. So this means the soundcard can continue to operate, but will not get new data.

    Now as to why it loops, when you put sound out to the sound card, your marshalling memory from application A to device driver Z, marshalling accross a boundry is always computationally expensive, even more so when your sharing large amounts of memory. So on windows you have two buffers. The idea is whilst the driver is playing buffer 1, app is loading up buffer 2. and vice versa.

    Now what happens is the device driver can keep playing these buffers, but the app thats stacking the data in, can't keep stacking the data in. Hey presto, sound loops.

    This can be really common if you've got an application that makes an assumption like, the HDD i'm reading this data off, will always be able to keep up with my read rate.

    So tried to keep that simple and un-technical
    throw new ArgumentException (String, String, Exception)

  16. Received thanks from:

    Tetras (30-08-2008),Virtual Monkey (30-08-2008)

  17. #15
    Senior Member Virtual Monkey's Avatar
    Join Date
    Jan 2005
    Location
    Manchester
    Posts
    596
    Thanks
    51
    Thanked
    54 times in 32 posts
    • Virtual Monkey's system
      • Motherboard:
      • Abit IP-35E
      • CPU:
      • Intel Core 2 Duo E4600 @ stock 2.4ghz
      • Memory:
      • 3gb Corsair XMS2 DDR 6400
      • Storage:
      • 250GB Samsung HD250HJ Spinpoint
      • Graphics card(s):
      • 256MB PowerColor HD3850
      • PSU:
      • 550w Corsair VX Series PSU
      • Case:
      • Antec NSK4000 Mini Tower Case
      • Operating System:
      • Vista Home Premium
      • Monitor(s):
      • LG Flatron L226WTQ 22in

    Re: So why DOES sound loop when your system hangs?

    I'd never really considered it before, but it's actually pretty interesting.

  18. #16
    Senior Member
    Join Date
    Mar 2005
    Posts
    4,935
    Thanks
    171
    Thanked
    384 times in 311 posts
    • badass's system
      • Motherboard:
      • ASUS P8Z77-m pro
      • CPU:
      • Core i5 3570K
      • Memory:
      • 32GB
      • Storage:
      • 1TB Samsung 850 EVO, 2TB WD Green
      • Graphics card(s):
      • Radeon RX 580
      • PSU:
      • Corsair HX520W
      • Case:
      • Silverstone SG02-F
      • Operating System:
      • Windows 10 X64
      • Monitor(s):
      • Del U2311, LG226WTQ
      • Internet:
      • 80/20 FTTC

    Re: So why DOES sound loop when your system hangs?

    Useless to me and yet interesting at the same time
    "In a perfect world... spammers would get caught, go to jail, and share a cell with many men who have enlarged their penises, taken Viagra and are looking for a new relationship."

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Blaupunkt Sound System
    By SXI_99 in forum Consumer Electronics
    Replies: 3
    Last Post: 28-08-2008, 03:31 PM
  2. Replies: 201
    Last Post: 21-08-2007, 11:10 AM
  3. System with NF-M2 nView turns on, then quickly turns off
    By problemo in forum abit.care@HEXUS
    Replies: 10
    Last Post: 07-06-2007, 09:08 AM
  4. Pioneer HTP-GS1 Xbox 360 Surround Sound System - £149.99 inc Delivery
    By Parm in forum Retail Therapy and Bargains
    Replies: 38
    Last Post: 15-12-2006, 06:16 PM
  5. XPC P9500g Shuttle Problems.
    By Azzlegog in forum PC Hardware and Components
    Replies: 2
    Last Post: 01-12-2005, 10:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •