therealmuffin / synchronator

Synchronator brings bit perfect volume control to Hi-Fi systems with Linux as source.
GNU General Public License v3.0
12 stars 3 forks source link

Error in `synchronator': malloc(): memory corruption #3

Closed jnorbi closed 8 years ago

jnorbi commented 8 years ago

Hi,

On Debian Jessie with the sample Dynaudio Connect config (only IP address changed), result is the following:

root@raspberrypi:/home/pi/synchronator/src# synchronator -v2
synchronator[1005]: Program started by User 0
synchronator[1005]: Configuration file has been read: (null)
synchronator[1005]: Checking presence and validity of required variables:
synchronator[1005]: [OK] sync_2way: TRUE
synchronator[1005]: [OK] diff_commands: TRUE
synchronator[1005]: [OK] command_mod.type: dynaudio
synchronator[1005]: [OK] volume.curve: linear
synchronator[1005]: [OK] volume.discrete: TRUE
synchronator[1005]: [OK] volume.min: 0
synchronator[1005]: [OK] volume.max: 17
synchronator[1005]: [NOTICE] Setting not found, ignoring volume.default
synchronator[1005]: [OK] interface: tcp
synchronator[1005]: [OK] tcp_address: 192.168.1.51
synchronator[1005]: [OK] tcp_port: 1901
synchronator[1005]: [OK] tcp_listen: FALSE
synchronator[1005]: Alsa volume range, min, max: 150, -50, 100
synchronator[1005]: [OK] data_type: tcp
synchronator[1005]: [OK] header.[0].[0]: 255
synchronator[1005]: [OK] header.[0].[1]: 85
synchronator[1005]: [OK] header.[0].[2]: 5
synchronator[1005]: [OK] header.[0].[3]: 47
synchronator[1005]: [OK] header.[0].[4]: 160
synchronator[1005]: [OK] volume.header.[0]: 19
synchronator[1005]: [OK] tail.[0].[0]: 0
synchronator[1005]: [OK] tail.[0].[1]: 0
synchronator[1005]: [OK] header.[1].[0]: 255
synchronator[1005]: [OK] header.[1].[1]: 85
synchronator[1005]: [OK] header.[1].[2]: 8
synchronator[1005]: [OK] header.[1].[3]: 46
synchronator[1005]: [OK] header.[1].[4]: 160
synchronator[1005]: [OK] volume.header.[1]: 4
synchronator[1005]: [OK] tail.[1].[0]: 0
synchronator[1005]: [OK] tail.[1].[1]: 0
synchronator[1005]: [OK] tail.[1].[2]: 0
*** Error in `synchronator': malloc(): memory corruption: 0x009aeca0 ***
Aborted

Configured with --enable-tcp, what should I try?

Sure, I have a Dynaudio Connect box :) IP is correct, fw version on Connect: 1.04, libconfig compiled from source as you asked in manual.

Thanks in advance, Norbert

therealmuffin commented 8 years ago

Thanks for reporting this issue! I've pushed a commit that should fix it. Please confirm if this works for you.

Kind regards, Maarten

p.s. any feedback on how Synchronator works with Dynaudio is also welcome (once it works obviously).

jnorbi commented 8 years ago

Wow, thanks for the extremely fast feedback and fix. I just recompiled and started it, looks better, because started without errors; instead the error (+ctrl-c):

...same output...
synchronator[6210]: [OK] tail.[1].[3]: 217
synchronator[6210]: [OK] tail.[1].[4]: 0
synchronator[6210]: [OK] command_mod.zone: 1
synchronator[6210]: [OK] command_mod.default_input: 5
^Csynchronator[6210]: Program terminated: Interrupt (2)

At the moment I can reach only my Raspberry Pi via SSH, but I'll tell you more about it when I'll be at home, then I can try it.

jnorbi commented 8 years ago

Almost perfect! :) volume control works, but look at this output:

root@raspberrypi:/home/pi# synchronator -v2
...same output...
synchronator[858]: [OK] tail.[1].[3]: 217
synchronator[858]: [OK] tail.[1].[4]: 0
synchronator[858]: [OK] command_mod.zone: 1
synchronator[858]: [OK] command_mod.default_input: 5
synchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R÷ (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R÷ (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R÷ (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R÷ (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R÷ (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R÷ (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R÷ (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R÷ (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R÷ (14, 0)
PuTTYsynchronator[858]: Volume level mutation (int. initiated): ext. level: 11.05
synchronator[858]: Volume level mutation (int. initiated): ext. level: 11.22
synchronator[858]: Volume level mutation (int. initiated): ext. level: 11.05
synchronator[858]: Volume level mutation (int. initiated): ext. level: 10.88
synchronator[858]: Volume level mutation (int. initiated): ext. level: 10.54
synchronator[858]: Volume level mutation (int. initiated): ext. level: 10.37
synchronator[858]: Volume level mutation (int. initiated): ext. level: 10.54
synchronator[858]: Volume level mutation (int. initiated): ext. level: 10.88
synchronator[858]: Volume level mutation (int. initiated): ext. level: 11.05
synchronator[858]: Volume level mutation (int. initiated): ext. level: 11.22
synchronator[858]: Volume level mutation (int. initiated): ext. level: 11.56
synchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R
 (14, 0)
PuTTYsynchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U
1R÷
 (14, 0)
PuTTY^Csynchronator[858]: Program terminated: Interrupt (2)

I think the "synchronator[858]: Leftovers in buffer (bytes read, #leftovers): ˙U 1R (14, 0)" like messages are not normal, I got them periodically. I just terminated it with ctrl-c.

therealmuffin commented 8 years ago

Good to hear that it works. As long as all works as expected and both ways (volume/input/power/mute) I wouldn't worry to much about that output. The Connect sends out a lot of data Synchronator doesn't need (input names, zone names and a bunch I didn't figure out). The buffer will be emptied once a useful command is detected or the buffer is full.

If it doesn't work as expected/desired please create a new issue, it seems this issue is solved...

Kind regards, Maarten