RTL-SDR support

Some updates for this.

rtl_sdr lib is now Haiku-aware AND builds fine on x86_64. Yay! :partying_face:


No luck with x86 though: pkg-config doesn’t find libusb, but it is right there. This is the one small thing delaying a PR… The exact same steps build OK on x86_64.

This is the relevant snippet from CMakeLists.txt:

find_package(Threads)
find_package(PkgConfig)

include(FindMath)

if(PKG_CONFIG_FOUND)
    pkg_check_modules(LIBUSB libusb-1.0 IMPORTED_TARGET)
else()
    set(LIBUSB_LIBRARIES "" CACHE STRING "manual libusb path")
    set(LIBUSB_INCLUDE_DIRS "" CACHE STRING "manual libusb includepath")
endif()

# ... some more code checks etc...

if(PKG_CONFIG_FOUND AND NOT LIBUSB_FOUND)
    message(FATAL_ERROR "LibUSB 1.0 required to compile rtl-sdr")
endif()

Is it something at pkg-config side? Or this script isn’t doing things right?

ps. an explicit setarch x86 didn’t help.

Try removing the version number from libusb-1.0, leave only the name libusb and see if that helps.

As mentioned upstream this seems to be OK for me on 32bit?

Do you have pkgconfig_x86 installed or just pkgconfig?

2 Likes

There is nothing wrong there, the pkg-config file is “libusb-1.0” so correct in this search.

@victroniko as @Lrrr mentioned I guess you are missing pkgconfig_x86 (confirmed in the screenshot you posted where it finds pkg-config in …/bin instead of the one you need in …/bin/x86 :slight_smile:

Ah yes indeed, it’s easy to forget pkgconfig_x86 , it happened to me quite often.

1 Like

@victroniko pushed the stuff I had for this to haikuports, feel free to update when you are ready (wanted to get this out of my branches) :slight_smile:

2 Likes

I guess you also being non-European doesn’t help. DAB and DVB are probably reasonably well known here as it is how digital radio and digital OTA TV (and some cable and satellite TV) is broadcasted. Most modern cars come with a DAB receiver here and we probably get 50-100 stations easily, where as FM is maybe a dozen and I don’t think AM exists anymore.

Not really… in France DAB is slowly being deployed, it looks like it will take a year still until every place is covered, until then FM is still going strong. I don’t know if many people have switched to DAB yet, it will take a few more years until all FM receivers in cars have been replaced before FM can be shut down (since cars don’t have an upgradeable radio/music module now, it’s embedded in the car’s own computers…).

Also, DVB-T is known as “TNT” here (Télévision Numérique Terrestre) so that may not help understanding things when the English acronym is used.

So it’s not unreasonable to ask for clarification :slight_smile:

1 Like

Fair enough. We have had DAB here since the 2000’s. It is less common to buy a radio without DAB and DAB is widespread. All of our TV went to DVB-T when analogue was turned off and I think most of the cable and satellite is now a version of DVB.

DAB is prominently marketed everywhere also.

Sure, but that doesn’t apply to all of Europe and possibly even less to other parts of the world. There are both economics and geographic reasons for this (some countries/language areas are very large and it still makes sense to use low frequency radio waves to cover large distances with few transmitters, and current DAB require a bit higher frequencies to get a decent bitrate)

Calling them “versions of DVB” is a bit strange, as DVB is not a standard or format, but an organization (just like ECMA or ITU or ISO). They have several specifications Specifications - DVB including DVB-T for terrestrial TV transmission, DVB-S and DVB-S2 for satellite broadcast, DVB-RCS2 for “return channel” satellite (allowing internet access by satellit with bidirectional transfers, and scheduling the many customer modems to send data on different frequncies and timeslots), and many others, and DVB-C for cable TV which is yet another completely different thing.

The common parts between these standards are already defined elsewhere, for example the use of MPEG-2 for video broadcast (an ISO/IEC standard, not a DVB one). In fact, MPEG-2 transport streams do a lot of the work, and for example DVB-C for cable TV has a specification in only 18 pages.

(sorry. I happen to know too much about this because I worked on software a DVB-S2/DVB-RCS2 satellite system for a few years!)

We’ve actually turned off DAB here (Ireland) due to lack of take-up; ditto AM. FM only now - made life nice and easy when I worked in radio.

1 Like

Ouch… I thought I posted here months ago. Turns out it was still in “draft mode”, when incomplete text remains waiting in the editor :frowning:

What I wrote back then: (behavior I wrote might’ve changed since)

I just spawned a VM with the latest 32bit nightly (hrev56783). Indeed, it came with pkgconfig by default instead of pkgconfig_x86. This is counterintuitive to me, is it by design or… ?? (just trying to understand the logic here). Anyway, that was it. Builds fine now but still doesn’t install.

Nowadays my work demands a lot of brainpower, so I’ve been helping Haiku in other less time-consuming ways – like the Polyglot translations for ES-419 (all almost done!). But yeah, I do need to resume this. @Begasus I’ll check and report back one of these days, thanks :slight_smile:

RE: digital modes. This rtl-sdr program doesn’t know about DAB or DBV or transport streams, or anything digital. It just uses Realtek 2832U USB dongles as convenient wideband receivers, to do things in software like basic analog RF decoding, or piping raw data to other programs (like, you guessed it: digital TV or DAB decoders). It’d be fun if someday we make them work in Haiku; that’s my motivation.

In my country (Chile) we use ISDB-T since 2011 and only for TV, so these dongles are useless for their original purpose here. Analog FM is alive and healthy with no digitalization in sight, because of our peculiar geography.

1 Like

Yeah, I don’t know why we took on DAB so much!? It’s very un-British to move to a common standard after all. All the national stations are simultaneously broadcast on FM and DAB and you also get a load of extra content not on FM. I also don’t think I have owned a car without DAB for the last 15 years or so. Even the Aygo we owned as a cheap second car had DAB despite having the worlds a worst entertainment and satnav. Anyway…. Back to the original topic?

1 Like