Home AMX User Forum AMX General Discussion

Sony AV Receiver Volume

Hello,

I am working on a comm module for a sony STR-DA5300ES av receiver. I am stuck on the volume feedback.

The front panel of the device shows volume db in the range from -infinity to +23. The data from the comm port is two bytes, Volume Step High and Volume Step Low.

Volume Step High matches the display for positive numbers, 128 for -infinity, one step up is 164 for -92, 255 for -1.

Volume Step Low is 0 for .0, 128 for .5.

What kind of data is this? A Float? Sinteger? Ultimately I woluld lke to convert it to a level value 0 to 255.

I got the protocol here: http://www.amxforums.com/showthread.php?t=3065

Thanks,
Joe

Comments

  • Two's Complement

    If you do a google search under "two's complement" it will give you an idea of how negative numbers are represented in Hex or Binary.

    Here's an example:

    Convert the decimal number from the queue to binary, then take the complement (subtract each bit from 1), then add +1, then convert it back to decimal.
    E.G.:

    -92 volume on dial gives you feedback of 164 in queue.

    164 = 1010 0100 (* using the two's complement, the left most bit is the sign bit where '1' indicates a negative number*)
     1111 1111       (*complement it by subtracting it from 1111 1111*)
    -1010 0100
    ---------------------
    =0101 1011
    
     0101 1011
    +0000 0001       (*add +1 to the result*)
    ----------------------
    =0101 1100
    
    Convert it back to decimal,
    0101 1100 = 92. Since the original sign bit was negative, 164 represents -92.
    ________________________________________

    Using 255 as the other number you received from the queue:
    255 = 1111 1111 (the leftmost '1' indicates the number is negative)
    Take the complement:
     1111 1111
    -1111 1111
    ------------------
     0000 0000
    +0000 0001
    -------------------
    = 0000 0001
    
    Convert 0000 0001 back to decimal gives you 1.
    Since the original sign bit in [b]1[/b]111 1111 (255 decimal) indicates negative, 255 represents a volume of -1
    

    --John
  • TurnipTruckTurnipTruck Posts: 1,485
    AMX's comm module for the STR-DA7ES is almost identical to what you are creating on your own. The difference is that the newer Sony receivers' volume levels go into the +dB range, which the DA7ES did not. Therefore yiou can use the DA7ES module, but you won't be able to turn the volume up all the way up.

    The AMX module uses a [101][2] cross reference chart for volume levels, rather than calculating.
  • Joe TJoe T Posts: 10
    John,

    Thanks for the reply. Not only did you answer my question, but also took the time to post an example of how to do the conversion.

    Again thanks for your time

    Turnip,

    I started with the da7 comm module but, with the amount of overide code (using passthru)needed in the UI module (inputs, soundfields, tuner presets) I thought I would bite the bullet and write my own module. and the feedback was so bad (volume at -infinity would report volume 100, and as you mentioned +db dosen't work). I would never turn it up that loud :) It just seemed the way to go.

    Thanks for th replies,
    Joe
  • TurnipTruckTurnipTruck Posts: 1,485
    Be sure to include the Broadcast Mode command in your module. It will cause the receiver to issue unsolicited feedback of all fron tpanel and IR remote changes.
Sign In or Register to comment.