Core Audio Plugin

Questions and comments specific to a particular plugin should go here.
User avatar
kgschlosser
Site Admin
Posts: 5144
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Core Audio Plugin

Post by kgschlosser » Sun Nov 10, 2019 9:57 am

I really do hate unicode problems. now it is going to get overly complex to decode the damned thing. It is going to take me a day or so to make the adjustments to it. There are quite a few places it has to get done so I do not want a bunch of repetitive code so I will have to make some modifications and a single function to handle it all.
If you like the work I have been doing then feel free to Image

z3us
Posts: 42
Joined: Fri Jul 29, 2011 2:35 am

Re: Core Audio Plugin

Post by z3us » Tue Nov 12, 2019 12:27 pm

kgschlosser wrote:
Sun Nov 10, 2019 9:57 am
I really do hate unicode problems. now it is going to get overly complex to decode the damned thing. It is going to take me a day or so to make the adjustments to it. There are quite a few places it has to get done so I do not want a bunch of repetitive code so I will have to make some modifications and a single function to handle it all.
Take the time you need.
Lot of thanks

sh4d0w
Posts: 3
Joined: Wed Nov 13, 2019 11:14 pm

Re: Core Audio Plugin

Post by sh4d0w » Thu Nov 14, 2019 12:04 am

Trying to post a proper bug reply but phpbb is flagging it as spam.... Changing endpoint is failing when triggered by deviceremoved/deviceattached, but works perfectly when executed manually. The audio does briefly change but then flips back.
Attachments
Untitled.png

User avatar
kgschlosser
Site Admin
Posts: 5144
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Core Audio Plugin

Post by kgschlosser » Thu Nov 14, 2019 3:13 pm

from what I am seeing is when you power off your SamsungTV you are trying to run a macro that sets the default audio renderer to the NVDIA HDMI endpoint and when you power the TV on you are setting the endpoint to the internal sound card. I am not sure if this is what you wanted to do or not. Windows is going to pitch a fit if you try and set the default audio endpoint to an endpoint that is not plugged in or in a disconnected state.

Also I would be very careful about using the device attached and device removed events from any Samsung product that is connected via HDMI. the reason why is Samsung TV's have crappy power supplies in them so when you initially power the TV on you can get a series of connects and disconnects from the TV. because the voltage drops low enough during the power up cycle that the EDID information gets all jumbled up and windows sees it as the device detached. and when the voltage comes back up again then windows will see it as attached again..This makes Windows go completely bonkers.
If you are not having this issue then you are lucky. I think the length of the HDMI cable also comes into play with this issue. I was using a 50ft cable when this problem happened. and the only resolution was to buy an adapter that plugged into the HDMI cable and that adapter recorded the EDID information from the TV and would always send it to the computer this way the PC would always think the TV was plugged in.


I have to take a look and see why those errors are occurring.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5144
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Core Audio Plugin

Post by kgschlosser » Thu Nov 14, 2019 3:50 pm

ok I have posted a new version. this one is probably going to break some of you macros.. read the release notes to the event naming changes.
If you like the work I have been doing then feel free to Image

sh4d0w
Posts: 3
Joined: Wed Nov 13, 2019 11:14 pm

Re: Core Audio Plugin

Post by sh4d0w » Thu Nov 14, 2019 6:41 pm

kgschlosser wrote:
Thu Nov 14, 2019 3:13 pm
from what I am seeing is when you power off your SamsungTV you are trying to run a macro that sets the default audio renderer to the NVDIA HDMI endpoint and when you power the TV on you are setting the endpoint to the internal sound card. I am not sure if this is what you wanted to do or not. Windows is going to pitch a fit if you try and set the default audio endpoint to an endpoint that is not plugged in or in a disconnected state.
Not quite, I have two display devices attached - a samsung tv, and an epson projector. When I power on/off the samsung TV that generates a connect/disconnect event, but the projector just shows as always connected.

The goal is to have the samsung disconnect trigger a switch of the default audio device to the nvidia output for the projector. Samsung connect event would then switch it back to the realtek optical out, so the audio is always routed to the correct speakers.

So in other words, the two endpoints I'm flipping between here are both always visible and "connected" to the PC.
kgschlosser wrote:
Thu Nov 14, 2019 3:13 pm
Also I would be very careful about using the device attached and device removed events from any Samsung product that is connected via HDMI. the reason why is Samsung TV's have crappy power supplies in them so when you initially power the TV on you can get a series of connects and disconnects from the TV. because the voltage drops low enough during the power up cycle that the EDID information gets all jumbled up and windows sees it as the device detached. and when the voltage comes back up again then windows will see it as attached again..This makes Windows go completely bonkers.
Huh interesting, I haven't run into this at all. I'm using an active hdmi cable to get longer length out of it too.

