-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why not move mp3client to AsyncTCP as well? #2
Comments
I will try that. |
Hello, I 've tried it. But is was no success. And in de async version: So at least one linefeed is missing. You will find the new source below. Greetings, //****************************************************************************************** // ------- ------ -------------- --------------- -------------------// D0 GPIO16 16 - pin 1 DCS - // ------- ------ -------------- --------------- -------------------// GND - - pin 8 (GND) pin 8 GND extern "C" // Color definitions for the TFT screen // Digital I/O used //****************************************************************************************** //****************************************************************************************** void dbgprint ( const char* p ) ; // Forward declaration for VS1053 stuff //****************************************************************************************** inline void control_mode_on() const inline void control_mode_off() const inline void data_mode_on() const inline void data_mode_off() const uint16_t read_register ( uint8_t _reg ) const ; public: //****************************************************************************************** // Constructor uint16_t VS1053::read_register ( uint8_t _reg ) const control_mode_on() ; void VS1053::write_register ( uint8_t _reg, uint16_t _value ) const void VS1053::sdi_send_buffer ( uint8_t* data, size_t len ) data_mode_on() ; void VS1053::sdi_send_fillers ( size_t len ) data_mode_on() ; void VS1053::wram_write ( uint16_t address, uint16_t data ) uint16_t VS1053::wram_read ( uint16_t address ) bool VS1053::testComm ( const char *header ) if ( !digitalRead ( dreq_pin ) ) void VS1053::begin() void VS1053::setVolume ( uint8_t vol ) if ( vol != curvol ) uint8_t VS1053::getVolume() // Get the currenet void VS1053::startSong() void VS1053::playChunk ( uint8_t* data, size_t len ) void VS1053::stopSong() sdi_send_fillers ( 2052 ) ; void VS1053::softReset() void VS1053::printDetails ( const char *header ) dbgprint ( header ) ; // The object for the MP3 player //****************************************************************************************** //****************************************************************************************** //****************************************************************************************** //****************************************************************************************** //****************************************************************************************** //****************************************************************************************** //****************************************************************************************** //****************************************************************************************** //****************************************************************************************** // scan for nearby networks: // Print the network number and name for each network found and //****************************************************************************************** if ( totalcount == oldtotalcount ) //****************************************************************************************** if ( ++count10sec == 100 ) // 10 seconds passed? //****************************************************************************************** //****************************************************************************************** if ( strstr ( metaline, "StreamTitle=" ) ) //****************************************************************************************** dbgprint ( "Connect to new host" ) ; //******************************************************************************************
//****************************************************************************************** for ( i = 1 ; i < EENUM ; i++ ) //****************************************************************************************** address = index * EESIZ ; // Compute address in EEPROM //****************************************************************************************** address = index * EESIZ ; // Compute address in EEPROM //****************************************************************************************** for ( entnum = 1 ; entnum < EENUM ; entnum++ ) //****************************************************************************************** address = index * EESIZ ; // Compute address in EEPROM //****************************************************************************************** // See if first entry in EEPROM makes sense //****************************************************************************************** path = String ( "/" ) + ssid + String ( ".pw" ) ; // Form full path //****************************************************************************************** Serial.begin ( 115200 ) ; // For debug //****************************************************************************************** //****************************************************************************************** switch ( datamode ) //****************************************************************************************** |
Somehow I can not see the source, but I was able to get the sketch running here and listen to some music, so I'll give it a go also. Bytes should not be missing |
Here is the source. |
really interesting! I tried different stations and it's always that byte that is missing? always before icy-name... looking deeper... btw I meant to use AsyncClient instead of the Sync one, but I'll look into that too. |
Sorry, it was the wrong source indeed. Her is the right one (I hope). |
this is nice :) i finally found a problem with assimilating data. Onto fixing it... |
delaying Acks fixed SyncClient (result is in latest git). What it showed though is that the ESP will not be able to handle the data asynchronously, because the rate of incoming packets and rate of consumption differ much. On another note, I totally removed the 20K buffer and the streams are playing fine (since you fill the buffer and right after that you read it, you can just skip it and use the buffers that the clients have). |
Okay. I will stick to the regular client. Op 27-04-16 om 01:14 schreef Me No Dev:
|
Ed, Awesome work, have one already knocked up and playing my fav stations, have you thought about adding the parametic EQ functions for bass and treble? Great work mate, well done Dans |
Thanks for kind words. In the sourcecode you will see a remark on bass and treble as a "todo". The next version will also save settings (preset and volume) over a restart. Verzonden vanaf Samsung-tablet. -------- Oorspronkelijk bericht -------- Ed, Awesome work, have one already knocked up and playing my fav stations, have you thought about adding the parametic EQ functions for bass and treble? Great work mate, well done Dans — |
Fantastic, roll on version 2 Woooo Cheers mate Dans |
Hi @Edzelf , Do you have some sample routines to increase / decrease bass and treble parameters? I now have added a simple 5 button push button panel reading from the analogue input pin, allowing me based on the 100 ms timer to increment / decrement preset, I would like to use the other buttons for EQ bass and treble for now. Big thanks buddy and so impressed with the quality of the streams I have added :) Cheers Dans |
The new published version has bass/treble control. Don't forget to upload the index.html as well. |
Ed, you are simply a Guru, just got in now really excited to see how this has been implemented. I was racking through the datasheet last night and came up with a superb idea, I am sure you may have thought about this. What about turning this the other way around and making an ESP-MP3-Encoder? The board I have is the same as yours, the idea would be to reverse your operation and to stream the MP3 microphone encoded to a version of the radio code to pick up the stream and in effect create a point to point audio link. What do you see as the main complexity's involved with this? Adafuit have implemented a ogg example recording to SD card, the initialization is pretty simple although will require a plugin for the vs1053 which is available. This would be seriously cool and allow for high quality point to point streaming. Well done mate, keep up the awesome work. Dans |
Nice idea. Technically it is interesting. The sender can act as an accesspoint, that makes it portable. A complications might be the synchronization: what happens if the sender and receiver differ only slightly in bps-speed... The coding have to be ogg, because the VS1053 cannot encode MP3. |
Hi Ed, I think it would be a really cool project. Thinking about operation, the Glad you are interested in this, what other stuff do you get up to in your Big thanks Dans On Wed, May 4, 2016 at 11:15 AM, Ed Smallenburg notifications@github.com
|
I 'll see what I can do. It will take some time... |
Thanks buddy, This will be really interesting. Good luck, keep me posted Dans On Wed, May 4, 2016 at 8:04 PM, Ed Smallenburg notifications@github.com
|
@danbicks |
Ed, Wow so excited, well done you, had a look through the code, awesome mate. Just ordered another VS1053 board to try. I think for an interim I can use winamp to connect and test, will give this a go in the short term. Any major issue's you encountered while putting this together? how did you test it and where you impressed with audio results? Superb work, cheers Guru Dans |
Dans, I tested it with Firefox, and the quality (microphone input) was good. I noticed a delay of 2.5 seconds. Have not tried the Esp-radio yet, but it should work. Here some logging under normal operations: |
Ed, Amazing work, I have just downloaded Firefox and yes all connected up fine Those chinese cheap boards are a pain, I have this knocked up on a NODEMCU, I will keep tinkering, A plus mate Dans On Wed, May 11, 2016 at 7:15 PM, Ed Smallenburg notifications@github.com
|
Dans, |
I made some changes to Esp-radio and Ogg-encoder and now the radio can receive data from the encoder. Issue: the radio reads a bit faster than the encoder produces. So the ringbuffer is always empty. I replaced boths sketches to http://smallenburg.nl/Ogg-encoder.zip. You can also find my mailaddress on the website, so you can mail me directly. |
Ed, Awesome work buddy, sorry for delay had to re build all data on to new laptop, my old one suddenly decided to type when no keys pressed lol. Too much programming for it Haha. Super stuff buddy, I did try the last encoder and found that although mozilla locked on to the stream no audio would come through, I did plug in to the headphone socket and audio was their from the microphone strange. I will get some time hopefully next week to follow this up, finishing off my garden lighting system since the weather is really nice, features 5 outputs all PWM controlled by android app on my phone, I will send over some pics when up and running. Keep up the amazing work. Dans |
Since I see you already have the Async server up (yeah! :)), why not move the mp3 stream to async as well? You will not need to buffer the client and you can write to the VS1053 as data comes. Using that will also ACK the data only after you have it loaded to the VS, which will make networking a little more predictable :)
Let me know what you think, I can help if needed :)
The text was updated successfully, but these errors were encountered: