pschatzmann / arduino-liblame

A simple mp3 encoder (not only) for Arduino using LAME
20 stars 3 forks source link

Compiles but doesn't work anymore... #11

Closed dl9sec closed 5 months ago

dl9sec commented 5 months ago

Hi Phil,

sorry for bothering again... I put the Audiokit MP3 streamer (https://github.com/pschatzmann/arduino-audio-tools/blob/main/examples/examples-audiokit/streams-audiokit-webserver_mp3/streams-audiokit-webserver_mp3.ino with new liblame) now on my hardware and tried it, but it didn't worked as expected. I pulled all the latest audio-tools/audio-driver/liblame libraries but now it sounds like pressing fast forward on a tape then about 4..5s pause, then again a very fast played sample and again.

Did I miss something?

Regards, Thorsten

dl9sec commented 5 months ago

Here is the log:

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_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:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
starting AudioKit...
[I] AudioTypes.h : 127 - in: sample_rate: 16000 / channels: 1 / bits_per_sample: 16
[I] AudioTypes.h : 127 - out: sample_rate: 16000 / channels: 1 / bits_per_sample: 16
[I] AudioTypes.h : 127 -  sample_rate: 16000 / channels: 1 / bits_per_sample: 16
[I] I2SConfigESP32.h : 80 - rx/tx mode: RX_MODE
[I] I2SConfigESP32.h : 81 - port_no: 0
[I] I2SConfigESP32.h : 82 - is_master: Master
[I] I2SConfigESP32.h : 83 - sample rate: 16000
[I] I2SConfigESP32.h : 84 - bits per sample: 16
[I] I2SConfigESP32.h : 85 - number of channels: 1
[I] I2SConfigESP32.h : 86 - signal_type: Digital
[I] I2SConfigESP32.h : 88 - i2s_format: I2S_STD_FORMAT
[I] I2SConfigESP32.h : 90 - auto_clear: false
[I] I2SConfigESP32.h : 92 - use_apll: true
[I] I2SConfigESP32.h : 97 - buffer_count:6
[I] I2SConfigESP32.h : 98 - buffer_size:512
[I] I2SConfigESP32.h : 101 - pin_mck: 0
[I] I2SConfigESP32.h : 103 - pin_bck: 27
[I] I2SConfigESP32.h : 105 - pin_ws: 25
[I] I2SConfigESP32.h : 107 - pin_data: 35
AudioKit started
[I] AudioTypes.h : 127 - in: sample_rate: 16000 / channels: 1 / bits_per_sample: 16
[I] AudioTypes.h : 127 - out: sample_rate: 16000 / channels: 1 / bits_per_sample: 16
[I] CodecMP3LAME.h : 145 - LibLAME channels: 2
[I] CodecMP3LAME.h : 146 - LibLAME sample_rate: 44100
[I] CodecMP3LAME.h : 147 - LibLAME bits_per_sample: 16
[I] CodecMP3LAME.h : 148 - LibLAME quality: 7
[Info] C:\Users\thors\Documents\Arduino\libraries\arduino-liblame\src\liblame\lame.c : 2571 - lame_init - success
[Info] C:\Users\thors\Documents\Arduino\libraries\arduino-liblame\src\liblame\lame.c : 657 - step 1
[Info] C:\Users\thors\Documents\Arduino\libraries\arduino-liblame\src\liblame\lame.c : 662 - step 2
[Info] C:\Users\thors\Documents\Arduino\libraries\arduino-liblame\src\liblame\lame.c : 757 - lame_init_params - samplerate_out: 0
.
IP address: 192.168.0.242
Server started
[I] AudioServer.h : 249 - New Client:
[I] AudioServer.h : 257 - Request: GET / HTTP/1.1
[I] AudioServer.h : 257 - Request: Host: 192.168.0.242
[I] AudioServer.h : 257 - Request: User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0
[I] AudioServer.h : 257 - Request: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
[I] AudioServer.h : 257 - Request: Accept-Language: de,en-US;q=0.7,en;q=0.3
[I] AudioServer.h : 257 - Request: Accept-Encoding: gzip, deflate
[I] AudioServer.h : 257 - Request: Connection: keep-alive
[I] AudioServer.h : 257 - Request: Upgrade-Insecure-Requests: 1
[I] AudioServer.h : 257 - Request: 
[I] CodecMP3LAME.h : 145 - LibLAME channels: 2
[I] CodecMP3LAME.h : 146 - LibLAME sample_rate: 44100
[I] CodecMP3LAME.h : 147 - LibLAME bits_per_sample: 16
[I] CodecMP3LAME.h : 148 - LibLAME quality: 7
[Info] C:\Users\thors\Documents\Arduino\libraries\arduino-liblame\src\liblame\lame.c : 2571 - lame_init - success
[Info] C:\Users\thors\Documents\Arduino\libraries\arduino-liblame\src\liblame\lame.c : 657 - step 1
[Info] C:\Users\thors\Documents\Arduino\libraries\arduino-liblame\src\liblame\lame.c : 662 - step 2
[Info] C:\Users\thors\Documents\Arduino\libraries\arduino-liblame\src\liblame\lame.c : 757 - lame_init_params - samplerate_out: 0
[I] AudioServer.h : 442 - sendReply - Returning encoded stream...
[I] StreamCopy.h : 70 - buffer_size=1024
[I] AudioServer.h : 216 - Reply: HTTP/1.1 200 OK
[I] AudioServer.h : 220 - Content-type: audio/mp3
[I] StreamCopy.h : 147 - StreamCopy::copy  1024 -> 1024 -> 1024 bytes - in 1 hops
[I] StreamCopy.h : 147 - StreamCopy::copy  1024 -> 1024 -> 1024 bytes - in 1 hops
:
[I] StreamCopy.h : 147 - StreamCopy::copy  1024 -> 1024 -> 1024 bytes - in 1 hops
[I] StreamCopy.h : 147 - StreamCopy::copy  1024 -> 1024 -> 1024 bytes - in 1 hops
[I] AudioServer.h : 139 - stop client...
dl9sec commented 5 months ago

Could it be that the AudioInfo isn't transferred correctly to liblame? As far as I see, the sample rate in liblame should be set to 16000 but for some reasons it is set to 44100...

pschatzmann commented 5 months ago

Not sure what's causing this. I was undoing my change and this did not fix the problem. So it seems not to be my latest change...

pschatzmann commented 5 months ago

You are right: that is the issue...

pschatzmann commented 5 months ago

This bug has been introduced yesterday with the support for Piplines

I committed a correction to the AudioTools. I also optimized the Server to use the more Efficient EncodedAudioOutput instead of the EncodedAudioStream...

dl9sec commented 5 months ago

Again, thanks a million for your very fast an brilliant support and the fixes. Works again fine....