sh4d0w
Posts: 3
Joined: Wed Nov 13, 2019 11:14 pm

Re: Core Audio Plugin

Post by sh4d0w » Thu Nov 14, 2019 7:06 pm

Played with this some more, and it seems like coreaudio is triggering a system.deviceattached / system.deviceremoved event somehow... If I disable the event and trigger the macro manually it works fine. If I disable coreaudio and test the trigger, it works fine. If I enable everything I get the previously mentioned errors, even though the log doesn't show any system events other than the TV being turned on/off. I'm fairly new to eventghost, maybe I'm just missing something stupid / obvious here?

User avatar
kgschlosser
Site Admin
Posts: 5144
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Core Audio Plugin

Post by kgschlosser » Thu Nov 14, 2019 9:58 pm

the core audio plugin is not causing a USB device connection event.

There is also still a bug in the core audio plugin I came across. I have to run a few errands and I will fix it in a few hours.

what would happen with my samsung TV is when I turned it on I would get a device connect event. then a device disconnect and then another connect.. normally this would be an easy thing to filter out. The problem was it would not happen all the time. It was quite frustrating actually. so I decided to go projection and my samsung TV has been sitting in it's box for the last 4 years.


copy and paste your EG log so I can look at it again.
If you like the work I have been doing then feel free to Image

nYce
Posts: 46
Joined: Wed Mar 28, 2018 2:29 am

Re: Core Audio Plugin

Post by nYce » Wed Feb 05, 2020 11:35 pm

Dear kgschlosser,

i want to use the Core Audio Plugin to switch my default playback and communication device in windows 10.

It works to switch to my HDMI-device on my internal graphics card, but it fails to switch to my HDMI-device on my NVIDIA graphics card.

After plugging in/out, reinstalling drives, cleaning old devices in the device manager, reinstalling the plugin (by deleting the plugin files in %programdata%) i still cant figure out what the heck is going on..

My first problem is, that i have a lot of old devices to choose from, which don't exist in my devices manager anymore, when i go for example to "set default playback endpoint". See Screenshots for my device list and my device manager in windows.
OldDevices.jpg
deviceManager.jpg
Is this still an old list from before my cleanup?
If yes, where is it stored and how can i truly delete/re initiate the config for this/any eventghost plugin?
If no, where the heck are these devices in windows still registered, can you give me any hint?

LG Jay

nYce
Posts: 46
Joined: Wed Mar 28, 2018 2:29 am

Re: Core Audio Plugin

Post by nYce » Thu Feb 06, 2020 12:45 am

Alright, after some more digging i found my old devices in my registry. Here i can clean out Old devices, after deleting old versions of my device and renaming my device i could finally switch to my HDMI-Output from the NVIDIA Card.

The Devices are stored under:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render



Now my next question:

is there a way to also switch the default communication device?

User avatar
kgschlosser
Site Admin
Posts: 5144
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Core Audio Plugin

Post by kgschlosser » Thu Feb 06, 2020 1:50 am

The list you are seeing in the first attached image are not "devices" they are endpoints. the devices list is the drop down to the left of the one you have showing. A device can have MANY endpoints. some of those endpoints may be internal to the device.. like loopback endpoints. Or they may be for endpoints that connect to another device like a CD ROM drive.

When you open the Windows Sound Control Panel you are going to see a list of endpoints. Those endpoints are from all devices. That list is a list of only the endpoints for devices that are currently present in the system. because of the wonderful world of USB a device may not always exist in the system.. Take a webcam for instance, These commonly have a microphone and will show up as it's own audio device. The user should be able to set up macros whether the device is attached or not. so long as a driver is installed for it you will be able to choose it in the plugin.


If there are old device drivers still installed that you do not use any more these can easily be removed by doing the following.

Open up device manager. click on the "View" drop down menu at the top and check off the "Show Hidden Device" option in the menu. This is going to populate device manager will ALL device drivers that are installed whether or not the device is actually attached to the computer. You will be able to remove device that no longer exist in your system this way..

