Giter Site home page Giter Site logo

Support for Noxon 2 Audio? about xonox HOT 30 CLOSED

bartgrefte avatar bartgrefte commented on July 29, 2024
Support for Noxon 2 Audio?

from xonox.

Comments (30)

bartgrefte avatar bartgrefte commented on July 29, 2024 1

Woops, completely missed the new replies....

According to the "Technical Data" document of Noxon 2 Audio MP3 (up to 320 kBit/s with cbr/vbr) and WMA-9 are supported. But the manual states that AAC+ is supported too.

I don't know much about AAC. As I understand it, it is a family of coding methods. Therefore, there may be decoders that are only compatible with one specific method and not the entire family. AAC+ is the trade name for HE-AAC v1. Maybe it works if you set FFMPEG to this specific method?

That's worth a shot, making a note to test that, but even if that works, why won't mp3 work? Getting the exact same error. Can't even tell for sure from which side the connection is terminated (ffmpeg or the Noxon).

@bartgrefte: I released v1.1.0 today that adds support for Noxon 2 Audio devices. Do you think that we can close this issue now?

Thanks :) , I'll try it later when it's not a busy week.

I guess this issue can be closed. I'll let you know if I can track down the ffmpeg issue, if I can find a way to solve that, any internet radio can be converted to a codec the Noxon supports :)

from xonox.

x789 avatar x789 commented on July 29, 2024

Hey @bartgrefte, sorry for the long wait.
I have no Noxon 2 and therefore cannot do any tests on my side. But have you tried to set up a xonox-instance and to redirect the domains radio567.vtuner.com and radio5672.vtuner.com to the xonox-server?
If that doesn't work, do you have a way and the know-how to record the radio's connection attempts?

from xonox.

bartgrefte avatar bartgrefte commented on July 29, 2024

No worries, I've got patience ;)

Just now I tried to set up a xonox-server on a Debian 12 VM. Since pip install xonox indicated I need a virtual environment I set that up, then installed xonox in it.

Then I used PiHole to direct those domain names to the IP-address of the Debian VM, followed by poking a hole in the firewall on my router-pc (the Noxon is in a separate VLAN) and then I tried to start the xonox-server using /home/bart/py_venv/bin/python -m xonox

This results in

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/bart/py_venv/lib/python3.11/site-packages/xonox/__main__.py", line 6, in <module>
    from xonox import server
  File "/home/bart/py_venv/lib/python3.11/site-packages/xonox/server.py", line 22, in <module>
    class ObjectToJsonStringEncoder(json.JSONEncoder):
                                    ^^^^^^^^^^^^^^^^
AttributeError: module 'flask.json' has no attribute 'JSONEncoder'

from xonox.

x789 avatar x789 commented on July 29, 2024

😯
Let's check which version of Flask is active. What is the result of pip list --local when you run it in the virtual environment?

from xonox.

bartgrefte avatar bartgrefte commented on July 29, 2024
/home/bart/py_venv/bin/pip list --local
Package      Version
------------ -------
blinker      1.6.3
click        8.1.7
Flask        3.0.0
itsdangerous 2.1.2
Jinja2       3.1.2
MarkupSafe   2.1.3
pip          23.0.1
setuptools   66.1.1
Werkzeug     3.0.0
xonox        0.0.7.2

So 3.0.0, which apparently is quite recent, I always thought that Debian was a bit behind because of the long time that's being spend for testing (which is why I love Debian's stability :) )
edit: Oh wait, that's with apt, this was installed with pip, guess that's more uptodate.

from xonox.

x789 avatar x789 commented on July 29, 2024

I identified the issue and can reproduce it locally. When xonox is installed via pip, it installs the 'latest' version of Flask and Werkzeug. There seems to be a breaking change in these modules between v2.3 and v2.2 (that is compatible with xonox).

For the time being, you can downgrade Flask and Werkzeug in your virtual-environment to get xonox working:

pip install --force-reinstall "Flask==2.2.5"
pip install --force-reinstall "Werkzeug==2.2.3"

I will now work on an update so that this workaround will not have to be used for much longer.

Thank you @bartgrefte for reporting the issue.

from xonox.

bartgrefte avatar bartgrefte commented on July 29, 2024

Check, that solves the error, thanks :)

Now to figure out what I've got running on port 80 (won't start because port is in use), been a while since I used this VM so no clue right now what it could be.

