xbmc / Kore

Kore is a simple and easy-to-use Kodi remote.
Apache License 2.0
647 stars 244 forks source link

[Feature Request] Stream Audio through kore #142

Open pw-sys opened 8 years ago

pw-sys commented 8 years ago

It would be great if you could stream the audio through kore so you can use headphones without having a cable

ThiefMaster commented 8 years ago

:+1:

While it might not be within the scope of kodi I'd love to see this feature, simply because most android media players that can play files from remote locations are trash. Being able to create a playlist with files stored in kodi and then stream them to my phone would be great.

cromulentbanana commented 8 years ago

I'm working on this feature, as well as video. I have a partially working prototype for movies implemented in my own development branch: https://github.com/cryptobanana/Kore/tree/stream_video

I plan to finish this functionality for videos and audio in my free time over the holidays and submit a pull request soon.

jondo commented 8 years ago

This is a duplicate of #125.

pw-sys commented 8 years ago

No I don't want kodi to stream media, just want to use kore like the xbox controller as an wireless audio cable

cromulentbanana commented 8 years ago

Hi, I have a proof-of-concept implementation (in progress) in my forked repository that allows a Kore remote to play TV and Videos locally on the remote device (as opposed to the kodi media center). The user interface is implemented by repurposing the "download" button in the TvShowEpisodeDetails and MovieDetails views. Audio would be a next step. I'm not yet ready to issue a pull request because it requires more iteration + cleanup, but feel free to try it yourself:

https://github.com/cryptobanana/Kore/tree/stream_video

@pw-sys I'm not sure I understand exactly what you're describing. Could you please elaborate on what you mean by "use kore like the xbox controller as an wireless audio cable"?

tuxevil commented 8 years ago

If i understood what he wants or at least what i would love to have Is to get the audio from what we are watching and controlling using Kore through kore so we can heard the movie or tv series quietly using our cellphones earphones and not bothering anyone else

jondo commented 8 years ago

Ah, @tuxevil, that makes sense.

pw-sys commented 8 years ago

Yeah - that is what I want

MikeyMoMo commented 8 years ago

I assumed this was already available because of the little headphone ICON at the bottom of the screen but it does something else. Not exactly sure what but it brings up a form on-screen.

This is exactly what I would really like. Hear the audio through headphone connected to my Android phone so I can look at movies late night in the bedroom without waking the sleeping body next to me (and thereby incurring MAJOR WRATH!)

The function could be called Listen Locally or something similar. Excellent upgrade for this good software.

jondo commented 7 years ago

@cryptobanana, don't you want to follow up on this?

MikeyMoMo commented 7 years ago

Been 9 months since last update. Any further?

axelsimon commented 7 years ago

@MikeyMoMo I may have read too fast, but I believe this pull request and related conversation would answer that question: https://github.com/xbmc/Kore/pull/301

MikeyMoMo commented 7 years ago

I looked at that and it is talking about playing remotely on the phone. I can already do all of that I need. I want the TV to do the video and the audio ONLY to come to the phone. I don't see any reference to that in the link you provided. I will look again but I saw nothing. Of course, I can miss things like the Empire State Building while walking right past it!

madcowGit commented 6 years ago

I'd love to have this feature. I think the Roku's have this feature

jediafr commented 6 years ago

I'm searching for a way to do that exactly : Switch Kodi Audio on the Phone/tablet (video remains on the big screen). Ok tried a few things on Linux. Pulseaudio broadcast in Raw mode : it is gobbing to much bandwidth to be useful. Vlc broadcast : that one works well but introduces a delay between the movie on the screen and the audio received on the phone).

desbma commented 6 years ago

@jediafr I'm interested in this too, care to elaborate on what you tried exactly? Have you read this page: https://wiki.archlinux.org/index.php/PulseAudio/Examples#PulseAudio_over_network ? How did you read the audio on Android?

The maximum delay that is not perceptible is ~30ms, so transmitting over TCP on a local Wifi could work.

But the codec has to have special properties:

So I think Opus could be a candidate.

A chain of : PulseAudio ---> ffmpeg encoding to Opus low delay ---TCP---> A client on Android could work, what do you think?

tavomaciel commented 6 years ago

@desbma Latency is actually not an issue, since Kodi can adjust audio/video Latency with a lot of ease. So even if the codec/format does introduce it, you can reduce back.

This could maybe even be done automatically. Issuing a ping and measuring the Latency, then applying the negative value.

jediafr commented 6 years ago

"Latency is actually not an issue, since Kodi can adjust audio/video Latency" my thoughts exactly but I got the reality wall in the shape of freezes when I introduced an offset in kodi to compensate for the encoding delay... I have to test this extensively but on HEVC i couldnt offset by more than a second whilst I needed 2.5 dec roughly.

