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

Cmake error compiling the python example #12

Closed
andreacampanella opened this issue Jun 13, 2017 · 6 comments
Closed

Cmake error compiling the python example #12

andreacampanella opened this issue Jun 13, 2017 · 6 comments

Comments

@andreacampanella
Copy link

I'm really confused about the way I should compile the python example, I'm following the README ,but the cmake ( cmake .. -DSDRPLAY=ON) command generate a rather cryptic error :

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
SDRPLAYLIB_INCLUDE_DIR
used as include directory in directory /home/andrea/dab-cmdline/python-example
used as include directory in directory /home/andrea/dab-cmdline/python-example

@andreacampanella
Copy link
Author

Ok, I managed to compile this , I was using the wrong define, using -DRTLSDR I can compile it.
but now I have another problem , if I run python3 cmdline.py -d 5 -c 12A -p "Fix Radio"

I get :

device restarted
ofdm word gestart
no DAB signal detected, giving up
no ensemble found, giving up

I had to choose python3.4m instead of python3.5m to make it working on the raspberry pi .

I'm trying to make a digital radio receiver without a screen attached, I'm really finding difficult, there is not a single working or ready piece of software to use the raspberry as DAB receiver via command line, I can't get it...

@andimik
Copy link
Contributor

andimik commented Jun 15, 2017

Have you tried eti-stuff (including eti-cmdline) as well?

This is much easier and stable.

@andreacampanella
Copy link
Author

andreacampanella commented Jun 15, 2017

hey andimik , thank!

Looks like that eti-stuff is more polished and stable :)

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Jul 4, 2017 via email

@jehutting
Copy link

THANKS a lot @andreacampanella.

I was struggling to get this library/example-1 working for the exact same purpose as you do: having a stand-alone -without screen- DAB receiver/player. I was using the wrong define too.

Although the python-example still fails

$ python3 cmdline.py 
device restarted
ofdm word gestart
no DAB signal detected, giving up
no ensemble found, giving up

(and installing python3.4 gives me import errors as numpy/multiarrays/... and I don't know how all this relates to python3.5, the latest and greatest on the Raspbian Stretch)

I'm now able to compile example-1 (after I patched it...

$ git diff
diff --git a/example-1/main.cpp b/example-1/main.cpp
index 010f85b..aa83ddd 100644
--- a/example-1/main.cpp
+++ b/example-1/main.cpp
@@ -115,10 +115,11 @@ void      dataOut_Handler (std::string dynamicLabel, void *ctx) {
 }
 
 static
-void   bytesOut_Handler (uint8_t *data, int16_t amount, void *ctx) {
+void   bytesOut_Handler (uint8_t *data, int16_t amount, uint8_t type, void *ctx) {
        (void)data;
        (void)amount;
        (void)ctx;
+       (void)type;
 }
 //
 //     The function is called from within the library with

).

So, cmake .. -DRTLSDR=ON (in the created build directory of example-1) followed by make, gives dab-rtlsdr. Note: during my struggle I installed/removed a lot of packages; hang-on while building/compiling :-)

For example

$ ./dab-rtlsdr -C 12C -P "NPO Radio 2"
dab_cmdline, 	                  Copyright 2017 J van Katwijk, Lazy Chair Computing
OK, functions seem to be loaded
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
samplerate set to 2048000
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6 
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
connect(2) call to /tmp/jack-1001/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
Hostapis: 2
Api 0 is ALSA
Api 1 is OSS
selecting device default
device bcm2835 ALSA: - (hw:0,0) seems available as 0
device bcm2835 ALSA: IEC958/HDMI (hw:0,1) seems available as 1
device sysdefault seems available as 3
device dsp0 seems available as 4
device dmixer seems available as 5
device dmix seems available as 6
device default seems available as 7
Suggested size for outputbuffer = 1280
ofdm word gestart
there might be a DAB signal here
NPO Soul & Jazz  (8206) is part of the ensemble
NPO FunX Sl.Jamz (8217) is part of the ensemble
NPO FunX         (8209) is part of the ensemble
NPO SterrenNL    (8212) is part of the ensemble
NPO Radio 4      (8204) is part of the ensemble
NPO 3FM          (8203) is part of the ensemble
NPO Radio 5      (8205) is part of the ensemble
NPO 3FM KX Radio (8214) is part of the ensemble
NPO Radio 4 Con. (8215) is part of the ensemble
ensemble NPO              is (8001) recognized
NPO Radio 1      (8201) is part of the ensemble
NPO FunX Dance   (8216) is part of the ensemble
NPO 3FM Alterna. (8210) is part of the ensemble
NPO Radio 2      (8202) is part of the ensemble

going to start program NPO Radio 2
selected NPO Radio 2
	startaddress	= 0
	length		= 72
	subChId		= 1
	protection	= 2
	bitrate		= 96
we have now DAB+

I don't know (yet) what ALSA complains about, but it just works!!!

@JvanKatwijk "Uiteraard een grote DANKUWEL voor de library en het voorbeeld programma!".

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Oct 23, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants