Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Radio Stations" in Ampache #26

Open
GMGassner opened this issue Aug 9, 2021 · 11 comments
Open

"Radio Stations" in Ampache #26

GMGassner opened this issue Aug 9, 2021 · 11 comments
Labels
enhancement New feature or request needs info This issue did not provide enough information to reproduce

Comments

@GMGassner
Copy link

GMGassner commented Aug 9, 2021

Hi all,
thanks for your great work on this project. I have a small question/request.
Can I stream music via the "Radio Stations" in Ampache? I love Internet Radio und can't seem to find a way to get these working.
Version: Ampache 4.4.3-release
Thank you very much.

best regards

@memen45 memen45 added enhancement New feature or request needs info This issue did not provide enough information to reproduce labels Aug 9, 2021
@GMGassner
Copy link
Author

Thanks for the reply. Which kind of info do you need?

@GMGassner
Copy link
Author

image
This section of Music is meant by "Radio Stations". I can not use playliste because these can only hold permanent objects.

@memen45
Copy link
Owner

memen45 commented Aug 9, 2021

Not sure if it is possible to stream live radio. You would need a wifi or Bluetooth connection throughout your activity, so then you would have to bring your phone? And if you bring your phone, you might as well connect your head/earphones directly to your phone.

Or do I misunderstand your idea?

@GMGassner
Copy link
Author

Not sure if it is possible to stream live radio. You would need a wifi or Bluetooth connection throughout your activity, so then you would have to bring your phone? And if you bring your phone, you might as well connect your head/earphones directly to your phone.

Or do I misunderstand your idea?

You have not misunderstood the idea, it is exactly what I what to do. You also have a point by saying, " you might as well connect your head/earphones directly to your phone.", but i want to illustrate why it could be a asset.
In my gym we have WiFi everywhere. When you are mid workout it can be difficult to quickly grab the phone or change station when you are rowing, swimming or up on a bolder wall. Also in the SPA area, everything with a camera is strictly forbidden for privacy reasons.
This situations all happened often (especially the SPA one) and i wished to be able to just use my Venu 2 for this matter.
If i can help in any way to implement this feature would be nice.

@memen45
Copy link
Owner

memen45 commented Aug 9, 2021

Ah okay, yes that makes sense!

Of course any help is welcome and much appreciated, especially since I am short of time coming weeks. The following is for reference when I have some more time to look into it.

Research:

  • what kind of streams can Ampache deliver
  • Garmin SDK support for stream formats
  • Garmin SDK support standalone wifi (now defaults to Bluetooth tethering outside sync mode iirc)
  • what kind of streams can Subsonic API deliver

Implementation:

  • SubMusic Menu has to be extended with a 'Radiostations' tab
  • Ampache and Subsonic API request methods
  • Ampache and Subsonic Provider methods
  • additional integration (e.g. Playable, Radiostation Menu)

@GMGassner
Copy link
Author

GMGassner commented Aug 10, 2021

Thank you for considering my enhancement.

I will try to also be a helping hand as far as I'm able to.

Research:

  • what kind of streams can Ampache deliver:
    since you can specify in the radio station menue it seems to be quite flexible, but may be transcoding will be needed.
    Although most stations I know are mp3, which would work well with the Connect IQ API
  • Garmin SDK support for stream formats
    https://developer.garmin.com/connect-iq/api-docs/Toybox/Media.html
Name Value Since Description
ENCODING_INVALID 0 API Level 3.0.0 Invalid encoding type
ENCODING_ADTS 1 API Level 3.0.0 ADTS audio encoding type
ENCODING_MP3 2 API Level 3.0.0 MP3 audio encoding type
ENCODING_M4A 3 API Level 3.0.0 M4A audio encoding type
ENCODING_WAV 4 API Level 3.0.0 WAV audio encoding type
I guess MP3 is relevant and may be M4A, the other two are edge cases in my experience. (never seen a ADTS or WAV Station)

Implementation:

@memen45
Copy link
Owner

memen45 commented Aug 10, 2021

From the Ampache API docs I cannot find any reference to the radio stations feature, so I am not sure whether the feature is fully supported yet by Ampache. I have opened an issue: ampache/ampache#2987. Also as far as I know the Nextcloud music app does not support this feature (yet).

I think - but this depends on Ampache API specs too - the SubMusic app could use the HTTP_RESPONSE_CONTENT_TYPE_HLS_DOWNLOAD, but this would of course require testing.

@memen45
Copy link
Owner

memen45 commented Aug 12, 2021

Unfortunately, for now we have to wait as the radio stations feature has not yet been implemented in the Ampache API.

Looking forward to see SubMusic support radio stations in the future and thanks a lot for bringing in the idea!

@GMGassner
Copy link
Author

Unfortunately, for now we have to wait as the radio stations feature has not yet been implemented in the Ampache API.

Looking forward to see SubMusic support radio stations in the future and thanks a lot for bringing in the idea!

I tried to find a workaround with Ampache API, but regarding this API we really have to wait.
Is there anything holding back a SubSonic implementation? From what i saw it might be feasable and you can use SubSonic API in Ampache as a fallback. Which would make it work.
If you are interestet in creating a SubSonic API Internet Radio plugin I would try to gather as much information as I can. Maybe assist coding if you allow it (but i only know Python and a little Java).

@memen45
Copy link
Owner

memen45 commented Aug 18, 2021

Most of the Monkey C is just a simple version of javascript with some specifics or workarounds to get things working. Implementation should be possible I think. I am also thinking now that streaming could be implemented for all resources. In case you have wifi available, you might as well stream songs instead of waiting for the whole sync to complete. At least the subsonic API seems to support this (HLS, not sure about Ampache though).

Not sure if it is possible to download files while not in Sync mode (iirc this was not possible, but might have changed). Also I have not tested HLS streams at all, so not sure how they behave.

Unfortunately, I will not have time to work on this shortly. Of course help is appreciated and I can review PRs and give feedback if needed! I will make a separate issue for the 'streaming everything' idea, as it is different from this one.

@GMGassner
Copy link
Author

Most of the Monkey C is just a simple version of javascript with some specifics or workarounds to get things working. Implementation should be possible I think. I am also thinking now that streaming could be implemented for all resources. In case you have wifi available, you might as well stream songs instead of waiting for the whole sync to complete. At least the subsonic API seems to support this (HLS, not sure about Ampache though).

Not sure if it is possible to download files while not in Sync mode (iirc this was not possible, but might have changed). Also I have not tested HLS streams at all, so not sure how they behave.

Unfortunately, I will not have time to work on this shortly. Of course help is appreciated and I can review PRs and give feedback if needed! I will make a separate issue for the 'streaming everything' idea, as it is different from this one.

Thank you very much for esaclating to 'streaming everything'. I wanted to propose that, but I thought it would be to difficult or ridiculous. But It Would love it to have WiFi enabled, logged in at the gym and just listen to my favorite internet radio station. Like a .m3u or .pls streamer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs info This issue did not provide enough information to reproduce
Projects
None yet
Development

No branches or pull requests

2 participants