• 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 17
Release Audio Profiles (for Kodi 18 and later)
#76
(2020-07-20, 08:17)puenktchen Wrote: It's in the audio settings of the osd while playing media.
Then probably not.  Those OSD settings behave differently than other settings, and I haven't yet found anything in the JSON-RPC documentation indicating I can read or write that setting programmatically.  I'll keep this on the todo list, but I wouldn't hold my breath for it.
Reply
#77
Hi, thanks @pkscout for maintaining this addon, which is necessary for my needs. Still I cannot make it work as I wished.
To make you understand, this is my setup:
  • Hardware: Raspberry Pi 2 with an additional sound card Hifiberry Dac+
  • Software: LibreELEC 9.2.1, Kodi 18.6, Audio Profiles 2.0.0
The HDMI is connected to the TV, the sound card is connected to an hifi amplifier; so Kodi should route the sound output of the video files to the HDMI and the sound output of the music files to the other sound card.
Therefore I have created two profiles, one for each audio device, with automatic switch. If it is an unknown content type, the audio is routed to the HDMI.

What's not working for me is music streams (Internet radios):
  • Almost (*) all the radio addons contents are not being recognized as music, and so they are wrongly routed to the HDMI output.
  • If I play a .strm containing a link to an Internet radio the sound is routed to the HDMI output.
  • If I play a playlist (.m3u) from the main TV interface the sound goes to the hifi, however if I play it from Kore or from the web interface the sound ges to the HDMI.
I could use a workaround to those issues by setting up the sound card as the output for the unknown content type, however if I do so then the sound of the Kodi games goes to the sound card instead of the HDMI (the desired behaviour).
Is there a way to fix my issue?

(*) I found a discontinued addon, but it is buggy.
Reply
#78
(2020-07-28, 16:52)A.T.E. Wrote: Hi, thanks @pkscout for maintaining this addon, which is necessary for my needs. Still I cannot make it work as I wished.
To make you understand, this is my setup:
  • Hardware: Raspberry Pi 2 with an additional sound card Hifiberry Dac+
  • Software: LibreELEC 9.2.1, Kodi 18.6, Audio Profiles 2.0.0
The HDMI is connected to the TV, the sound card is connected to an hifi amplifier; so Kodi should route the sound output of the video files to the HDMI and the sound output of the music files to the other sound card.
Therefore I have created two profiles, one for each audio device, with automatic switch. If it is an unknown content type, the audio is routed to the HDMI.

What's not working for me is music streams (Internet radios):
  • Almost (*) all the radio addons contents are not being recognized as music, and so they are wrongly routed to the HDMI output.
  • If I play a .strm containing a link to an Internet radio the sound is routed to the HDMI output.
  • If I play a playlist (.m3u) from the main TV interface the sound goes to the hifi, however if I play it from Kore or from the web interface the sound ges to the HDMI.
I could use a workaround to those issues by setting up the sound card as the output for the unknown content type, however if I do so then the sound of the Kodi games goes to the sound card instead of the HDMI (the desired behaviour).
Is there a way to fix my issue?

(*) I found a discontinued addon, but it is buggy.
Streams will almost never be identified by their media type, as many addons do not provide that information in a way that Kodi understands.  You'll probably have to use the Unknown content type for those, and as you said, that will cause you other issues.  The other option (likely with similar issues) is to enable the option in the Autoswitch section under music to have AP treat any stream with no audio details as music (I think that's way I did to get the Radio addon to work).  Unfortunately it looks like you're doing lots of things that fall into the "unknown" category, so it just might not be possible to split them.  If you could post a link to a debug log where you are starting a game, maybe I can add support for routing game sounds.  I've honestly never looked at that.

I'd have to see a debug log (with both Kodi and Audio Profiles debug on) for your third issue.  I don't use the web interface or Kore to initiate playback, and on the surface I can think of no reason why either of those would cause Kodi to play the playlist in a different way.
Reply
#79
I have a little problem: i have profile that is auto enabled by PVR. Sometimes while playing live tv i want to switch to an other profile. This works with the select dialog, but it is immediately switched back to the auto PVR profile.
Reply
#80
(2020-07-28, 21:06)puenktchen Wrote: I have a little problem: i have profile that is auto enabled by PVR. Sometimes while playing live tv i want to switch to an other profile. This works with the select dialog, but it is immediately switched back to the auto PVR profile.
I am unable to duplicate this issue.  I will need you to post a link to a Kodi log with both Kodi and AudioProfiles debug logging enabled.
Reply
#81
(2020-07-28, 18:56)pkscout Wrote: I don't use the web interface or Kore to initiate playback, and on the surface I can think of no reason why either of those would cause Kodi to play the playlist in a different way.
@pkscout they use JSON API calls, and because of historic design "play" takes different routes through the code depending on how it is invoked, e.g. item click on nav screen, context menu item, keyboard shortcut, Python builtin call or JSON. It is something that needs rationalising one day, but it is non-trvial to unscramble that part of the spaghetti.
Reply
#82
(2020-07-28, 23:49)DaveBlake Wrote:
(2020-07-28, 18:56)pkscout Wrote: I don't use the web interface or Kore to initiate playback, and on the surface I can think of no reason why either of those would cause Kodi to play the playlist in a different way.
@pkscout they use JSON API calls, and because of historic design "play" takes different routes through the code depending on how it is invoked, e.g. item click on nav screen, context menu item, keyboard shortcut, Python builtin call or JSON. It is something that needs rationalising one day, but it is non-trvial to unscramble that part of the spaghetti.
Thanks for that context. I'll see if the log files (whenever the get posted) shed any light on changes I might need to make to adapt.
Reply
#83
(2020-07-28, 18:56)pkscout Wrote:
(2020-07-28, 16:52)A.T.E. Wrote: Hi, thanks @pkscout for maintaining this addon, which is necessary for my needs. Still I cannot make it work as I wished.
To make you understand, this is my setup:
  • Hardware: Raspberry Pi 2 with an additional sound card Hifiberry Dac+
  • Software: LibreELEC 9.2.1, Kodi 18.6, Audio Profiles 2.0.0
The HDMI is connected to the TV, the sound card is connected to an hifi amplifier; so Kodi should route the sound output of the video files to the HDMI and the sound output of the music files to the other sound card.
Therefore I have created two profiles, one for each audio device, with automatic switch. If it is an unknown content type, the audio is routed to the HDMI.

What's not working for me is music streams (Internet radios):
  • Almost (*) all the radio addons contents are not being recognized as music, and so they are wrongly routed to the HDMI output.
  • If I play a .strm containing a link to an Internet radio the sound is routed to the HDMI output.
  • If I play a playlist (.m3u) from the main TV interface the sound goes to the hifi, however if I play it from Kore or from the web interface the sound ges to the HDMI.
I could use a workaround to those issues by setting up the sound card as the output for the unknown content type, however if I do so then the sound of the Kodi games goes to the sound card instead of the HDMI (the desired behaviour).
Is there a way to fix my issue?

(*) I found a discontinued addon, but it is buggy.
Streams will almost never be identified by their media type, as many addons do not provide that information in a way that Kodi understands.  You'll probably have to use the Unknown content type for those, and as you said, that will cause you other issues.  The other option (likely with similar issues) is to enable the option in the Autoswitch section under music to have AP treat any stream with no audio details as music (I think that's way I did to get the Radio addon to work).  Unfortunately it looks like you're doing lots of things that fall into the "unknown" category, so it just might not be possible to split them.  If you could post a link to a debug log where you are starting a game, maybe I can add support for routing game sounds.  I've honestly never looked at that.

I'd have to see a debug log (with both Kodi and Audio Profiles debug on) for your third issue.  I don't use the web interface or Kore to initiate playback, and on the surface I can think of no reason why either of those would cause Kodi to play the playlist in a different way.

Log file: I have played a music file and then a game: http://ix.io/2sBk
It would definitely be great if there could be an AP auto switch entry for Games. If so, I could simply put the default (unknown) to the sound card, with Movies, Videos and Games (which is all that needs to TV on) going to HDMI, while everything that does not need the TV (Music and Radio) would go to the hi-fi system.
Reply
#84
(2020-07-29, 15:22)A.T.E. Wrote:
(2020-07-28, 18:56)pkscout Wrote:
(2020-07-28, 16:52)A.T.E. Wrote: Hi, thanks @pkscout for maintaining this addon, which is necessary for my needs. Still I cannot make it work as I wished.
To make you understand, this is my setup:
  • Hardware: Raspberry Pi 2 with an additional sound card Hifiberry Dac+
  • Software: LibreELEC 9.2.1, Kodi 18.6, Audio Profiles 2.0.0
The HDMI is connected to the TV, the sound card is connected to an hifi amplifier; so Kodi should route the sound output of the video files to the HDMI and the sound output of the music files to the other sound card.
Therefore I have created two profiles, one for each audio device, with automatic switch. If it is an unknown content type, the audio is routed to the HDMI.

What's not working for me is music streams (Internet radios):
  • Almost (*) all the radio addons contents are not being recognized as music, and so they are wrongly routed to the HDMI output.
  • If I play a .strm containing a link to an Internet radio the sound is routed to the HDMI output.
  • If I play a playlist (.m3u) from the main TV interface the sound goes to the hifi, however if I play it from Kore or from the web interface the sound ges to the HDMI.
I could use a workaround to those issues by setting up the sound card as the output for the unknown content type, however if I do so then the sound of the Kodi games goes to the sound card instead of the HDMI (the desired behaviour).
Is there a way to fix my issue?

(*) I found a discontinued addon, but it is buggy.
Streams will almost never be identified by their media type, as many addons do not provide that information in a way that Kodi understands.  You'll probably have to use the Unknown content type for those, and as you said, that will cause you other issues.  The other option (likely with similar issues) is to enable the option in the Autoswitch section under music to have AP treat any stream with no audio details as music (I think that's way I did to get the Radio addon to work).  Unfortunately it looks like you're doing lots of things that fall into the "unknown" category, so it just might not be possible to split them.  If you could post a link to a debug log where you are starting a game, maybe I can add support for routing game sounds.  I've honestly never looked at that.

I'd have to see a debug log (with both Kodi and Audio Profiles debug on) for your third issue.  I don't use the web interface or Kore to initiate playback, and on the surface I can think of no reason why either of those would cause Kodi to play the playlist in a different way.

Log file: I have played a music file and then a game: http://ix.io/2sBk
It would definitely be great if there could be an AP auto switch entry for Games. If so, I could simply put the default (unknown) to the sound card, with Movies, Videos and Games (which is all that needs to TV on) going to HDMI, while everything that does not need the TV (Music and Radio) would go to the hi-fi system.
Unfortunately it looks like the games just return a library type of unknown with the audio info. I had been hoping it would say something simple like 'game.'  I'll have to try and install a few games and see if there are any options, but for now it looks like no quick fix is coming.
Reply
#85
Thanks for this addon, @pkscout!  I run kodi via CoreELEC on an Odroid C2, trying to transition to a C4, and I think I'll need addon for my setup.

Does the addon receive any information regarding channel count at the start of music playback?  I note that your description of codec-based selection is always "video only".

For multi-channel audio (e.g., multi-channel FLAC), I'd like to be able to send the audio via HDMI, whereas all stereo music playback uses the Odroid Hi-Fi Shield.  I have the audio profiles set up nicely for movie playback (really straightforward now!), but stereo vs non-stereo music playback is still a hiccup.  I usually run the Odroid headless so the selection dialog isn't the most useful.  Alternatively, is it possible to select between Audio Profiles using an IR remote?  (I have a Logitech Harmony, so including an extra step for multi-channel playback could be an option.)

Thanks for any advice!
Reply
#86
(2020-08-08, 20:55)mblovell Wrote: Thanks for this addon, @pkscout!  I run kodi via CoreELEC on an Odroid C2, trying to transition to a C4, and I think I'll need addon for my setup.