edit:
@x789
Opening favorites menu:
192.168.4.51 - - [27/Oct/2023 11:31:51] "GET /setupapp/radio567/asp/BrowseXPA/loginXML.asp?token=0 HTTP/1.1" 404 -
192.168.4.51 - - [27/Oct/2023 11:31:51] "GET /setupapp/radio567/asp/BrowseXPA/loginXML.asp?token=0 HTTP/1.1" 404 -
Noxon waiting with loading indicator for timeout

Opening internet radio and podcasts menu same:
192.168.4.51 - - [27/Oct/2023 11:32:53] "GET /setupapp/radio567/asp/BrowseXPA/LoginXML.asp?token=0 HTTP/1.1" 404 -
192.168.4.51 - - [27/Oct/2023 11:32:53] "GET /setupapp/radio567/asp/BrowseXPA/LoginXML.asp?token=0 HTTP/1.1" 404 -

Is that output to be expected when not having done any config in xonox?

from xonox.

x789 avatar x789 commented on July 29, 2024

That output has nothing to do with a non-existing configuration. It is somewhat 'by design' since the Noxon iRadio uses different endpoints.
I will try to create a version that supports the endpoints you mentioned. Stay tuned...

from xonox.

bartgrefte avatar bartgrefte commented on July 29, 2024

@x789 Thanks :)

from xonox.

x789 avatar x789 commented on July 29, 2024

@bartgrefte: I created a package and uploaded it to Test-PyPI for you to try it out.

  1. Make sure that radio567.vtuner.com and radio5672.vtuner.com point to xonox' ip. (I think you already did this.)
  2. Install the preview version: pip install -i https://test.pypi.org/simple/ xonox==1.1.0.dev1

I suspect that this version will not support favorites or preset buttons. We'll have a closer look on that once you can hear at least one radio station.

from xonox.

x789 avatar x789 commented on July 29, 2024

@bartgrefte: I have made a small but serious mistake. Please try v1.1.0.dev2:

pip install -i https://test.pypi.org/simple/ xonox==1.1.0.dev2

from xonox.

bartgrefte avatar bartgrefte commented on July 29, 2024

@bartgrefte: I have made a small but serious mistake. Please try v1.1.0.dev2:

pip install -i https://test.pypi.org/simple/ xonox==1.1.0.dev2

Unfortunately getting the same 404's as before.

from xonox.

x789 avatar x789 commented on July 29, 2024

I had another look on the API spec... There was a typo in the endpoint definition. Please check out v1.1.0.dev3

pip install -i https://test.pypi.org/simple/ xonox==1.1.0.dev3

from xonox.

bartgrefte avatar bartgrefte commented on July 29, 2024

@x789
Favorites: 404
Internet Radio: http 200 :)
Podcast: 404

from xonox.

x789 avatar x789 commented on July 29, 2024

That are good news!
Can you tell me the log-lines that contain the 404s when you try to access the favorites?

from xonox.

bartgrefte avatar bartgrefte commented on July 29, 2024

@x789
Favorites:
192.168.4.50 - - [14/Nov/2023 16:57:36] "GET /setupapp/radio567/asp/BrowseXPA/loginXML.asp?token=0 HTTP/1.1" 404 -
192.168.4.50 - - [14/Nov/2023 16:57:36] "GET /setupapp/radio567/asp/BrowseXPA/loginXML.asp?token=0 HTTP/1.1" 404 -

Podcasts:
192.168.4.50 - - [14/Nov/2023 16:58:29] "GET /setupapp/radio567/asp/BrowseXPA/loginXML.asp?token=0 HTTP/1.1" 404 -
192.168.4.50 - - [14/Nov/2023 16:58:29] "GET /setupapp/radio567/asp/BrowseXPA/loginXML.asp?token=0 HTTP/1.1" 404 -

So the same as before.

from xonox.

x789 avatar x789 commented on July 29, 2024

Thank you for your patience. The radio calls loginXML.asp or LoginXML.asp, depending on the requested functionality. 🫣
There is an updated v1.1.0.dev4 thats wait for your test:

pip install -i https://test.pypi.org/simple/ xonox==1.1.0.dev4

Unfortunately, the favorites are not covered by cweiskes API documentation. I guess there is no difference in the data format between the iRadios and the Noxon2, but maybe in the called endpoints. Please provide me the log line when you encounter a 404 when you try to load or save a favorite (using a preset button). So far, xonox only supports favorites linked to preset-buttons.

from xonox.

bartgrefte avatar bartgrefte commented on July 29, 2024

@x789
"Thank you for your patience"
And thank you for offering support :)

Opening the favorites menu now results in