NOTE: check your USB devices as well as you are going to see mountains of drivers installed. There are loads of USB devices that also are considered sound devices. Cell Phones, Tablets, Camcorders and Webcams just to name a few. That means if a friend plugs a cell phone into your computer to only charge it, drivers are going to get installed. they do not get uninstalled when the device gets unplugged. The really nasty part of this is it will install a driver for each USB port a device has been plugged into on your computer. so if you have a webcam and you computer has 6 USB ports and the camera has been plugged into each of those ports at some point in time there are going to be 6 drivers installed.


Some education on what an "endpoint" is
The organization of "endpoints" can be confusing. an endpoint would be the end of the line. that end of the line can either be a renderer or a capture. capture being input and renderer being output. a physical jack is not an endpoint. an endpoint can be multiple jacks (surround sound). the plugin is going to show you all possible endpoints that are available for your sound device. This is not going to be the same list that you see in the Sound control panel for Windows.

the best thing to do is to play some audio out of that endpoint or change the volume on that endpoint. You will see an event take place in EventGhost. The event is going to contain the device name and also the endpoint name you will need to locate in the action control panel.

here is an example event

CoreAudio.High Definition Audio Device.Headphones.Volume.5.0000

and this is the bits you need.

the device is
"High Definition Audio Device"

the endpoint is
"Headphones"

When changing the default endpoint the endpoint you are changing to MUST be plugged in. The error that happens when the endpoint gets set to the default and it is not plugged in is not handled gracefully, this is something I will fix.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5144
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Core Audio Plugin

Post by kgschlosser » Thu Feb 06, 2020 4:40 am

as far as the default communications device is concerned.. I do not know. I know the ability to change the default capture and rendered is an undocumented ability. some person that works at Microsoft released information on how to do it. Having this control is not suppose to be public. I will poke about and see if i can locate something on setting the default communications device. I am not expecting to locate anything because of the low use of that Windows feature. But ya never know.
If you like the work I have been doing then feel free to Image

nYce
Posts: 46
Joined: Wed Mar 28, 2018 2:29 am

Re: Core Audio Plugin

Post by nYce » Thu Feb 06, 2020 10:21 am

Alright. I think after digging though my whole system i understood the concept of devices, endpoints, hidden devices/drivers and so on. Your list was just filled with endpoints of devices that where not existent anymore.
Since i found the location in my registry, where these old endpoints where still registered, i could clean up and was finally able to select a existing endpoint. that seems fixed to me and not a problem of the plugin and more of the mess, windows is creating.

In the beginning (why i just started this post), was the problem, that i could not select the right endpoint, because it just wasn't in the list. I tried every old endpoint but nothing switched to my existing endpoint.


---

okay, so default communication device is out. I can live with that.

---

Another thing: When i turn my AVR on or off, it always gives me a big mess in the log. The device always gets removed and then attached when turning it on or off. that is normal.

here is my eventlog for just turning it on:

Code: Select all

System.DeviceRemoved [u'\\\\?\\DISPLAY#ONK1260#5&247240f6&4&UID4353#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}']
Exception in thread Thread-20796:
Exception in thread Thread-20797:
Traceback (most recent call last):
Traceback (most recent call last):
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 754, in run
  File "threading.pyc", line 754, in run
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
    AUDIO_SESSION_STATE[NewState]
    AUDIO_SESSION_STATE[NewState]
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
    _format_name(session),
    _format_name(session),
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
    name = obj.name.decode('utf-8')
    name = obj.name.decode('utf-8')
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
    display_name = self.__session.GetDisplayName()
    display_name = self.__session.GetDisplayName()
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'


Exception in thread Thread-20814:
Exception in thread Thread-20815:
Traceback (most recent call last):
Traceback (most recent call last):
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 754, in run
  File "threading.pyc", line 754, in run
System.DeviceAttached [u'\\\\?\\DISPLAY#ONK1260#5&247240f6&4&UID4353#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}']
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
    AUDIO_SESSION_STATE[NewState]
    AUDIO_SESSION_STATE[NewState]
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
    _format_name(session),
    _format_name(session),
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
    name = obj.name.decode('utf-8')
    name = obj.name.decode('utf-8')
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
    display_name = self.__session.GetDisplayName()
    display_name = self.__session.GetDisplayName()
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'


Exception in thread Thread-20830:
Exception in thread Thread-20831:
Traceback (most recent call last):
Traceback (most recent call last):
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 754, in run
  File "threading.pyc", line 754, in run
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
    AUDIO_SESSION_STATE[NewState]
    AUDIO_SESSION_STATE[NewState]
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
    _format_name(session),
    _format_name(session),
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
    name = obj.name.decode('utf-8')
    name = obj.name.decode('utf-8')
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
    display_name = self.__session.GetDisplayName()
    display_name = self.__session.GetDisplayName()
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'


Exception in thread Thread-20848:
Exception in thread Thread-20849:
Traceback (most recent call last):
Traceback (most recent call last):
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 754, in run
  File "threading.pyc", line 754, in run
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
    AUDIO_SESSION_STATE[NewState]
    AUDIO_SESSION_STATE[NewState]
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
    _format_name(session),
    _format_name(session),
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
    name = obj.name.decode('utf-8')
    name = obj.name.decode('utf-8')
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
    display_name = self.__session.GetDisplayName()
    display_name = self.__session.GetDisplayName()
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'
here is my eventlog for turning it off (probably the same error):

Code: Select all

System.DeviceRemoved [u'\\\\?\\DISPLAY#ONK1260#5&247240f6&4&UID4353#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}']
Exception in thread Thread-20978:
Exception in thread Thread-20979:
System.DeviceAttached [u'\\\\?\\DISPLAY#ONK1260#5&247240f6&4&UID4353#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}']
Traceback (most recent call last):
Traceback (most recent call last):
Exception in thread Thread-20980:
Exception in thread Thread-20981:
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 754, in run
  File "threading.pyc", line 754, in run
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
Traceback (most recent call last):
Traceback (most recent call last):
    AUDIO_SESSION_STATE[NewState]
    AUDIO_SESSION_STATE[NewState]
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 801, in __bootstrap_inner
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
  File "threading.pyc", line 754, in run
  File "threading.pyc", line 754, in run
    _format_name(session),
    _format_name(session),
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
    AUDIO_SESSION_STATE[NewState]
    AUDIO_SESSION_STATE[NewState]
    name = obj.name.decode('utf-8')
    name = obj.name.decode('utf-8')
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
    _format_name(session),
    _format_name(session),
    display_name = self.__session.GetDisplayName()
    display_name = self.__session.GetDisplayName()
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'
    name = obj.name.decode('utf-8')
    name = obj.name.decode('utf-8')


  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
    display_name = self.__session.GetDisplayName()
    display_name = self.__session.GetDisplayName()
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'


Exception in thread Thread-21010:
Exception in thread Thread-21011:
Traceback (most recent call last):
Traceback (most recent call last):
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 754, in run
  File "threading.pyc", line 754, in run
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
    AUDIO_SESSION_STATE[NewState]
    AUDIO_SESSION_STATE[NewState]
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
    _format_name(session),
    _format_name(session),
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
    name = obj.name.decode('utf-8')
    name = obj.name.decode('utf-8')
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
    display_name = self.__session.GetDisplayName()
    display_name = self.__session.GetDisplayName()
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'


Exception in thread Thread-21028:
Exception in thread Thread-21029:
Traceback (most recent call last):
Traceback (most recent call last):
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 754, in run
  File "threading.pyc", line 754, in run
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 334, in do
    AUDIO_SESSION_STATE[NewState]
    AUDIO_SESSION_STATE[NewState]
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 482, in session_state_changed
    _format_name(session),
    _format_name(session),
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\__init__.py", line 162, in _format_name
    name = obj.name.decode('utf-8')
    name = obj.name.decode('utf-8')
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
  File "C:\ProgramData\EventGhost\plugins\CoreAudio\pyWinCoreAudio\session.py", line 381, in name
    display_name = self.__session.GetDisplayName()
    display_name = self.__session.GetDisplayName()
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'
AttributeError: 'AudioSession' object has no attribute '_AudioSession__session'


jonib
Plugin Developer
Posts: 1327
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Core Audio Plugin

Post by jonib » Thu Feb 06, 2020 12:19 pm

kgschlosser wrote:
Thu Feb 06, 2020 4:40 am
as far as the default communications device is concerned.. I do not know.
My AudioEndpoint library has support to change the communication device. I'm assuming you should be able to use the same method.

Check AudioEndpoints.SetDefault


jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

User avatar
kgschlosser
Site Admin
Posts: 5144
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Core Audio Plugin

Post by kgschlosser » Thu Feb 06, 2020 5:12 pm

OK cool jonib. I never really looked to see if that functionality was available. I will add the ability if it is able to be done.

I believe there is a memory leak in Core Audio as well if there is anyone that can confirm this it would be helpful. It is a tricky mess working with these com interfaces and holding reference to them. It looks like it is with the thread loop I have running to detect audio output I have to check it.

I am also going to check into the error you are having nYce and I wil get that cleaned up as well.
If you like the work I have been doing then feel free to Image

Post Reply