Replies: 66 comments 23 replies
-
See the AudioTools Wiki |
Beta Was this translation helpful? Give feedback.
-
i was hoping if anyone had any pointers, i cant seem to get this code to work quiet right, #include <SPI.h> AudioInfo from; EthernetClient eth; // Ethernet client for network communication // Synchronization configuration for SnapClient (optional) // SnapClient connects the Ethernet client, the decoder, and the resampling stream // MAC address for Ethernet shield void setup() { while (!Serial); // Wait for Serial Monitor to open // Initialize Ethernet // Check for Ethernet hardware presence // Check link status // Wait for link // Initialize the FormatConverterStream // Initialize the R2R DAC output with the specified configuration // Configure SnapClient to use the specified server IP Serial.println("Setup complete, starting audio streaming..."); void loop() { |
Beta Was this translation helpful? Give feedback.
-
This looks correct to me. What is the problem exactly ? |
Beta Was this translation helpful? Give feedback.
-
no sound output no matter what i do |
Beta Was this translation helpful? Give feedback.
-
this is the bit that really confuses me, 04:10:06.751 -> [I] AudioTypes.h : 128 - out: sample_rate: 1000 / channels: 2 / bits_per_sample: 16 |
Beta Was this translation helpful? Give feedback.
-
Change |
Beta Was this translation helpful? Give feedback.
-
04:16:33.053 -> [E] ResampleStream.h : 191 - write error 8 vs 1020 |
Beta Was this translation helpful? Give feedback.
-
[I] ResampleStream.h : 129 - -> ResampleStream: |
Beta Was this translation helpful? Give feedback.
-
this is my snapserver log concerning this 2024-08-28 04-39-36.954 [Info] (Server) Hello from 00-00-00-00-00, host: arduino-snapclient, v0.0.2, ClientName: libsnapcast, OS: arduino, Arch: xtensa, Protocol version: 2 2024-08-28 04-39-39.085 [Info] (Server) onResync (Notification): 110.749 ms 2024-08-28 04-39-39.085 [Info] (AlsaStream) Too many frames available, fast forwarding from 6474 frames (146.803 ms) to 1323 frames (30 ms) 2024-08-28 04-39-39.757 [Error] (StreamSession) StreamSession write error (msg length: 1700): Connection reset by peer 2024-08-28 04-39-39.757 [Info] (StreamServer) onDisconnect: 00-00-00-00-00 2024-08-28 04-39-39.757 [Error] (StreamSessionTCP) Error reading message header of length 0: End of file 2024-08-28 04-39-39.757 [Error] (StreamSessionTCP) Error in socket shutdown: Transport endpoint is not connected |
Beta Was this translation helpful? Give feedback.
-
do you mean this? from R2ROutput.h protected: |
Beta Was this translation helpful? Give feedback.
-
Iv always used pin numbers for my stm32 code, stm32duo maps them to the correct places. now when i start the code on a fresh power cycle of the soc, the dac makes a brief digital noise sound, then nothing. can you advise on where i should be looking to debug? if i set AudioInfo to(8000, 2, 8); i get 14:40:37.340 -> [E] ResampleStream.h : 191 - write error 8 vs 1020 if i set it to AudioInfo to(8000, 1, 8); no error messages, also no sound But both instances initially have a few ms worth of digital noise, |
Beta Was this translation helpful? Give feedback.
-
is the microcontroller fast enough to run snapclient and do all of these tasks? its the CC variant of the blackpill? |
Beta Was this translation helpful? Give feedback.
-
It should be fast enough: however I would expect the network to be the bottleneck. I committed some changes to the R2ROutput to perform blocking writes so that it is waiting if the buffer is full. ps. don't use PB_12, PB_13... it should be PB12, PB13... |
Beta Was this translation helpful? Give feedback.
-
Still no audio from my code above, but ran the network test with surprising results. 14:33:34.798 -> ==> Bytes per second: 14000 |
Beta Was this translation helpful? Give feedback.
-
oh i missed this before, cause i had it set to info, E (682) gpio: GPIO can only be used as input mode |
Beta Was this translation helpful? Give feedback.
-
does not specify which one, but i can poke around with my multimeter to work that out |
Beta Was this translation helpful? Give feedback.
-
i believe pin 35 looking at documentation? |
Beta Was this translation helpful? Give feedback.
-
{12,14,27,26,25,33,32, 15} |
Beta Was this translation helpful? Give feedback.
-
#include "WiFi.h" #define ARDUINO_LOOP_STACK_SIZE (10 * 1024) AudioInfo from; AudioInfo to(20000, 1, 8); // Sample rate: 44100 Hz, Mono, 8-bit WAVDecoder pcm; WiFiClient wifi; const int pins1[] = {12,14,27,26,25,33,32, 15}; void setup() { // login to wifi -> Define values in SnapConfig.h or replace them here // print ip address // Initialize the FormatConverterStream // Start R2R DAC // Set up pins for the R2R DAC // Initialize R2R output with the config // Define CONFIG_SNAPCAST_SERVER_HOST in SnapConfig.h or here // start snap client void loop() { 17:06:36.721 -> [I] ResampleStream.h : 129 - -> ResampleStream: |
Beta Was this translation helpful? Give feedback.
-
same rebooting behaviour with AudioInfo to(8000, 1, 8); |
Beta Was this translation helpful? Give feedback.
-
I don't understand why you want to convert it to 8 bit. It is the responsibility of the R2ROutput to provide as many bits as the number of pins that you have defined... |
Beta Was this translation helpful? Give feedback.
-
with correction in place same behaviour AudioInfo to(8000, 1, 16); |
Beta Was this translation helpful? Give feedback.
-
on plus side, i have just pulled your latest source and built the tone generator, |
Beta Was this translation helpful? Give feedback.
-
by the way... did you ever try to increase the sampling rate to 44100 or 48000 ? |
Beta Was this translation helpful? Give feedback.
-
48000 not operating at correct frequency |
Beta Was this translation helpful? Give feedback.
-
in the snapclient code if i specify AudioInfo to(44100, 1, 8); the audio is very choppy the soc occasionally reboots, but there is some sort of life, audio so garbled its uninteligable tried adding BufferedStream with a 1024 buffer, but that made no difference to audio quality |
Beta Was this translation helpful? Give feedback.
-
any samplerate other then 44100 causes the esp32 to bootloop |
Beta Was this translation helpful? Give feedback.
-
is there any possibility of a example sketch on how to use a 8bit r2r with snapclient, really appreciate some pointers, with tone generators etc i been playing with the new r2r sound device, but with snap im completely lost,
Beta Was this translation helpful? Give feedback.
All reactions