linear HW volume - the next chapter.
The 16.16 fixed point values delivered by slimproto.c
just generate a 0.5 dB change per VC click.
And that fixed point to dB conversion is done by sl.
That's where the problems seems to be. That -0.5 dB goes straight to
Alsa
which of course doesn't know what to do with it. The DAC doesn't offer
0.5dB steps.
To test this I added a wild hack to output_alsa.c:
Code:
--------------------
// convert 16.16 fixed point to dB
ldB = 20 * log10( left / 65536.0F );
rdB = 20 * log10( right / 65536.0F );
if (alsa.mixer_linear) {
ldB = ldB * 2;
rdB = rdB * 2;
}
set_mixer(false, ldB, rdB);
}
--------------------
I just doubled the calculated dB values: 0.5 ->1dB). ( I wouldn't know
what to do on the server side.)
And. That somehow worked.
I then was also wondering if the MINVOL_DB is causing issues.
It's set to
Code:
--------------------
#define MINVOL_DB 72
--------------------
That's not gonna work on the the 100dB+ HW VC scale. I also changed it
to 100 to match the DAC for the test.
Below the related logs.
Code:
--------------------
root@arch:~# amixer sget Digital
Simple mixer control 'Digital',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 100
Mono: Playback 88 [88%] [-12.00dB] [on]
root@arch:~# echo -e "b8:27:eb:87:93:c3 mixer volume 100\nexit\n" | nc -q 2
192.168.1.20 9090
b8%3A27%3Aeb%3A87%3A93%3Ac3 mixer volume 100
root@arch:~# amixer sget Digital
Simple mixer control 'Digital',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 100
Mono: Playback 100 [100%] [0.00dB] [on]
root@arch:~# echo -e "b8:27:eb:87:93:c3 mixer volume 99\nexit\n" | nc -q 2
192.168.1.20 9090
b8%3A27%3Aeb%3A87%3A93%3Ac3 mixer volume 99
root@arch:~# amixer sget Digital
Simple mixer control 'Digital',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 100
Mono: Playback 99 [99%] [-1.00dB] [on]
root@arch:~# echo -e "b8:27:eb:87:93:c3 mixer volume 88\nexit\n" | nc -q 2
192.168.1.20 9090
b8%3A27%3Aeb%3A87%3A93%3Ac3 mixer volume 88
root@arch:~# amixer sget Digital
Simple mixer control 'Digital',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 100
Mono: Playback 88 [88%] [-12.00dB] [on]
root@arch:~#
--------------------
Code:
--------------------
[12:22:01.015847] process:514 audg
[12:22:01.016003] process_audg:426 audg gainL: 65536 gainR: 65536 adjust: 1
[12:22:01.016075] set_volume:246 set_volume output.gainL: 65536 output.gainR:
65536
[12:22:01.016135] set_mixer:193 setting vol linear [0..100]
[12:22:01.016698] set_mixer:226 Digital left: 0.0dB -> 100 right: 0.0dB -> 100
[12:22:01.017277] process:514 audg
[12:22:01.017352] process_audg:426 audg gainL: 65536 gainR: 65536 adjust: 1
[12:22:01.017416] set_volume:246 set_volume output.gainL: 65536 output.gainR:
65536
[12:22:01.017473] set_mixer:193 setting vol linear [0..100]
[12:22:01.017528] set_mixer:226 Digital left: 0.0dB -> 100 right: 0.0dB -> 100
[12:22:03.085448] process:514 audg
[12:22:03.085604] process_audg:426 audg gainL: 61952 gainR: 61952 adjust: 1
[12:22:03.085678] set_volume:246 set_volume output.gainL: 65536 output.gainR:
65536
[12:22:03.085740] set_mixer:193 setting vol linear [0..100]
[12:22:03.086306] set_mixer:226 Digital left: -1.0dB -> 99 right: -1.0dB -> 99
[12:22:03.086560] process:514 audg
[12:22:03.086623] process_audg:426 audg gainL: 61952 gainR: 61952 adjust: 1
[12:22:03.086682] set_volume:246 set_volume output.gainL: 65536 output.gainR:
65536
[12:22:03.086740] set_mixer:193 setting vol linear [0..100]
[12:22:03.086795] set_mixer:226 Digital left: -1.0dB -> 99 right: -1.0dB -> 99
[12:22:04.003164] process:514 strm
[12:22:04.003323] process_strm:264 strm command t
[12:22:04.003385] sendSTAT:179 STAT: STMt
[12:22:05.158630] process:514 audg
[12:22:05.158787] process_audg:426 audg gainL: 33024 gainR: 33024 adjust: 1
[12:22:05.158855] set_volume:246 set_volume output.gainL: 65536 output.gainR:
65536
[12:22:05.158915] set_mixer:193 setting vol linear [0..100]
[12:22:05.159482] set_mixer:226 Digital left: -11.9dB -> 88 right: -11.9dB ->
88
[12:22:05.159683] process:514 audg
[12:22:05.159740] process_audg:426 audg gainL: 33024 gainR: 33024 adjust: 1
[12:22:05.159796] set_volume:246 set_volume output.gainL: 65536 output.gainR:
65536
[12:22:05.159853] set_mixer:193 setting vol linear [0..100]
[12:22:05.159907] set_mixer:226 Digital left: -11.9dB -> 88 right: -11.9dB ->
88
[12:22:08.003069] process:514 strm
--------------------
:::' my audioblog - latest series: RaspBerry PI - \"The Audio Engine\"
' (http://soundcheck-audio.blogspot.com):::
------------------------------------------------------------------------
soundcheck's Profile: http://forums.slimdevices.com/member.php?userid=34383
View this thread: http://forums.slimdevices.com/showthread.php?t=97046
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix