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

i2c wr failed #5

Closed
rickwookie opened this issue Mar 16, 2017 · 37 comments
Closed

i2c wr failed #5

rickwookie opened this issue Mar 16, 2017 · 37 comments

Comments

@rickwookie
Copy link

rickwookie commented Mar 16, 2017

Had a bunch of issues getting this to compile and run on a clean RPi 3 raspbian install (Linux raspberrypi 4.4.26-v7+ #915 SMP Thu Oct 20 17:08:44 BST 2016 armv7l GNU/Linux), but got there in the end.

Anyway, trying to use this it seams that there's a problem communicating with the dabstick hardware:

lsusb gives me:
Bus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T

and running ./dab_cmdline I get:

...
Found Rafael Micro R820T tuner
samplerate set to 2048000
Supported gain values (29): r82xx_write: i2c wr failed=-9 reg=09 len=1
r82xx_set_freq: failed=-9
going to tell the world
no ensemble, quittingwe told the world
ofdmProcessor is shutting down

Any ideas where to start with this?

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Mar 16, 2017 via email

@rickwookie
Copy link
Author

ok so I just installed rtl-sdr, the ran rtl_test -t and get:
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
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
Sampling at 2048000 S/s.
No E4000 tuner found, aborting.

Which I think is normal right?

Then I did rtl_fm -M wbfm -f 92.6M | aplay -r 32k -f S16_LE -t raw -c 1
and I get:
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuned to 92871000 Hz.
Oversampling input by: 6x.
Oversampling output by: 1x.
Buffer size: 8.03ms
Exact sample rate is: 1020000.026345 Hz
Sampling at 1020000 S/s.
Output at 170000 Hz.
Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 32000 Hz, Mono

...and from the headphone jack on the RPi3 I can hear the radio station.

@rickwookie
Copy link
Author

For completeness, here's the full output I'm getting from dab_cmdline:

pi@raspberrypi:~/dab-cmdline/example/build $ ./dab_cmdline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
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 2
device default seems available as 3
device dmix seems available as 4
Suggested size for outputbuffer = 512
OK, functions seem to be loaded
Found Rafael Micro R820T tuner
samplerate set to 2048000
Supported gain values (29): r82xx_write: i2c wr failed=-9 reg=10 len=1
r82xx_set_freq: failed=-9
going to tell the world
no ensemble, quittingwe told the world
ofdmProcessor is shutting down

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Mar 16, 2017 via email

@rickwookie
Copy link
Author

Thanks.

Further info, my versions of librtlsdr and libusb:
pi@raspberrypi:~ $ dpkg -s librtlsdr0 librtlsdr-dev libusb-1.0-0 libusb-1.0-0-dev | grep Version
Version: 0.5.3-3
Version: 0.5.3-3
Version: 2:1.0.19-1
Version: 2:1.0.19-1

hope that's useful.

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Mar 16, 2017 via email

@rickwookie
Copy link
Author

Same error when run as root.

Could you maybe point me in the direction of the version of librtlsdr that you're using?

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Mar 16, 2017 via email

@rickwookie
Copy link
Author

Hmmm there's a suggestion here: http://www.hamradioscience.com/raspberry-pi-as-remote-server-for-rtl2832u-sdr/#comment-27496 that it could be power related, but I've tried a few power supplies and rtl_test never fails on me with that error, only dab_cmdline. Also I can listen to FM radio using rtl_fm with no issues. It's not likely that a power issue would occur ONLY when running dab_cmdline is it?

I'll try to build rtl-sdr from source. Does that create librtlsdr-dev too?

@rickwookie
Copy link
Author

I've removed the repo packages librtlsdr0 librtlsdr-dev rtl-sdr and built rtl-sdr from source as you've suggested. The only difference now is an extra line in the output of both rtl_test and dab_cmdline:
[R82XX] PLL not locked!

pi@raspberrypi:~/dab-cmdline/example/linux-bin $ rtl_test
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
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
[R82XX] PLL not locked!
Sampling at 2048000 S/s.

Info: This tool will continuously read from the device, and report if
samples get lost. If you observe no further output, everything is fine.

Reading samples in async mode...
^CSignal caught, exiting!

User cancel, exiting...
Samples per million lost (minimum): 0

pi@raspberrypi:~/dab-cmdline/example/linux-bin $ ./dab_cmdline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
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 2
device default seems available as 3
device dmix seems available as 4
Suggested size for outputbuffer = 512
OK, functions seem to be loaded
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
samplerate set to 2048000
Supported gain values (29): r82xx_write: i2c wr failed=-9 reg=09 len=1
r82xx_set_freq: failed=-9
going to tell the world
no ensemble, quittingwe told the world
ofdmProcessor is shutting down

@rickwookie
Copy link
Author

rickwookie commented Mar 17, 2017

Done a bit more digging and it seems that the RPi 3 could well need a 5V 2.5A PSU. Best I've tried is 5.1V 2.1A. I'm awaiting delivery of a couple of 5V 3A adapters and I'll let you know if this is the issue.

Edit: I've just tried hooking up an independent 5V 2.5A PSU to the USB bus, but still this error persists. I have to conclude that the power thing may be a red herring

@rickwookie
Copy link
Author

I've finally got DAB!

IT was the shockingly bad DAB signal that was the reason I wasn't getting it before. Managed now using the local ensemble and holding the antenna VERY HIGH.

This output message still persists though, although it seems perhaps it can be ignored if it has no effect on the functioning of the program.

./dab_cmdline -C 10D -P "3" -G 496
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
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 2
device default seems available as 3
device dmix seems available as 4
Suggested size for outputbuffer = 512
OK, functions seem to be loaded
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
samplerate set to 2048000
Supported gain values (29): r82xx_write: i2c wr failed=-9 reg=09 len=1
r82xx_set_freq: failed=-9
program (1): C8CC Smooth 4Counties in the list
ensemble Herts Beds Bucks
program (2): C363 Heart 4 Counties in the list
program (3): C8DA Encore Radio in the list
program (4): C3CE BOB HomeCounties in the list
program (5): C1CE Connect FM in the list
program (6): C0CE MKFM in the list
program (7): C637 BBC 3CR in the list
program (8): C47F Capital UK in the list
going to tell the world
we found for BBC 3CR serviceId c637
selected BBC 3CR
we told the world
we have now DAB

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Mar 21, 2017 via email

@MkMunich
Copy link

MkMunich commented Apr 4, 2017

Hi,
I've the same issue with my Astrometa DVB-T2 stick (ID 15f4:0131 HanfTek). The stick was not found by ./dab_cmdline when using librtlsdr from wget http://sm5bsz.com/linuxdsp/hware/rtlsdr/rtl-sdr-linrad4.tbz

After having installed rtlsdr from git clone git://git.osmocom.org/rtl-sdr.git, the stick was found by dab_cmdline, but the error below is given:
pi@raspberrypi:~/dab-cmdline/example/build $ ./dab_cmdline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

connect(2) call to /tmp/jack-1000/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 2
device default seems available as 3
device dmix seems available as 4
Suggested size for outputbuffer = 512
OK, functions seem to be loaded
Found Rafael Micro R828D tuner
[R82XX] PLL not locked!
samplerate set to 2048000
Supported gain values (29): r82xx_write: i2c wr failed=-9 reg=09 len=1
r82xx_set_freq: failed=-9
going to tell the world
no ensemble, quittingwe told the world
ofdmProcessor is shutting down

I'm using a Rpi3 and Debian Jessie. Confusing me: why is "apt-get install ... rtl-sdr ..." necessary in step 1 of qt-dab project, when in step 2 the rtl-sdr-linrad4 is build and installed??

Do you need more information?

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Apr 4, 2017 via email

@MkMunich
Copy link

MkMunich commented Apr 4, 2017

A bit output is provided :-)
the issue is, that the default values do (normally) not 'point' to a valid radio station. Having this in mind, I connected my stick to Windows and ran qt-dab-0.998-s.exe first, in order to figure out one radio station, which I then provided to dab_cmdline on RPi 3 side. Here a lucky result in my case:
pi@raspberrypi:~/dab-cmdline/example/build $ ./dab_cmdline -C 5C -P "Deutschlandfunk" -G 90
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

connect(2) call to /tmp/jack-1000/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 2
device default seems available as 3
device dmix seems available as 4
Suggested size for outputbuffer = 512
OK, functions seem to be loaded
Found Rafael Micro R828D tuner
[R82XX] PLL not locked!
samplerate set to 2048000
Supported gain values (29): r82xx_write: i2c wr failed=-9 reg=09 len=1
r82xx_set_freq: failed=-9
program (1): 15DD RADIO BOB! in the list
program (2): 17FA Absolut relax in the list
program (3): 10C3 SCHLAGERPARADIES in the list
program (4): 1A45 ENERGY in the list
program (5): D210 Deutschlandfunk in the list
program (6): 100D Schwarzwaldradio in the list
program (7): D240 DRadio DokDeb in the list
program (8): 1A64 ERF Plus in the list
ensemble DR Deutschland
program (9): D220 DKultur in the list
program (10): D01C Radio Horeb in the list
program (11): 15DC sunshine live in the list
program (12): D75B KLASSIK RADIO in the list
program (13): D230 DWissen in the list
going to tell the world
we found for Deutschlandfunk serviceId d210
selected Deutschlandfunk
we told the world
we have now DAB+

It looks like, dab_cmdline is performing a scan using the given channel (e.g. "-C 5C"). The gain value seems to be important. Audio is played using the default ALSA device.

BUT... unfortunatelly I have to execute dab_cmdline very often (>50 times) to get it working like above. All the other tries are not successful.

I'm not the expert and I'm just thinking loud... Could it be, that the detection of a valid starting point of the stream could be improved? Is 'Autogain' supported, that I do not need to care about it?

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Apr 4, 2017 via email

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Apr 4, 2017 via email

@MkMunich
Copy link

MkMunich commented Apr 5, 2017

Hi Jan,
to give you a feedback: I tried the latest sources and after rebuilding I tested the command:
./dab_cmdline -C 5C -P "Deutschlandfunk" -Q
It does not play. Error: no ensemble, ...
Where as when ommiting option -Q it is working (probably, because of a default gain value?).

@andimik
Copy link
Contributor

andimik commented Apr 6, 2017

Then I would say: Use another stick. Nowadays people are throwing away or at least selling them as there are no DVB-T signals in lots of regions any more (Munich included). Try to get one with E4000 tuner, which were quite rare. NOXON-Stick v2 might be the right one but nobody would sell it.

I have 6 different sticks at home.

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Apr 6, 2017 via email

@MkMunich
Copy link

MkMunich commented Apr 6, 2017

@andimik I tried a NooElec NESDR SMArt (having a R820T2 tuner IC, as I can not help with E4000) with command:
./dab_cmdline -C 11D -P "BR-KLASSIK" -Q
and this stick is working (!!!) even the same error is displayed:
Supported gain values (29): r82xx_write: i2c wr failed=-9 reg=09 len=1
r82xx_set_freq: failed=-9
r82xx_write: i2c wr failed=-9 reg=07 len=1

@JvanKatwijk I just saw sth strange with the command above and using my Astromety stick again:
Supported gain values (29): r82xx_write: i2c wr failed=-9 reg=09 len=1
r82xx_set_freq: failed=-9
r82xx_write: i2c wr failed=-9 reg=07 len=1
program (1): D314 BR-KLASSIK in the list
program (2): D313 BAYERN 3 in the list
program (3): D911 Bayern 1 Schw in the list
program (4): D412 Bayern 2 Sued in the list
going to tell the world
no ensemble, quittingwe told the world
ofdmProcessor is shutting down

Is strange to me, as BR-KLASSIK is in the list, but not found, then?

I also tried:
./dab_cmdline -C 11D -P "BR-KLASSIK" -Q # not playing
./dab_cmdline -C 11D -P "BR-KLASSIK" -G 80 # playing
./dab_cmdline -C 11D -P "BR-KLASSIK" -G 80 -Q # not playing

If I understood you right, then the third command should play radio?

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Apr 6, 2017 via email

@andimik
Copy link
Contributor

andimik commented Apr 6, 2017

It is not the best idea to start testing a stick with this command line tool. Please try qt-dab or welle.io first, then you will see, which gain parameter is the best for your area, your stick and your hardware.

Every stick is different and supports lots of gain settings. In your case 29.

Have you tried dabtools as well?

@MkMunich
Copy link

MkMunich commented Apr 6, 2017

Dear andimik, thanks for your hint - I know that both sticks are working in qt-dab and in dab-cmdline, when using the correct gain values + other settings. Perhaps you did not know, that when using in a driving car an 'Autogain' function is not just nice to have?

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Apr 6, 2017 via email

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Apr 6, 2017 via email

@MkMunich
Copy link

MkMunich commented Apr 6, 2017

Hi Jan, I've a short question: I saw, that the configuration could be set from outside. This is a very good idea!
But I do not know, how to call it, so I commented out the if statement in CMakeLists.txt like:
#Mk if(DEFINED DABSTICK)
set(DABSTICK true)
#Mk endif ()

Could you give an example, how to call the build of e.g. DABSTICK ?

@MkMunich
Copy link

MkMunich commented Apr 6, 2017

Hi Jan, your update is looking ok. the command:
./dab_cmdline -C 11D -P "BR-KLASSIK" -G 80 -Q
is now working. This is what I thought, that the order was wrong before.
GREAT!

The error:
Supported gain values (29): r82xx_write: i2c wr failed=-9 reg=09 len=1
r82xx_set_freq: failed=-9
r82xx_write: i2c wr failed=-9 reg=07 len=1
is still present, but not causing damages. I did not dig into it, and I'm only guessing, that it might be a wrong access to the gain value table? This would be a typical error from myself ;-)

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Apr 6, 2017 via email

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Apr 6, 2017 via email

@MkMunich
Copy link

MkMunich commented Apr 7, 2017

Wow Jan, you're so quick :-)
The latest sources solved the i2c wr issue.

There are 2 comments to build dab-cmdline:

  1. Is there a need for python 3.5.*? The installed python version in Jessie is 2.7.x. I got 3.4 with:
    sudo apt-get update
    sudo apt-get install python3-dev
    Then I had a need to adjust all paths to point to '/usr/include/python3.4m' in ~/dab-cmdline/dab-library/CMakeLists.txt

  2. There is a small dependency issue in the build order, because of the new default, that PYTHON is set in
    ~/dab-cmdline/dab-library/CMakeLists.txt. The quick&dirty solution for me was to comment line:

    set(PYTHON true)

And built using the following commands (in my case!):
cmake .. -DDABSTICK=ON
make -j4
sudo make install
Then I deleted the '#' and did the same commands again.

Have a nice weekend.

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Apr 7, 2017 via email

@rickwookie
Copy link
Author

Well, the i2C error has indeed gone with the new build (not sure what you did to fix that), but now it segfaults every time after about 1 second of audio, with or without the autogain flag:

pi@raspberrypi:~/dab-cmdline/example/build $ ./dab_cmdline -C 10D -P "BBC" -G 100 -Q
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
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 2
device default seems available as 3
device dmix seems available as 4
Suggested size for outputbuffer = 512
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
input device is rtlsdr handler ? 1
ensemble Herts Beds Bucks
waited for an ensemble, an ensemble is found
Encore Radio - with SId C8DA - in ensemble
BOB HomeCounties - with SId C3CE - in ensemble
MKFM - with SId C0CE - in ensemble
Connect FM - with SId C1CE - in ensemble
Capital UK - with SId C47F - in ensemble
BBC 3CR - with SId C637 - in ensemble
Heart 4 Counties - with SId C363 - in ensemble
Smooth 4Counties - with SId C8CC - in ensemble
we found for BBC 3CR serviceId c637
selected BBC 3CR
we have now DAB
Segmentation fault

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Apr 10, 2017 via email

@rickwookie
Copy link
Author

rickwookie commented Apr 10, 2017

Starting program: /home/pi/dab-cmdline/example/build/dab_cmdline -C 10D -P "BBC" -G 100 -Q
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
[New Thread 0x7644c450 (LWP 1477)]
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
Hostapis: 2
Api 0 is ALSA
Api 1 is OSS
selecting device default
[Thread 0x7644c450 (LWP 1477) exited]
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 2
device default seems available as 3
device dmix seems available as 4
Suggested size for outputbuffer = 512
[New Thread 0x761ff450 (LWP 1478)]
OK, functions seem to be loaded
[New Thread 0x759ff450 (LWP 1479)]
[Thread 0x759ff450 (LWP 1479) exited]
[New Thread 0x759ff450 (LWP 1480)]
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
input device is rtlsdr handler ? 1
[New Thread 0x73ee2450 (LWP 1481)]
[New Thread 0x736e2450 (LWP 1482)]
[New Thread 0x72ee2450 (LWP 1483)]
[New Thread 0x722ff450 (LWP 1484)]
ensemble Herts Beds Bucks
waited for an ensemble, an ensemble is found
Encore Radio - with SId C8DA - in ensemble
BOB HomeCounties - with SId C3CE - in ensemble
MKFM - with SId C0CE - in ensemble
Connect FM - with SId C1CE - in ensemble
Capital UK - with SId C47F - in ensemble
BBC 3CR - with SId C637 - in ensemble
Heart 4 Counties - with SId C363 - in ensemble
Smooth 4Counties - with SId C8CC - in ensemble
we found for BBC 3CR serviceId c637
selected BBC 3CR
we have now DAB
[New Thread 0x712fe450 (LWP 1485)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x712fe450 (LWP 1485)]
0x00000000 in ?? ()
(gdb) backtrace
#0 0x00000000 in ?? ()
#1 0x76dbbaa8 in mp2Processor::mp2decodeFrame (this=this@entry=0x72449900,
frame=0x72453ce0 "\377\374\204@w\006U"DDA\021\021\022I$\220",
pcm=0x3ad801b0, pcm@entry=0x712f6b98)
at /home/pi/dab-cmdline/dab-library/src/backend/audio/mp2processor.cpp:374
#2 0x76dbc8b0 in mp2Processor::addtoFrame (this=0x72449900, v=)
at /home/pi/dab-cmdline/dab-library/src/backend/audio/mp2processor.cpp:595
#3 0x76db9efc in dabAudio::run (this=0x72400678)
at /home/pi/dab-cmdline/dab-library/src/backend/audio/dab-audio.cpp:170
#4 0x76d57348 in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Apr 10, 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

5 participants
@JvanKatwijk @rickwookie @andimik @MkMunich and others