wackerl91 / luna

Moonlight Launcher for Kodi
GNU General Public License v3.0
100 stars 22 forks source link

Can't change audio device to Analog. #128

Open Zelaf opened 7 years ago

Zelaf commented 7 years ago

Expected Behaviour: To be able to change audio output to Analog so I can use our better speakers.

Actual Behaviour: Can't change from HDMI.

I want to be able to change from HDMI output to Analog output but I can't find out how, I know of the -audio flag but I'm not sure how to use it with Luna. On a sidenote, the audio quality seems to be terrible, Not sure if this is because of my TV speakers but I don't think it is. I'm using wireless even tho I know I shouldn't but it's the only way for me to use it on the TV downstairs.

Thanks for any help :)

wackerl91 commented 7 years ago

Thanks for your report. Switching the audio device should be possible by using the "Audio Configuration" option in Luna. While this works for external devices (e.g. USB sound cards / headsets), it doesn't seem to work for switching from HDMI to analog (even though both should be shown and - at least in my case - assign the proper device ID internally). When starting a stream this uses moonlight's audio switch (by placing the proper key / value pair in the config file). However, switching between HDMI and analog doesn't work for me when starting a stream from command line either - the only option for me to use analog audio during the streams is to set the default output to analog (via terminal) and leave the audio configuration at "system default".

I can't really comment on the audio quality as of now - at least my TV speakers are terrible which is why I never use them. In your case this might also be induced by a low bitrate due to the WiFi connection, which can be easily tested by upping the bitrate and hoping for the best (note that this might also result in not-so-smooth gameplay, depending on how good your WiFi is).

Zelaf commented 7 years ago

How do I set the default output in terminal?

wackerl91 commented 7 years ago

Try this - especially the part using amixer. If this doesn't work I'll need to have a look at my scripts when I'm back at home.

Zelaf commented 7 years ago

It worked, sorry for not giving feedback but I don't think it's an optimal solution for end users.

wackerl91 commented 7 years ago

No worries, was just doing some house keeping on the issues ;)

I do agree about this not being an optimal solution, yet there's only so much I can do about that and that's pretty much passing the proper device to moonlight. In general moonlight's audio switch works, as there have been reports from others (using moonlight on command line) that they were able to switch between HDMI and analog using the -audio parameter, and selecting a USB audio device inside Luna does work as well. I'm not sure why especially this case doesn't, given that the proper values (hw0:0 and hw0:1 for analog / HDMI respectively) should be passed to moonlight. I'll come back to this at some point and have a look at the audio HW IDs that are actually written to the settings file ... but if they're correct I'm pretty much out of ideas.

Zelaf commented 7 years ago

I agree with coming back to this later as it shouldn't be much of a priority at the moment, I reinstalled OSMC and there seems to be other issues at hand right now. But I know this program/script/thing is gonna be amazing in the future.

wackerl91 commented 7 years ago

there seems to be other issues at hand right now

Anything that's not already reported? Just curious, as I'm fixing a lot of the smaller stuff right now and could squeeze something in if it's not too much work :)

Zelaf commented 7 years ago

Nothing breaking but there seems to be some things I have to do twice before it working.

wackerl91 commented 7 years ago

Well, if you can identify specific parts where this occurs please open another issue and let me know, all right? Thank you so much!

Zelaf commented 7 years ago

I will!