JvanKatwijk / dab-cmdline

DAB decoding library with example of its use
GNU General Public License v2.0
57 stars 29 forks source link

Example 1 - dataOutHandler question #81

Closed Morrisman68 closed 2 years ago

Morrisman68 commented 2 years ago

I am trying to work from a known basis to extract 'Now Playing information from BBC Radio 3 DAB and having problems. (I am working from an example as my coding skills are not great, nor my understanding of DAB. I am very grateful for the code and the hard work behind it - thank you!)

My modification looks like this:

// The function is called from within the library with // a string, the so-called dynamic label static void dataOut_Handler (std::string dynamicLabel, void *ctx) { (void)ctx; fprintf (stderr, "data out called\n"); fprintf (stderr, "%s\n", dynamicLabel. c_str ()); } // The only output produced is typically of this form:

data out called NlaLuur)

Observation of a DAB tuner shows that the program data being streamed bears no resemblance whatsoever to this, and I am at a loss to understand what is happening, unless I am perhaps mis-handling a pointer?

All suggestions would be welcome!

Many thanks,

Ben

JvanKatwijk commented 2 years ago

Dear Ben

Assuming you are running example 2. Some time ago the interface was changed to provide a more C-like (and less C++ like) interface, so dataOut is defined as given below, // dynamic label data, embedded in the audio stream, is sent as string typedef void (dataOut_t)(const char , void *);

it asks for a char * as parameter rather than a std::string.

/ / The function is called from within the library with // a string, the so-called dynamic label static void dataOut_Handler (const char dynamicLabel, void ctx) { (void)ctx; std::cerr << std::string (dynamicLabel) << "\r"; }

Op di 28 dec. 2021 om 18:40 schreef Morrisman68 @.***>:

I am trying to work from a known basis to extract 'Now Playing information from BBC Radio 3 DAB and having problems. (I am working from an example as my coding skills are not great, nor my understanding of DAB. I am very grateful for the code and the hard work behind it - thank you!)

My modification looks like this:

// The function is called from within the library with // a string, the so-called dynamic label static void dataOut_Handler (std::string dynamicLabel, void *ctx) { (void)ctx; fprintf (stderr, "data out called\n"); fprintf (stderr, "%s\n", dynamicLabel. c_str ()); } // The only output produced is typically of this form:

data out called NlaLuur)

Observation of a DAB tuner shows that the program data being streamed bears no resemblance whatsoever to this, and I am at a loss to understand what is happening, unless I am perhaps mis-handling a pointer?

All suggestions would be welcome!

Many thanks,

Ben

— Reply to this email directly, view it on GitHub https://github.com/JvanKatwijk/dab-cmdline/issues/81, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCPHQDPA5BOEHRTQFCUZTDUTHZCPANCNFSM5K4QPZIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Jan van Katwijk

Morrisman68 commented 2 years ago

Many thanks, Jan.

I am slightly puzzled by the fact that I pulled -0.8 as the latest version - am I missing something? I am a stranger to github, too!

Ben

JvanKatwijk commented 2 years ago

which of the examples you are using, just example 2?

Op di 28 dec. 2021 om 19:37 schreef Morrisman68 @.***>:

Many thanks, Jan.

I am slightly puzzled by the fact that I pulled -0.8 as the latest version

  • am I missing something? I am a stranger to github, too!

Ben

— Reply to this email directly, view it on GitHub https://github.com/JvanKatwijk/dab-cmdline/issues/81#issuecomment-1002233361, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCPHQHBBUJOPVPUDYTXP2TUTH7VDANCNFSM5K4QPZIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

-- Jan van Katwijk

JvanKatwijk commented 2 years ago

Now I see the title, it is much easier to use example 2, since then the library functions are "comoiled in", Last summer there were - based on some requests quite some changes, so my advice is to delete the while cmdline directory, and load a fresh one

git clone https://github.com.JvanKatwijk/dab-cmdline

then cd dab-cmdline/example-2

then mkdir build cd build cmake .. -DRTLSDR

Op di 28 dec. 2021 om 19:40 schreef jan van katwijk @.***

:

which of the examples you are using, just example 2?

Op di 28 dec. 2021 om 19:37 schreef Morrisman68 @.***

:

Many thanks, Jan.

I am slightly puzzled by the fact that I pulled -0.8 as the latest version - am I missing something? I am a stranger to github, too!

Ben

— Reply to this email directly, view it on GitHub https://github.com/JvanKatwijk/dab-cmdline/issues/81#issuecomment-1002233361, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCPHQHBBUJOPVPUDYTXP2TUTH7VDANCNFSM5K4QPZIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

-- Jan van Katwijk

-- Jan van Katwijk

Morrisman68 commented 2 years ago

Many thanks, Jan.

I am slightly puzzled by the fact that I pulled -0.8 as the latest version - am I missing something? I am a stranger to github, too!

Ben

Morrisman68 commented 2 years ago

Jan,

all is now hummin' and tickin' just as I have been hoping - many thanks for your work, sharing and kind help.

Heel hartelijk bedankt!

Ben

JvanKatwijk commented 2 years ago

do not hesitate to contact me if there are questions

all the best jan

Op ma 3 jan. 2022 om 01:12 schreef Morrisman68 @.***>:

Jan,

all is now hummin' and tickin' just as I have been hoping - many thanks for your work, sharing and kind help.

Heel hartelijk bedankt!

Ben

— Reply to this email directly, view it on GitHub https://github.com/JvanKatwijk/dab-cmdline/issues/81#issuecomment-1003800486, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCPHQEIXGZEFX2X2CUZDY3UUDSW7ANCNFSM5K4QPZIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

-- Jan van Katwijk