192.168.4.50 - - [16/Nov/2023 10:18:03] "GET /setupapp/radio567/asp/BrowseXPA/loginXML.asp?token=0 HTTP/1.1" 200 -
192.168.4.50 - - [16/Nov/2023 10:18:04] "GET /setupapp/radio567/asp/BrowseXML/FavXML.asp?empty=&sFavName=My__Favorites&mac=3D72C7FB748B9CD86176A5238603A24E&fver=3.8.36.6923&dlang=eng&hwid=158&startitems=1&enditems=10 HTTP/1.1" 404 -
192.168.4.50 - - [16/Nov/2023 10:18:04] "GET /setupapp/radio567/asp/BrowseXML/FavXML.asp?empty=&sFavName=My__Favorites&mac=3D72C7FB748B9CD86176A5238603A24E&fver=3.8.36.6923&dlang=eng&hwid=158&startitems=1&enditems=10 HTTP/1.1" 404 -

and podcasts in

192.168.4.50 - - [16/Nov/2023 10:19:42] "GET /setupapp/radio567/asp/BrowseXPA/navXML.asp?gofile=S-ByLocation&mac=3D72C7FB748B9CD86176A5238603A24E&fver=3.8.36.6923&dlang=eng&hwid=158&startitems=1&enditems=10 HTTP/1.1" 404 -
192.168.4.50 - - [16/Nov/2023 10:19:42] "GET /setupapp/radio567/asp/BrowseXPA/navXML.asp?gofile=S-ByLocation&mac=3D72C7FB748B9CD86176A5238603A24E&fver=3.8.36.6923&dlang=eng&hwid=158&startitems=1&enditems=10 HTTP/1.1" 404 -

So different then last time.

As for preset buttons, uhm, if the Noxon 2 Audio supports that, there don't seem to be any stored under the number-buttons on the remote.

from xonox.

x789 avatar x789 commented on July 29, 2024

Hey @bartgrefte, my Noxon radio that does not support the favorite list. Hence, I have no device that I can use to develop support for that feature.
Since your remote has preset buttons, you can try to use that feature of xonox. After you have selected a radio station, press one of the preset buttons for a longer time (~2secs). On my device, it then creates a preset. If it does not work, have a look on the logs. Maybe the endpoint ony differs slightly from the one my iRadio uses.

from xonox.

bartgrefte avatar bartgrefte commented on July 29, 2024

@x789 Ah, okay, that would make it difficult to test that feature, it's not necessary though, don't even remember ever using the favorites list anyway 📦 Just thought I'd mention it and see if it would work.

Anyway, now to figure out how to get a list of radio-channels, I recall there being - when the infrastructure was still up - categories (genre and country), is there any way of getting something (close to) like that?

Did get a tip from someone: https://www.radio-browser.info/ , which comes with an API: https://api.radio-browser.info/ I'm curious if that can be combined somehow to generate a radiolist similar to what there used to be :)

from xonox.

x789 avatar x789 commented on July 29, 2024

When I started working on xonox, I briefly considered integrating a connection to Radio-Browser. However, since I only listen to about 10 stations, I decided against the effort of integrating a 3rd party API and opted for a locally maintained station list.
Theoretically, you can extend xonox with a connection to Radio Browser, but I have to disappoint you that I don't have the time to do that. If you would like to work on a corresponding extension, your code contributions are welcome. :-)
There is another alternative backend for devices based on vTuner (the original radio provider for Noxon): yCast It's not compatible with the Noxon iRadio, but maybe you'll have luck with your Noxon 2 Audio?

from xonox.

bartgrefte avatar bartgrefte commented on July 29, 2024

"If you would like to work on a corresponding extension, your code contributions are welcome. :-)"
I doubt my level of coding comes close to be able to do that ;)

"There is another alternative backend for devices based on vTuner (the original radio provider for Noxon): yCast It's not compatible with the Noxon iRadio, but maybe you'll have luck with your Noxon 2 Audio?"
Hmm, making a note to test that one, thanks for the tip :)
edit: @x789 quick test
"ERROR: Unhandled upstream query (/setupapp/radio567/asp/BrowseXPA/LoginXML.asp)"

from xonox.

bartgrefte avatar bartgrefte commented on July 29, 2024

@x789 I've been thinking about
"Please note that streamUrl needs to point to the MP3 stream and not to a playlist (M3U). If you don't know how to get this information for your favorite station, have a look at station list of the RadioBrowser project. Remember that the Noxon(tm) iRadios do not support HTTPS. Therefore you need to supply an HTTP-URL."

