24 May '13 - 15:53 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: HDMI TV - Windows7 - Switch TV Off/On lose sound  (Read 2105 times)
WACKA
Posts: 14


« on: 30 Mar '11 - 12:14 »
Reply with quoteQuote

Hi,

I have my PC (windows7) connected to my HDMI TV (LG) using a HDMI cable.
I am using a very simple app to play tracks using Bass.Net.

The problem is that if I play a track on the PC then turn the monitor Off/On I lose the audio and cannot use the app again to play tracks until the app is restarted (when I attempt to play a new track I get BassError: -1).

In order to try and gague what is going on I output the devices to a log file using the GetDeviceInfo function before the tv is turned off, while it is turned off, and after it is turned back on, but the outputs remain the same (i.e. mixerid is the same, isDefault=true, isEnabled=true) and in the same order:

(30)11:37:06]BassID(0): No sound (isDefault:False/isenabled:True/)
(30)11:37:06]BassID(1): LG TV (Intel(R) Display Audio) (isDefault:True/isenabled:True/hdaudio\func_01&ven_8086&dev_2805&subsys_80862805&rev_1000\4&141f45d&0&0301)
(30)11:37:06]BassID(2): S/PDIF (M-Audio Delta Audiophile) (isDefault:False/isenabled:True/pci\ven_1412&dev_1712&subsys_d6341412&rev_02\5&9c286&0&0000e7)
(30)11:37:06]BassID(3): Realtek Digital Output (Realtek High Definition Audio) (isDefault:False/isenabled:True/hdaudio\func_01&ven_10ec&dev_0892&subsys_1043841b&rev_1003\4&141f45d&0&0001)
(30)11:37:06]BassID(4): Speakers (Realtek High Definition Audio) (isDefault:False/isenabled:True/hdaudio\func_01&ven_10ec&dev_0892&subsys_1043841b&rev_1003\4&141f45d&0&0001)
(30)11:37:06]BassID(5): Line 1/2 (M-Audio Delta Audiophile) (isDefault:False/isenabled:True/pci\ven_1412&dev_1712&subsys_d6341412&rev_02\5&9c286&0&0000e7)
(30)11:37:06]BassID(6): Realtek Digital Output(Optical) (Realtek High Definition Audio) (isDefault:False/isenabled:True/hdaudio\func_01&ven_10ec&dev_0892&subsys_1043841b&rev_1003\4&141f45d&0&0001)


The scenario I am working with is:
- Start App with TV turned on.
- Play track
- Check outputs (i.e. see if the control panel sound screen registers that audio is outputting)
- Turn TV off
- VNC to PC and check outputs (at this stage the Sound screen shows that the HDMI sound output is still visible, enabled and outputting)
- Turn TV on and check outputs (at this stage the Sound screen confirms that no sound is coming out of the HDMI output).

As a side note, I also have another HDMI TV (LG, but older make) and when I turn the TV Off the output disappears from the output list. This situation is fine for me as I am able to handle this scenario in the code. The problem is when the outputs do not change (even the isEnabled flag stays true when the tv is turned off) on the newer TV.

Have you experienced this before? Do u know what could be happening in the background? Is there a fix/workaround?

Many thanks,

Conor
Logged
Ian @ un4seen
Administrator
Posts: 15275


« Reply #1 on: 30 Mar '11 - 15:53 »
Reply with quoteQuote

I will send you a debug BASS.DLL version to confirm what is happening.
Logged
smodilo
Posts: 47


« Reply #2 on: 30 Mar '11 - 21:55 »
Reply with quoteQuote

As a side note, I also have another HDMI TV (LG, but older make) and when I turn the TV Off the output disappears from the output list. This situation is fine for me as I am able to handle this scenario in the code.

Can I ask you how you handle this in code? Because I am struggling with this issue a long time and don't know what to do about it. My complete program always freezes if someone turns on/off a tv.

AFAIK the problem is with WIN messing up the display settings when attaching/de-attaching/turning on/off a display.


Logged
WACKA
Posts: 14


« Reply #3 on: 31 Mar '11 - 10:25 »
Reply with quoteQuote

@smodilo

I handle the output dropping off/on situation by:

1. Waiting for the windows message DBT_DEVNODES_CHANGED  to discover if a device has been added/removed:

 public void WndProc(ref Message m)
        {
            int devType;
            char c;

            if (m.Msg == WM_DEVICECHANGE)
            {
                // WM_DEVICECHANGE can have several meanings depending on the WParam value...
                switch (m.WParam.ToInt32())
                {

                    case DBT_DEVNODES_CHANGED:
                        //possible change to the sound cards
                        DriveDetectorEventHandler tempSCChanged = PossibleSoundCardChange;
                        if (tempSCChanged != null)
                        {
                            var e = new DriveDetectorEventArgs();
                           
                            tempSCChanged(this, e);
                        }

                        break;
}
}
}

2. When this message is received then I Bass_free the output. When the output comes back again I then use Bass_init to initialize again.


N.B. I am getting a freezing issue too (but it is not related to anything audio). I have a WPF app with a complicated 3d interface, when the TV is switched Off/on and the app is on the complicated screen the app freezes. However if the app is on any other screen then turning off/on is OK. Does this help you? If I find a solution I will post and hopefully vice versa.

Best regards,

Conor 

Logged
smodilo
Posts: 47


« Reply #4 on: 31 Mar '11 - 13:38 »
Reply with quoteQuote

Thank you very much,

I thought I tried monitoring the WM_DEVICECHANGE but didn't see a change. I Will have another look at it though, as it seems to be working for you. I Must have been looking at the wrong device.

Although it's not the neatest way, I even wouldn't mind restarting the app after a DEVICECHANGE event. Everything better than just freezing.

Thanks, and of course I'll let you know if I find something to work with.
Logged
WACKA
Posts: 14


« Reply #5 on: 7 Apr '11 - 10:11 »
Reply with quoteQuote

FYI, my 'freezing' issue has now been fixed.

As mentioned it seemed to be a WPF redraw issue which has been fixed by installing a hotfix for .net framework:  Windows6.1-KB2028560-v2-x86.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines