sle118 / squeezelite-esp32

ESP32 Music streaming based on Squeezelite, with support for multi-room sync, AirPlay, Bluetooth, Hardware buttons, display and more
1.16k stars 106 forks source link

Missing driver for I2S DAC: UDA1334ATS (Makerfabs MPAUDIO Audio Extension board) + Mute GPIO34 issue #178

Closed c-OOL-io closed 1 year ago

c-OOL-io commented 1 year ago

Missing driver for the uda1334 can be found here: https://github.com/torvalds/linux/bl...decs/uda1334.c

Have to mention that the GPIO34 error of the I2S DAC, shown also in the log, is to the used Boards [ MAKT32 (MakePython ESP32 V1.2)] (https://www.makerfabs.com/makepython-esp32.html) + MPAUDIO (MakePython Audio Expansion V2.0).

To get rid of the extreme boosted Bass I had to add mute values to the dac_config: model=I2S,bck=26,ws=25,do=27,mute=34:0,sda=4,scl=5,i2c=106

I had never expected that GPIO34 of Mute does the trick: https://forums.slimdevices.com/showthread.php?116799-Squeezelite-ESP32-gt-3-NEW-OpenHardware-Boards-(MAKT32-MAKT32CL-ESP32-ADF)&p=1061223&viewfull=1#post1061223

Because with FW 1.x I was never able to set the Mute GPIO34 via the hardware web interface. Because of the same error message in the logs.

error log:

I (3325) DAC core: DAC uses I2C port:0, sda:4, scl:5
E (3335) i2c: i2c driver install error
I (3335) DAC external: DAC on I2C @106
W (3335) DAC external: no i2c controlset found
I (3355) I2S: DMA Malloc info, datalen=blocksize=2048, dma_buf_count=12
I (3355) I2S: APLL: Req RATE: 44100, real rate: 44099.988, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 11289597.000, SCLK: 1411199I (3365) wifi:.625000, diva: 1, divb: 0
mode : sta (8c:ce:4e:bb:48:14)E (3365) gpio: io_num=34 can only be input
...
[00:22:50.917402] handler:54 got equalizer 14
E (8685) gpio: gpio_set_level(237): GPIO output gpio_num error

Audio and EQ is working without any problems!

Full log:
I (1311925) httpd_handlers: serving /messages.json to peer 192.168.178.34 port 28313
W (1321385) messaging: System reboot requested.
W (1321385) messaging: System reboot requested.
I (1322135) wifi:state: run -> init (0)
I (1322135) wifi:pm stop, total sleep time: 871158662 us / 1316184186 us

I (1322135) wifi:new:<6,0>, old:<6,0>, ap:<255,255>, sta:<6,0>, prof:1
W (1322145) wifi:age timer already deinit
W (1322145) wifi:hmac tx: ifx0 stop, discard
W (1322145) wifi:hmac tx: ifx0 stop, discard
W (1322145) wifi:hmac tx: ifx0 stop, discard
W (1322155) wifi:hmac tx: ifx0 stop, discard
W (1322165) wifi:hmac tx: ifx0 stop, discard[00
:22:37W (1322165) wifi:.22hmac tx: ifx0 stop, discard934
5] slimprotoW (1322175) network_wifi: WIFI_EVENT_STA_DISCONNECTED. From BSSID: 2c:91:ab:db:23:88, reason code: 8 (WIFI_REASON_ASSOC_L_rEAVE)
un:609 error reading from socket: Software caused connection abort
W (1322155) httpd_txrx: httpd_sock_err: error in recv : 113
W (1322215) httpd_txrx: httpd_sock_err: error in recv : 113
W (1322225) httpd_txrx: httpd_sock_err: error in recv : 113
[00:22:37.354059] slimproto:967 unable to connect to server 0
W (1327155) wifi:TX Q not empty: 500, TXQ_BLOCK=0
W (1327155) wifi:force witi stop
I (1327155) wifi:flush txq
I (1327155) wifi:stop sw txq
I (1327155) wifi:lmac stop hw txq
W (1327165) wifi:sw tx 0 state not idle, potential error!
W (1327165) wifi:force sw tx 0 state to idle, ebuf flag=0
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:6480
load:0x40078000,len:15868
load:0x40080400,len:4384
entry 0x40080684
I (27) boot: ESP-IDF v4.3.2-dirty 2nd stage bootloader
I (27) boot: compile time 07:17:25
I (27) boot: chip revision: 1
I (30) qio_mode: Enabling default flash chip QIO
I (36) boot.esp32: SPI Speed      : 80MHz
I (40) boot.esp32: SPI Mode       : QIO
I (45) boot.esp32: SPI Flash Size : 4MB
I (49) boot: Enabling RNG early entropy source...
I (55) boot: Partition Table:
I (58) boot: ## Label            Usage          Type ST Offset   Length
I (66) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (73) boot:  1 otadata          OTA data         01 00 0000d000 00002000
I (81) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (88) boot:  3 recovery         factory app      00 00 00010000 00140000
I (96) boot:  4 ota_0            OTA app          00 10 00150000 002a0000
I (103) boot:  5 settings         WiFi data        01 02 003f0000 00010000
I (111) boot: End of partition table
I (115) boot_comm: chip revision: 1, min. application chip revision: 0
I (122) esp_image: segment 0: paddr=00150020 vaddr=3f400020 size=aec8ch (715916) map
I (343) esp_image: segment 1: paddr=001fecb4 vaddr=3ffbdb60 size=01364h (  4964) load
I (345) esp_image: segment 2: paddr=00200020 vaddr=400d0020 size=1c4a88h (1854088) map
I (898) esp_image: segment 3: paddr=003c4ab0 vaddr=3ffbeec4 size=05c64h ( 23652) load
I (906) esp_image: segment 4: paddr=003ca71c vaddr=40080000 size=1de48h (122440) load
I (948) esp_image: segment 5: paddr=003e856c vaddr=400c0000 size=00068h (   104) load
I (949) esp_image: segment 6: paddr=003e85dc vaddr=50000000 size=00010h (    16) load
I (970) boot: Loaded app from partition at offset 0x150000
I (970) boot: Disabling RNG early entropy source...
I (981) psram: This chip is ESP32-D0WD
I (982) spiram: Found 64MBit SPI RAM device
I (982) spiram: SPI RAM mode: flash 80m sram 80m
I (985) spiram: PSRAM initialized, cache is in low/high (2-core) mode.
I (992) cpu_start: Pro cpu up.
I (996) cpu_start: Starting app cpu, entry point is 0x4008146c
I (989) cpu_start: App cpu up.
I (1499) spiram: SPI SRAM memory test OK
I (1511) cpu_start: Pro cpu start user code
I (1511) cpu_start: cpu freq: 240000000
I (1511) cpu_start: Application information:
I (1514) cpu_start: Project name:     Squeezelite-ESP32
I (1520) cpu_start: App version:      I2S-4MFlash.16.1188.master-v4.3
I (1527) cpu_start: Compile time:     Sep 18 2022 07:19:51
I (1533) cpu_start: ELF file SHA256:  5acde0f78329534e...
I (1539) cpu_start: ESP-IDF:          v4.3.2-dirty
I (1545) heap_init: Initializing. RAM available for dynamic allocation:
I (1552) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
W (1558) REMOVE: NEW POOL of 7268 bytes, ctrl_size: 416 sli_c:8 fli_c:10 small_b 32 max_b:16384
I (1568) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
W (1574) REMOVE: NEW POOL of 16628 bytes, ctrl_size: 736 sli_c:16 fli_c:10 small_b 64 max_b:32768
I (1584) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
W (1590) REMOVE: NEW POOL of 98180 bytes, ctrl_size: 872 sli_c:16 fli_c:12 small_b 64 max_b:131072
I (1599) heap_init: At 3FFC8068 len 00017F98 (95 KiB): DRAM
I (1606) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (1612) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
W (1619) REMOVE: NEW POOL of 8612 bytes, ctrl_size: 416 sli_c:8 fli_c:10 small_b 32 max_b:16384
I (1628) heap_init: At 4009DE48 len 000021B8 (8 KiB): IRAM
I (1634) spiram: Adding pool of 4019K of external SPI memory to heap allocator
W (1642) REMOVE: NEW POOL of 4116187 bytes, ctrl_size: 2168 sli_c:32 fli_c:16 small_b 128 max_b:4194304
I (1653) spi_flash: detected chip: generic
I (1657) spi_flash: flash io: qio
W (1661) spi_flash: Detected size(16384k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (1677) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
W (1685) REMOVE: NEW POOL of 15052 bytes, ctrl_size: 416 sli_c:8 fli_c:10 small_b 32 max_b:16384
W (1695) REMOVE: NEW POOL of 113820 bytes, ctrl_size: 872 sli_c:16 fli_c:12 small_b 64 max_b:131072
I (1705) spiram: Reserving pool of 64K of internal memory for DMA/internal allocations
W (1715) REMOVE: NEW POOL of 65515 bytes, ctrl_size: 804 sli_c:16 fli_c:11 small_b 64 max_b:65536
I (1725) esp_app_main: Reset reason is: 3
I (1725) esp_app_main: Reboot counter=1

I (1735) esp_app_main: Starting app_main
I (1735) nvs_utilities: Initializing flash nvs 
I (1755) nvs_utilities: Initializing nvs partition settings
I (1795) esp_app_main: Setting up telnet.
I (1795) telnet: ***Redirecting log output to telnet
I (1795) esp_app_main: Setting up config subsystem.
W (1875) nvs_utilities: Configuration memory usage.  Heap internal:224627 (min:224499) (used:200) external:4058363 (min:4050783) (used:13056)
I (1875) esp_app_main: Registering default values
I (1885) system_api: Base MAC address is not set
I (1885) system_api: read default base MAC address from EFUSE
W (1895) config: Waiting for config commit ...
I (2875) config: configuration has some uncommitted entries
I (2875) config: Committing configuration to nvs. Locking config object.
I (2885) config: Config committed!
I (2885) esp_app_main: Configuring services
I (2875) config: Done Committing configuration to nvs.
I (2885) services: Configuring I2C sda:4 scl:5 port:0 speed:400000
I (2895) services: Configuring SPI mosi:-1 miso:-1 clk:-1 host:1 dc:-1
W (2905) services: no SPI configured
W (2905) led: LED GPIO -1 ignored
W (2905) led: LED GPIO -1 ignored
I (2915) led: Configuring LEDs green:-1 (active:0 -1%), red:-1 (active:0 -1%)
I (2925) battery: No battery
I (2925) monitor: Initializing monitoring
I (2925) monitor: Heap internal:225007 (min:224407) external:4042047 (min:4042027) dma:216811 (min:216223)
I (2945) esp_app_main: Initializing display
I (2945) display: Trying to configure display with I2C,width=128,height=64,address=60,driver=SSD1306,HFlip,VFlip
I (2955) SSD1306: SSD1306 driver
I (2995) display: Display is I2C on port 60
I (3005) gds: Adding line 1 at -3 (height:14)
I (3005) gds: Adding line 2 at 8 (height:24)
I (3005) esp_app_main: Checking if certificates need to be updated
I (3015) esp_app_main: About to check if certificates need to be updated in flash
I (3015) esp_app_main: Running partition [ota_0] type 0 subtype 16 (offset 0x00150000)
I (3025) esp_app_main: Running version: I2S-4MFlash.16.1188.master-v4.3
I (3035) esp_app_main: Certificate version: I2S-4MFlash.16.1188.master-v4.3
I (3045) esp_app_main: Checking for update urlI (3055) uart: queue free spaces: 3
W (3055) config: Value not found for key apdelay
I (3055) network_handlers: Network manager configuration: polling max 10176, polling min 15000, ap delay 20000, dhcp timeout 8000, eth timeout 8000
I (3075) http_server: Initializing HTTP Server
I (3085) network_ethernet: Attempting to initialize Ethernet
I (3085) network_ethernet: No Ethernet configuration, or configuration invalid
I (3105) wifi:wifi driver task: 3ffcbd08, prio:23, stack:6656, core=0
I (3105) wifi:wifi firmware version: eb52264
I (3105) wifi:wifi certification version: v7.0
I (3105) wifi:config NVS flash: enabled
I (3115) wifi:config nano formating: disabled
I (3115) wifi:Init data frame dynamic rx buffer num: 40
I (3115) wifi:
Init management frame dynamic rx buffer num: 40
I (3125) wifi:Init management short buffer num: 32
I (3125) wifi:Init static tx buffer num: 12Type 'help' to get the list of commands.
Use UP/DOWN arrows to navigate through command history.
Press TAB when typing command name to auto-complete.

I (3155) wifi:Init tx cache buffer num: 32
I (3155) wifi:Init static rx buffer size: 1600
I (3155) wifi:Init static rx buffer num: 12To automatically execute lines at startup:
        Set NVS variable autoexec (U8) = 1 to enable, 0 to disable automatic execution.
        Set NVS variable autoexec[1~9] (string)to a command that should be executed automatically

I (3175) wifi:Init dynamic rx buffer num: 40

I (3185) wifi_init: tcpip mbox: 32
I (3195) wifi_init: udp mbox: 32
I (3195) wifi_init: tcp mbox: 32
I (3195) wifi_init: tcp tx win: 8192

****************************
Your terminal application does not support escape sequences.
Line editing and history features are disabled.
On Windows, try using Putty instead.
****************************
I (3205) wifi_init: tcp rx win: 32768
W (3215) console: Processing autoexec commands while network manager active.  Wifi related commands will be ignored.
I (3225) wifi_init: tcp mss: 1440
I (3235) console: autoexec is set to perform auto-process
I (3235) wifi_init: WiFi/LWIP prefer SPIRAM
I (3245) console: Running command autoexec1 = squeezelite -b 500:2000 -d all=info -C 30 -W -o I2S -n "MAKT32"
I (3245) network_wifi: Starting wifi
W (3265) config: Value not found for key autoexec2
I (3265) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (3265) squeezelite_cmd: Calling squeezelite
squeezelite-esp32> [00:22:45.526212] stream_init:387 init stream
[00:22:45.528253] sb_controls_init:244 initializing audio (buttons/rotary/ir) controls (raw:0)
[00:22:45.541986] sendSETD:431 sending dimension 128x64
[00:22:45.544736] output_init_embedded:70 init device: I2S
[00:22:45.548239] equalizer_init:42 initializing equalizer
[00:22:45.550807] output_init_common:433 supported rates: 192000 176400 96000 88200 48000 44100 32000 24000 22050 16000 12000 11025 8000 
[00:22:45.565356] output_init_embedded:92 init I2S/SPDIF
I (3325) DAC core: DAC uses I2C port:0, sda:4, scl:5
E (3335) i2c: i2c driver install error
I (3335) DAC external: DAC on I2C @106
W (3335) DAC external: no i2c controlset found
I (3355) I2S: DMA Malloc info, datalen=blocksize=2048, dma_buf_count=12
I (3355) I2S: APLL: Req RATE: 44100, real rate: 44099.988, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 11289597.000, SCLK: 1411199I (3365) wifi:.625000, diva: 1, divb: 0
mode : sta (8c:ce:4e:bb:48:14)E (3365) gpio: io_num=34 can only be input

I (3375) wifi:E (3375) gpio: gpio_set_level(237): GPIO output gpio_num error
enable tsf
[00:22:45.6I (3385) network_handlers: Existing wifi config found. Attempting to connect.
28506]I (3405) network: Starting DHCP client
 output_init_i2s:319 I2S DAC usingI (3405) network_wifi: Wifi Connecting to X-MEN...
 I2S bck:26, ws:25, do:27, mute:34:0 (res:0)
[00:22:45.658349] output_init_i2s:339 Initializing I2S mode normal with rate: 44100, bits per sample: 16, buffer frames: 512, number of buffers: 12 
[00:22:45.663536] output_thread_i2s:463 Output state is -1
[00:22:45.675877] output_visu_init:75 Initialize VISUEXPORT 512 16 bits samples
[00:22:45.678414] output_thread_i2s:467 switching off amp GPIO -1
[00:22:45.678414] output_init_embedded:100 init completed.
[00:22:45.692379] decode_init:153 init decode
[00:22:45.694073] register_alac:547 using alac to decode alc
[00:22:45.696002] register_helixaac:686 using helix-aac to decode aac
[00:22:45.708397] register_vorbis:385 using vorbis to decode ogg
[00:22:45.710440] register_opus:328 using opus to decode ops
[00:22:45.712356] register_flac:332 using flac to decode ogf,flc
[00:22:45.724612] register_pcm:468 using pcm to decode wav,aif,pcm
[00:22:45.726735] register_mad:417 using mad to decode mp3
W (3485) REMOVE: NEW POOL of 5152 bytes, ctrl_size: 416 sli_c:8 fli_c:10 small_b 32 max_b:16384
W (3485) BT_AV: BT Sink pin code is: [1234] 
I (3495) BTDM_INIT: BT controller compile version [6a07b06]
[00:22:45.749995] register_external:442 Initializing AirPlay sink
[00:22:45.763862] register_external:453 Initializing CSpot sink
[00:22:45.768980] discover_server:828 sending discovery
[00:22:45.771365] discover_server:832 error sending discovery
I (3875) BT_AV: Bluetooth Init complete
I (5265) wifi:new:<6,0>, old:<1,0>, ap:<255,255>, sta:<6,0>, prof:1
I (5825) wifi:state: init -> auth (b0)
I (5865) wifi:state: auth -> assoc (0)
I (5875) wifi:state: assoc -> run (10)
I (5915) wifi:connected with X-MEN, aid = 11, channel 6, BW20, bssid = 2c:91:ab:db:23:88
I (5915) wifi:security: WPA2-PSK, phy: bgn, rssi: -51
I (5915) wifi:pm start, type: 1

I (5935) network: Got an IP address from interface Wifi. IP=192.168.178.166, Gateway=192.168.178.1, NetMask=255.255.255.0, Address was changed
I (5945) esp_netif_handlers: sta ip: 192.168.178.166, mask: 255.255.255.0, gw: 192.168.178.1
I (5955) esp_app_main: Network connected and mDNS initialized with MAKT32
I (5965) wifi:AP's beacon interval = 102400 us, DTIM period = 1
[00:22:48.208122] raop_sink_start:173 Starting Airplay for ip 192.168.178.166 with servicename MAKT32
[00:22:48.223046] raop_create:201 starting mDNS with 8CCE4EBB4814@MAKT32
I (5995) cspot: Starting Spotify (CSpot) servicename MAKT32 with id 8cce4ebb4814
I (5995) cspot: Started CSpot with MAKT32 (bitrate 320)
I ZeroconfAuthenticator.cpp:55: Zeroconf registering handlers
I (6295) httpd_handlers: serving /status.json to peer 192.168.178.34 port 19690
I (7535) httpd_handlers: serving /commands.json to peer 192.168.178.34 port 52454
[00:22:50.776386] discover_server:828 sending discovery
[00:22:50.782870] discover_server:840 got response from: 192.168.178.200:3483
[00:22:50.785879] slimproto:942 connecting to 192.168.178.200:3483
[00:22:50.811650] slimproto:989 connected
[00:22:50.813429] sendHELO:153 mac: 8c:ce:4e:bb:48:14
[00:22:50.815222] sendHELO:155 cap: Model=squeezeesp32,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Balance=1,Depth=16,Firmware=v1.0-1188-16,ModelName=SqueezeESP32,MaxSampleRate=192000,alc,aac,ogg,ops,ogf,flc,wav,aif,pcm,mp3
[00:22:50.848036] sendSETD:431 sending dimension 128x64
[00:22:50.859486] notify:223 notified server 192.168.178.200 hport 9999 cport 9090
I (8625) network_status: LMS IP: 192.168.178.200, hport: 9999, cport: 9090
[00:22:50.865646] decode_flush:251 decode flush
[00:22:50.877915] output_flush:446 flush output buffer
[00:22:50.881104] grfb_handler:743 brightness 5
[00:22:50.912928] visu_handler:1232 Stopping visualizer
[00:22:50.917402] handler:54 got equalizer 14
E (8685) gpio: gpio_set_level(237): GPIO output gpio_num error
[00:22:50.924125] visu_handler:1232 Stopping visualizer
I (11515) httpd_handlers: serving /messages.json to peer 192.168.178.34 port 53478
I (14175) httpd_handlers: serving /status.json to peer 192.168.178.34 port 47846
I (26045) httpd_handlers: serving /status.json to peer 192.168.178.34 port 51430
[00:23:20.973955] grfb_handler:743 brightness 3
c-OOL-io commented 1 year ago

I have now noticed that no matter what I have tried, this extreme bass I had since the beginning can no longer set/activated. I think it was the video mode of the DAC UDA1334ATS , Therefore, I now think that it is enough to set the Mute GPIO 34 via set_GPIO [ 34=mute:0 ] to get rid of it, when flashing a device from factory the 1st time with Squeezelite ESP32.

sle118 commented 1 year ago

Just wondering. Did you figure this out? If so, then I'll close the issue

sle118 commented 1 year ago

allrigth. this has gone stale so I'm going to just close for now.