aspork42 / speaker

Smart Speaker for DIY Home Automation
16 stars 11 forks source link

DAC Query #1

Open adamrhoades opened 3 years ago

adamrhoades commented 3 years ago

Love this project, perfect solution for offline alerts at my elderly mothers house.

I’m attempting to solve the popping issue and plan to try a I2S DAC.

My question… I’m using an old set of amplified PC speakers as the output, would the adafruit MAX98357A still be a suitable DAC, or would an un-amplfied one such as the UDA1334A be a better fit for my use case?

Thanks in advance!

aspork42 commented 3 years ago

Technically you are correct. The component that I used includes an amplifier, so you could plug a speaker in directly to it. If you are using an external amp like an old set of PC speakers, then you can use the UDA1334A. That being said, you could just as well still use the project as posted and control the volume/gain via the solder jumpers on the PCB to run it down in amplification and then the PC speakers will still work just fine. If you're not using the PCB posted here, then i'd go the route you selected. You can use perfboard and solder the components. and I'm like >95% sure that it should work as-is.

adamrhoades commented 3 years ago

Thank you so much, I'll order a UDA1334A and see how I get on. Will keep you posted!

adamrhoades commented 3 years ago

Got the UDA1334A wired up and the esp8266_mrdiy_mqtt_local_notifier-I2S.bin flashed.

Partial Success, once configured it plays the guitar riff to indicate it has connected to the wifi and the MQTT.

The module returns pings and is accessible via the web interface, but it will not respond to MQTT messages.

Power cycling makes it forget the wifi settings and it goes into AP mode.

Any suggestions for me to troubleshoot?

aspork42 commented 3 years ago

Try to see if you can compile and upload from the Arduino IDE. I had the same problem with the original Mr DIY image until I did that. Otherwise check settings for erasing flash.

On Jan 29, 2021, at 10:18, adamrhoades notifications@github.com wrote:

 Got the UDA1334A wired up and the esp8266_mrdiy_mqtt_local_notifier-I2S.bin flashed.

Partial Success, once configured it plays the guitar riff to indicate it has connected to the wifi and the MQTT.

The module returns pings and is accessible via the web interface, but it will not respond to MQTT messages.

Power cycling makes it forget the wifi settings and it goes into AP mode.

Any suggestions for me to troubleshoot?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

adamrhoades commented 3 years ago

Thanks for getting back to me.

I complied it myself, erased the flash and uploaded and that has solved the issue of forgetting wifi.

The DAC seems to be working as it plays the guitar riff on connection. I assume that also means it has connected to the MQTT broker?

However it will still not respond to MQTT commands.

Any further thoughts?

aspork42 commented 3 years ago

Sorry for the troubles. It is probably related to posting to the correct MQTT Topic. The sound should only play if the device connects to the broker; so that part should be fine. I’ll post the topics i’m using to you in a little while when I get a second. Don’t forget that you can configure the topic individually for each device. I have 5, so each has its own sub-topic that it listens to. That’s why the documentation says "mqttFullTopic()/play"

It doesn’t mean to POST to mqttFullTopic/Play, it means that once you configure your topic like “MySpeaker” that you can then post to MySpeaker/play and it will respond.

On Feb 3, 2021, at 3:44 AM, adamrhoades notifications@github.com wrote:

Thanks for getting back to me.

I complied it myself, erased the flash and uploaded and that has solved the issue of forgetting wifi.

The DAC seems to be working as it plays the guitar riff on connection. I assume that also means it has connected to the MQTT broker?

However it will still not respond to MQTT commands.

Any further thoughts?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aspork42/speaker/issues/1#issuecomment-772374613, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNXL5YROTWEQFBCLW2H6O3S5ELGHANCNFSM4WV6PIJA.

aspork42 commented 3 years ago

This is my config website: image

and I post to the full topic like this: Notifier/Basement/say Notifier/Basement/play Notifier/Basement/tone Notifier/Basement/stop Notifier/Basement/volume

and get LWT from: Notifier/Basement/LWT

aspork42 commented 3 years ago

What part of the world are you in?

adamrhoades commented 3 years ago

So sorry for the late response... crazy week.

I'm based in Lincoln, England... you?

Adding the prefix of Notifier to my existing topic solved the problem I'm now using: Notifier/Speakers

Initially I had problems with inconsistent playback quality; popping, missing portions etc but I reduced the MP3 files down to mono with a low variable bitrate of between 40-85kbps and it sounds great now!

I also experimented with copying the google tts cache mp3s and using those... they sound great too!