Sent from my Samsung Galaxy smartphone. -------- Original message --------From: Gustavo Maciel notifications@github.com Date: 31/05/2018 03:52 (GMT+01:00) To: xbmc/Kore Kore@noreply.github.com Cc: jediafr jediafr@gmail.com, Mention mention@noreply.github.com Subject: Re: [xbmc/Kore] [Feature Request] Stream Audio through kore (#142) @desbma Latency is actually not an issue, since Kodi can adjust audio/video Latency with a lot of ease. So even if the codec/format does introduce it, you can reduce back. This could maybe even be done automatically. Issuing a ping and measuring the Latency, then applying the negative value.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread. {"@context":"http://schema.org","@type":"EmailMessage","potentialAction":{"@type":"ViewAction","target":"https://github.com/xbmc/Kore/issues/142#issuecomment-393376034","url":"https://github.com/xbmc/Kore/issues/142#issuecomment-393376034","name":"View Issue"},"description":"View this Issue on GitHub","publisher":{"@type":"Organization","name":"GitHub","url":"https://github.com"}} {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/xbmc/Kore","title":"xbmc/Kore","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/xbmc/Kore"}},"updates":{"snippets":[{"icon":"PERSON","message":"@tavomaciel in #142: @desbma Latency is actually not an issue, since Kodi can adjust audio/video Latency with a lot of ease. So even if the codec/format does introduce it, you can reduce back.\r\n\r\nThis could maybe even be done automatically. Issuing a ping and measuring the Latency, then applying the negative value."}],"action":{"name":"View Issue","url":"https://github.com/xbmc/Kore/issues/142#issuecomment-393376034"}}} { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "37567f93-e2a7-4e2a-ad37-a9160fc62647", "title": "Re: [xbmc/Kore] [Feature Request] Stream Audio through kore (#142)", "sections": [ { "text": "", "activityTitle": "Gustavo Maciel", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@tavomaciel", "facts": [

] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"xbmc/Kore\",\n\"issueId\": 142,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"xbmc/Kore\",\n\"issueId\": 142\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/xbmc/Kore/issues/142#issuecomment-393376034" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 112927973\n}" } ], "themeColor": "26292E" }

axelsimon commented 6 years ago

The maximum delay that is not perceptible is ~30ms, so transmitting over TCP on a local Wifi could work.

I don't think I've ever seen that done, especially over Wifi. But maybe Opus can pull that off. I haven't tried in years, but with Pulseaudio's native protocol I just couldn't play on two computers in sync, there was always a very noticeable delay between both computers, even though they were using wired network connections.

One of the only ways to make sure audio and video keep playing in sync is to have a clock mechanism to ensure the video and sound know when to play. As @tavomaciel was saying, we play with video playback and delay/drop frames if the audio is taking a while to be played elsewhere. But that won't be very nice to watch.

The way snapcast does it is the following, if I'm not mistaken: send out sound packets, each marked with the exact time at which they should be played (using a precise clock). If a packet is there on time, play it. If it isn't, drop it. If the receiver (mostly) receives data faster than is needed to play it, things work out and the sound plays in sync. If you can't receive/send fast enough, the receiver never gets packets on time and never "hooks" on the sound feed: no sound. The snapcast way of doing things makes it possible to have a buffer too. You can start sending sound to be played "in X ms" and then start the video to play "in X ms". Effectively, you add a delay to playback startup, but you gain a buffer.

EnerGeh commented 6 years ago

Guys, I never thought about an idea like that, but since I've read that thread a couple of days ago, I can't get that out of my head! What an awsome idea to use a mobile device like Smartphone or Tablet as a "private" (=silent) audio player when watching movies on the big screen!

I think the "snapcast way" will be worth a try, who cares about a delayed started movie when having that impressive new feature!?!

desbma commented 6 years ago

Running on a Linux PC playing audio (find device number with pactl list sources): ffmpeg -re -f pulse -i DEVICE_NUMBER -c:a libopus -b:a 64k -f rtp rtp://CLIENT_IP:1234 Then saving the SDP output that ffmpeg prints to a .sdp file on the client PC on the same network, and then running : mpv --no-cache --untimed --no-demuxer-thread SDP_FILE I can then stream audio transparently.

The good:

The bad : I get ~500ms audio latency

miguelnog19 commented 5 years ago

It would be great if you could stream the audio through kore so you can use headphones without having a cable

Use this https://audiorelay.net/

desbma commented 5 years ago

Visit https://audiorelay.net to install the server on your PC. At the moment, only Windows is supported.

Showstopper for me.

BalooRJ1 commented 4 years ago

Does anyone know if this is still a potential possibility for Kore? Would be a great feature.

KenFromPgh commented 1 year ago

+1 would love to see this feature in the app (or otherwise)