Not sure about the https bit yet (though I have had some experience with Apache acting as a bridge between a server that does only http and serve https on client side, but that's web-page not streaming), but I have had a thought about the limited format/codec support.

In a VM with Debian I installed ffmpeg and ran this command:
ffmpeg -i http://mscp2.live-streams.nl:8100/flac.flac -codec:a libmp3lame -listen 1 -f mp3 http://IPofDebianVM:9001
and then opened up VLC and opened stream http://IPofDebianVM:9001.

Input: Flac
Output playing in VLC: Mp3

So I added that url to xonox and tried the Noxon:
"Connection down"
Ffmpeg:

Input #0, ogg, from 'http://mscp2.live-streams.nl:8100/flac.flac':
  Metadata:
    icy-br          : 128
    icy-description : Flac Radio
    icy-genre       : Pop
    icy-name        : Hi Online
    icy-private     : 0
    icy-pub         : 1
    icy-url         : http://www.hionline.eu
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
Stream mapping:
  Stream #0:0 -> #0:0 (flac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to 'http://192.168.1.216:9001':
  Metadata:
    icy-br          : 128
    icy-description : Flac Radio
    icy-genre       : Pop
    icy-name        : Hi Online
    icy-private     : 0
    icy-pub         : 1
    icy-url         : http://www.hionline.eu
    TSSE            : Lavf59.27.100
  Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p
    Metadata:
      encoder         : Lavc59.37.100 libmp3lame
av_interleaved_write_frame(): Broken pipeN/A speed=   0x
    Last message repeated 4 times
Error writing trailer of http://192.168.1.216:9001: Broken pipe
size=      19kB time=00:00:01.30 bitrate= 119.2kbits/s speed=18.3x
video:0kB audio:21kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[http @ 0x561a0bc25480] URL read error: End of file
Error closing file http://192.168.1.216:9001: End of file
Conversion failed!

Was hoping that would work for anything not mp3....

from xonox.

x789 avatar x789 commented on July 29, 2024

Hi @bartgrefte,
xonox does not retrieve the radio stream itself, but forwards the URL to the radio, which then retrieves the content from the address. When do you get the broken-pipe error? When the radio tries to open the station or shortly after you have started ffmpeg?

On the other hand, maybe you don't have to take the ffmpeg detour at all.
If I've got it right, you want to listen to "Hi On Line Radio - Pop". They also offer an MP3 stream via HTTP. (http://mediaserv30.live-streams.nl:8086/live)
I proceeded as follows:
First I searched RadioBrowser for "hi on line radio". From the list of results, I then clicked on the "Pop" entry with the "MP3" tag. The URL (second line) is the address of the stream to be used as streamUrl.
(If you want to test whether you have found the right station, you can also click on "Play" in the search results in RadioBrowser. The station will then be played).

In case I picked the wrong radio station and you want to use ffmpeg: Normally from a VM, ffmpeg should not be able to open a port on the host. If 192.168.1.216 is the host IP, you have to point ffmpeg to the internal IP of the VM and connect the internal and external IP within your virtualization.

from xonox.

bartgrefte avatar bartgrefte commented on July 29, 2024

@x789
"'xonox does not retrieve the radio stream itself, but forwards the URL to the radio, which then retrieves the content from the address"
Yep, I know, I had xonox send the url with the IP and port used by ffmpeg.

"When do you get the broken-pipe error? When the radio tries to open the station or shortly after you have started ffmpeg?"
The second I try to open the stream on the Noxon, if I do this with VLC there's no problem and the conversion of the stream works without problems.

"If I've got it right, you want to listen to "Hi On Line Radio - Pop". "
That was just a test, I tried the first non-mp3 stream I could find to see if my thought has any change of working, well it does with VLC.

"Normally from a VM, ffmpeg should not be able to open a port on the host. If 192.168.1.216 is the host IP, you have to point ffmpeg to the internal IP of the VM and connect the internal and external IP within your virtualization."
That IP is the (local) IP of the host where ffmpeg is running on. Initially I ran the ffmpeg command with 127.0.0.1 but that won't make it available over LAN, with the 192 IP it does. The VLC install I used to test the conversion of the stream is running on a different host (in the same subnet) and can connect without problems and it receives the converted stream as mp3. The Noxon is in a different subnet, but has access to the Debian host, so the router's firewall shouldn't be causing the immediate connection drop.

Do you happen to have any specific details in what the Noxon supports? The manual does not specify CBR/VBR, max height of the bitrate, etc. Maybe it's as simple as that.

edit:
@x789 I just had another look at VLC, it's not exactly mp3 (thought it was), says MPEG Audio Layer 1/2 (mpga), any chance the Noxon has issues with that?

edit2: same error when using aac (supported according to manual):

Stream mapping:
  Stream #0:0 -> #0:0 (flac (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, adts, to 'http://192.168.1.216:9001':
  Metadata:
    icy-br          : 128
    icy-description : Flac Radio
    icy-genre       : Pop
    icy-name        : Hi Online
    icy-private     : 0
    icy-pub         : 1
    icy-url         : http://www.hionline.eu
    encoder         : Lavf59.27.100
  Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc59.37.100 aac
av_interleaved_write_frame(): Broken pipeN/A speed=N/A
    Last message repeated 2 times
Error writing trailer of http://192.168.1.216:9001: Broken pipe
size=       3kB time=00:00:00.27 bitrate=  92.2kbits/s speed=5.18x
video:0kB audio:4kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[http @ 0x55ad34f06800] URL read error: End of file
Error closing file http://192.168.1.216:9001: End of file
[aac @ 0x55ad34f05b80] Qavg: 162.487
Conversion failed!

immediately after connect by Noxon (which again says connection down), VLC works fine here as well..

from xonox.

bartgrefte avatar bartgrefte commented on July 29, 2024

@x789 This is weird, to rule out wifi as the cause of the connection problem with ffmpeg, I hooked it up using a network cable, there it got full internet access (not limited by PiHole's whitelist and no redirect to this project) and it just works like it did a decade ago?!

I thought the Noxon-infrastructure was long gone? The domainnames didn't seem to work, but the infrastructure seems to be still there. There are dead entries, but still, it works.
Speaking of dead entries, there are quite a few on https://www.radio-browser.info/ , ended up adding some code to a python script that checks if HTTP 200 (as in exists).

.... and switching to network cable didn't solve the connection problem with ffmpeg.

from xonox.

Hack5190 avatar Hack5190 commented on July 29, 2024

My iRadio is running Firmware-Version 3.8.36.6923, Bootloader-Version 6834 (available here http://ultron.info/NOXON/NOXON_iRadio/Update/Beta/).

The iRadio DNS queries radio567.vtuner.com, radio5672.vtuner.com, www.terratec.com and www.my-noxon.com - there are NO DNS queries to noxonserver.eu. These domains are being redirected (via PiHole).

Using another tool I was able to monitor the iRadio web requests. Initially I suspected the issue was related to the domain name or a configuration issue, but after further investigation it appears the iRadio is requesting a different URL that the one in your code.

Here are the 3 online queries and the URL's

Internet Radio = /setupapp/radio567/asp/BrowseXPA/LoginXML.asp
Podcasts = /setupapp/radio567/asp/BrowseXPA/loginXML.asp
My Noxon = /RadioNativeLogin.php

For reference the image linked below is the iRadio model being used.

https://www.noxon.ch/wp-content/uploads/2017/10/noxon-iradio-300x215.jpg

Finally: I've run strings on the 4 most recent firmware versions from http://ultron.info/NOXON/NOXON_iRadio/Update/ and the two firmware versions available at https://www.noxon.ch/support/downloads/ (under iRadio) - they all contain the previous listed 4 domains and none contain any noxonserver.eu domains.

from xonox.

x789 avatar x789 commented on July 29, 2024

@Hack5190 Thank you for your patience. I have created a separate issue to support iRadio (without a number). If it is still relevant for you, we can continue the discussion in #18.

from xonox.

x789 avatar x789 commented on July 29, 2024

@bartgrefte

@x789 I just had another look at VLC, it's not exactly mp3 (thought it was), says MPEG Audio Layer 1/2 (mpga), any chance the Noxon has issues with that?
edit2: same error when using aac (supported according to manual):

According to the "Technical Data" document of Noxon 2 Audio MP3 (up to 320 kBit/s with cbr/vbr) and WMA-9 are supported. But the manual states that AAC+ is supported too.

I don't know much about AAC. As I understand it, it is a family of coding methods. Therefore, there may be decoders that are only compatible with one specific method and not the entire family. AAC+ is the trade name for HE-AAC v1. Maybe it works if you set FFMPEG to this specific method?

This is weird, to rule out wifi as the cause of the connection problem with ffmpeg, I hooked it up using a network cable, there it got full internet access (not limited by PiHole's whitelist and no redirect to this project) and it just works like it did a decade ago?!

Perhaps the "legacy" Noxon devices were no longer allowed to access VTuner for cost reasons. I suspect that the servers at noxonserver.eu were just reverse proxies to VTuner and so there was a simple solution to cut the connection.

from xonox.

x789 avatar x789 commented on July 29, 2024

@bartgrefte: I released v1.1.0 today that adds support for Noxon 2 Audio devices. Do you think that we can close this issue now?

from xonox.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.