Does the addon receive any information regarding channel count at the start of music playback?  I note that your description of codec-based selection is always "video only".

For multi-channel audio (e.g., multi-channel FLAC), I'd like to be able to send the audio via HDMI, whereas all stereo music playback uses the Odroid Hi-Fi Shield.  I have the audio profiles set up nicely for movie playback (really straightforward now!), but stereo vs non-stereo music playback is still a hiccup.  I usually run the Odroid headless so the selection dialog isn't the most useful.  Alternatively, is it possible to select between Audio Profiles using an IR remote?  (I have a Logitech Harmony, so including an extra step for multi-channel playback could be an option.)

Thanks for any advice!
Unfortunately I'm not able to get Kodi to tell me the number of channels in an audio file, at least not that I've found yet.  The call I use for getting the audiostream details of a video file errors out on an audio only file.

You could select an audio profile from an IR remote.  Take a look at the Audio Profiles wiki for the area that talks about switching profiles by keymap.

https://kodi.wiki/view/Add-on:Audio_Profiles

Basically you'd do that, but rather than a keyboard key, you'd map it to a remote key.  That can sometimes be tricky with a remote, and it depends alot on what kind of remote you have your harmony configured to emulate.  For instance, I have my Harmony setup to emulate a bluetooth keyboard, so my harmony mapping would look difference than someone emulating an MCE remote.
Reply
#87
Hi, 

stumbled over this perfect addon while searching for an audio switcher, one question can I switch through the profiles using kodi jsonrpc? And what would a json string look like?

Regards
Eldrik
Reply
#88
(2020-08-09, 04:19)pkscout Wrote: You could select an audio profile from an IR remote. 

Thanks, switching profiles via the remote is working great!  I already add activities (on the remote) set up for movie watching and multi-ch music, so I just added the profile switch as an additional setup step (switching back to stereo music afterwards).

I think I'll go experiment with a USB-attached DAC some as well, given how easy your addon makes it to change profiles.  Thanks again!

(Would it be possible for auto-switching mode to switch back to the previous profile at the end of media playback?  This capability, unfortunately, wouldn't help with the stereo-vs-multi channel music setup, but it may be helpful in some scenarios.)
Reply
#89
(2020-08-09, 04:19)pkscout Wrote: Unfortunately I'm not able to get Kodi to tell me the number of channels in an audio file, at least not that I've found yet.  The call I use for getting the audiostream details of a video file errors out on an audio only file.
Channels should be available via JSON in v19, for both player and songs in music library

For currently playing try
{"jsonrpc": "2.0", "id": 1, "method": "Player.GetProperties", "params": {"playerid": 0,"properties": ["audiostreams"] }}
results have a "channels" property.

Or for music library items use audioLibrary.GetSongs with "properties":["channels"] and whatever filter is appropriate.

Not sure if that is helpful @pkscout getting an addon to use JSON is up to you Smile
Reply
#90
(2020-08-09, 20:18)DaveBlake Wrote:
(2020-08-09, 04:19)pkscout Wrote: Unfortunately I'm not able to get Kodi to tell me the number of channels in an audio file, at least not that I've found yet.  The call I use for getting the audiostream details of a video file errors out on an audio only file.
Channels should be available via JSON in v19, for both player and songs in music library

For currently playing try
{"jsonrpc": "2.0", "id": 1, "method": "Player.GetProperties", "params": {"playerid": 0,"properties": ["audiostreams"] }}
results have a "channels" property.

Or for music library items use audioLibrary.GetSongs with "properties":["channels"] and whatever filter is appropriate.

Not sure if that is helpful @pkscout getting an addon to use JSON is up to you Smile
I'll take a look at that.  I'm just getting ready to update my dev machine to use Matrix by default.  I think I lookated at the audiostreams option before, and I thought it just listed all the streams in the file without indicating which one is playing.  But again, I'll take another look.  The good news is Audio Profiles already uses some json calls to get information, so adding another won't be a big deal if it gives me back something useful.
Reply
  • 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 17

Logout Mark Read Team Forum Stats Members Help
Audio Profiles (for Kodi 18 and later)0