harbaum / galagino

A Galaga, Pac-Man and Donkey Kong arcade emulator for the ESP32
315 stars 21 forks source link

error: 'I2S_MODE_DAC_BUILT_IN' was not declared in this scope #41

Open amishrabbit opened 5 months ago

amishrabbit commented 5 months ago

While attempting to compile and build the Galagino package for a ESP32-2432S028R (aka, CYD or "Cheap Yellow Display") using the Arduino IDE under Windows 10, with the 2.0.14 version of the esp32 board library installed, the following error appears.

<path-to-repo>\galagino-main\galagino\galagino.ino: In function 'void audio_init()':
<path-to-repo>\galagino-main\galagino\galagino.ino:636:58: error: 'I2S_MODE_DAC_BUILT_IN' was not declared in this scope
     .mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN),
                                                          ^~~~~~~~~~~~~~~~~~~~~
<path-to-repo>\galagino-main\galagino\galagino.ino:636:58: note: suggested alternative: 'I2S_MODE_MASTER'
     .mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN),
                                                          ^~~~~~~~~~~~~~~~~~~~~
                                                          I2S_MODE_MASTER
<path-to-repo>\galagino-main\galagino\galagino.ino:669:20: error: 'I2S_DAC_CHANNEL_RIGHT_EN' was not declared in this scope
   i2s_set_dac_mode(I2S_DAC_CHANNEL_RIGHT_EN);
                    ^~~~~~~~~~~~~~~~~~~~~~~~
<path-to-repo>\galagino-main\galagino\galagino.ino:669:20: note: suggested alternative: 'I2S_CHANNEL_FMT_RIGHT_LEFT'
   i2s_set_dac_mode(I2S_DAC_CHANNEL_RIGHT_EN);
                    ^~~~~~~~~~~~~~~~~~~~~~~~
                    I2S_CHANNEL_FMT_RIGHT_LEFT
<path-to-repo>\galagino-main\galagino\galagino.ino:669:3: error: 'i2s_set_dac_mode' was not declared in this scope
   i2s_set_dac_mode(I2S_DAC_CHANNEL_RIGHT_EN);
   ^~~~~~~~~~~~~~~~
<path-to-repo>\galagino-main\galagino\galagino.ino:669:3: note: suggested alternative: 'i2s_set_clk'
   i2s_set_dac_mode(I2S_DAC_CHANNEL_RIGHT_EN);
   ^~~~~~~~~~~~~~~~
   i2s_set_clk

exit status 1

Compilation error: 'I2S_MODE_DAC_BUILT_IN' was not declared in this scope

Attempting the changes suggested by the compiler trigger additional errors to appear in the compiler log.

Is there a workaround for this issue on this model of device?

harbaum commented 5 months ago

What board did you select in the IDE, what version of IDE and ESP32 BSP do you use?

It sounds like you selected a board/ESP variant that does not have a built-in DAC.

harbaum commented 5 months ago

You might want to join this discussion:

https://github.com/harbaum/galagino/discussions/18