Skip to content
forked from iroks/dabpi

Raspberry Si4688 FM / DAB+ Receiver

License

Notifications You must be signed in to change notification settings

dmooney65/dabpi

 
 

Repository files navigation

dabpi

Raspberry Si4688 FM / DAB+ Receiver

Original Project from Bjoern Biesenbach, see https://github.com/elmo2k3/dabpi_ctl

This repo is a fork of https://github.com/teknoid/dabpi via https://github.com/iroks/dabpi

News

New features added - see help text. It is no longer neccesary to recompile the kernel. See https://ugreen.eu/ugreen-dabboard-i2s/. Alternatively, using the Invensense ics43432 kernel driver it is possible to create your own overlay using simple-audio-card. A working example using the pcm5122 DAC (Iqaudio DAC Pro) for audio output is shown below. Any non-bus mastering DAC or amp should work with this overlay.

NOTE: the 24DB digital gain CANNOT be switched off using this overlay, so be careful when setting volume.

Installation Instructions

Enable i2s and SPI

dtparam=i2s=on
dtparam=spi=on

Clone the repo

git clone https://github.com/dmooney65/dabpi
cd dabpi

Compile overlay file

dtc -@ -I dts -O dtb -o dabpi-iqaudio-mems.dtbo dabpi-iqaudio-mems-overlay.dts
sudo cp dabpi-iqaudio-mems.dtbo /boot/overlays

Enable i2s and SPI. Disable onboard audio. Add overlay to config.txt

dtparam=i2s=on
dtparam=spi=on

dtparam=audio=off

dtoverlay=dabpi-iqaudio-mems

Reboot. On success you should see a new alsa recording source:

pi@radiobox:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: iqaudiodacdabpi [iqaudiodac-dabpi], device 1: bcm2835-i2s-ics43432-hifi ics43432-hifi-1 [bcm2835-i2s-ics43432-hifi ics43432-hifi-1]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
pi@radiobox:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: iqaudiodacdabpi [iqaudiodac-dabpi], device 0: bcm2835-i2s-pcm512x-hifi pcm512x-hifi-0 [bcm2835-i2s-pcm512x-hifi pcm512x-hifi-0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

Compile Si4688 controller software. NOTE: the code will not compile using cc and gcc v10. Makefile is pointing to gcc-8.

make clean && make

Place firmware in ../si46xx_firmware/

pi@radiobox:~/source/si46xx_firmware $ ls -al
total 1576
drwxr-xr-x  2 pi pi   4096 Nov  4 06:06 .
drwxr-xr-x 14 pi pi   4096 Nov  9 12:04 ..
-rw-r--r--  1 pi pi 533164 Nov  4 06:06 amhd_radio_3_0_6.bin
-rw-r--r--  1 pi pi 521504 Nov  4 06:06 dab_radio_5_0_9.bin
-rw-r--r--  1 pi pi 530716 Nov  4 06:06 fmhd_radio_5_1_2.bin
-rw-r--r--  1 pi pi   5796 Nov  4 06:06 rom00_patch.016.bin
-rw-r--r--  1 pi pi    940 Nov  4 06:06 rom00_patch_mini.bin

Usage

Enter DAB+ mode

 ./dabpi_ctl
dabpi_ctl version v0.01-43-g369d8de
POWER_UP:
  0000  00 80 00 00 80                                   .....
LOAD_INIT:
  0000  00 80 00 00 80                                   .....
HOST_LOAD:
  0000  00 80 00 00 80                                   .....
  
...

HOST_LOAD:
  0000  00 80 00 00 80                                   .....
HOST_LOAD:
  0000  00 80 00 00 80                                   .....
BOOT:
  0000  00 80 80 00 c0                                   .....
GET_SYS_STATE:
  0000  00 80 80 00 c0 02 ff                             .......
Current mode: 
DAB is active
GET_PART_INFO:
  0000  00 80 80 00 c0 00 00 00 00 50 12 00 00 00 00 50  .........P.....P
  0010  12 00 00 00 00 01 00                             .......
SET_PROPERTY:
  0000  00 80 80 00 c0                                   .....
SET_PROPERTY:
  0000  00 80 80 00 c0                                   .....
SET_PROPERTY:
  0000  00 80 80 00 c0                                   .....
SET_PROPERTY:
  0000  00 80 80 00 c0                                   .....

Set Frequency depending on your Region (0 - 17) - example for UK

pi@radiobox:~/source/dabpi $ ./dabpi_ctl -j 17
dabpi_ctl version v0.01-43-g369d8de
DAB_SET_FREQ_LIST:
  0000  00 80 80 00 c0                                   .....

Tune to DAB channel

pi@radiobox:~/source/dabpi $ ./dabpi_ctl -i 4
dabpi_ctl version v0.01-43-g369d8de
DAB_TUNE_FREQ:
  0000  00 81 80 00 c0                                   .....

Get ensemble information

pi@radiobox:~/source/dabpi $ ./dabpi_ctl -g
dabpi_ctl version v0.01-43-g369d8de
DAB_GET_DIGITAL_SERVICE_LIST:
  0000  00 81 80 00 c0 6e 02                             .....
List size:     622
List version:  152
Services:      22

 Nr | Service ID | Service Name     | Component IDs
--------------------------------------------------
 00 |       c0d8 | Times Radio      | 6 
 01 |       c1d8 | talkSPORT 2      | 27 
 02 |       c3d8 | Virgin Radio     | 3 
 03 |       c5d8 | Mellow Magic     | 4 
 04 |       c5e0 | BFBS UK          | 20 
 05 |       c5ef | Boom Radio UK    | 10 
 06 |       c7d8 | Planet Rock      | 7 
 07 |       c7e6 | Virgin Anthems   | 24 
 08 |       c7ff | Union JACK       | 19 
 09 |       c8d8 | Absolute 80s     | 8 
 10 |       c8e6 | Virgin Chilled   | 25 
 11 |       c8ee | Union JACK Rock  | 2 
 12 |       c9d8 | Sunrise Radio UK | 9 
 13 |       cac2 | Absolute 90s     | 21 
 14 |       cad7 | Jazz FM Stereo   | 17 
 15 |       cae0 | Union JACK Dance | 14 
 16 |       caeb | talkRADIO        | 26 
 17 |       cbd8 | UCB 2            | 11 
 18 |       ccd8 | PremierChristian | 12 
 19 |       cdd8 | Premier Praise   | 13 
 20 |       cde6 | Scala Radio      | 22 
 21 |       cfd8 | Fun Kids UK      | 16 

In a separate terminal, start alsa playback

arecord -f S32_LE -r 48000 -c 2 -D hw:0,1 | aplay -f S32_LE -r 48000 -c 2 -D hw:0,0

Or alternatively on a remote machine

ssh [email protected] 'arecord -f S32_LE -r 48000 -c 2 -D hw:0,1 -' | aplay -f S32_LE -r 48000 -c 2 -

Start one of the services in ensemble

root@pidev:/anus/dabpi# ./dabpi_ctl -f 0

...
Starting service Times Radio      c0d8 6
DAB_START_DIGITAL_SERVICE:
  0000  00 81 80 00 c0 00 00 00                          .....

Enjoy the music ;-)

About

Raspberry Si4688 FM / DAB+ Receiver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 95.5%
  • Makefile 4.3%
  • Shell 0.2%