We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2015-02-23 14:32:54 +0200

Audio control in sailfish: Setting volume via cmd-line

Hello everyone,

based on the request https://together.jolla.com/question/27201/request-system-wide-equalizer/ I was playing around with pulseaudio and wondering how simple/complicate building a native equalizer might be.

At first I tried "pacmd list-sinks": Jolla shows 4 available sinks, with all on 100%, even when I change the volume on my phone there is no change in this number. So I suppose the volume is controlled on a higher lever. I tried to use amixer to set a different balance between left/right speaker but I only get that the command is unknown. Interestingly if I try the same on the sailfish emulator on the SDK, setting volume over pulseaudio and the use of amixer is possible, altough there is only one sink available.

[nemo@SailfishEmul ~]$ amixer sset Master 80%,20%
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 52429 [80%] [on]
  Front Right: Playback 13108 [20%] [on]
[nemo@SailfishEmul ~]$ pacmd set-sink-volume 0 32768
[nemo@SailfishEmul ~]$ pacmd list-sinks
1 sink(s) available.
  * index: 0
    name: <alsa_output.pci-0000_00_05.0.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY FLAT_VOLUME 
    state: SUSPENDED
    suspend cause: IDLE 
    priority: 9959
    volume: front-left: 32768 /  50% / -18.06 dB,   front-right: 8192 /  13% / -54.19 dB
            balance -0.75
    base volume: 41350 /  63% / -12.00 dB
    volume steps: 65537
[...]

Eventually I found this https://wiki.merproject.org/wiki/Nemo/Audio, where is decribed that at least for Mer/Nemo there is a gateway between the user and pulseaudio. Is there any documentation on this? Basically with alsa on pulseaudio getting a simple equalizer to work should be possible, I suppose.

What are your thoughts to this.

Cheers Mika

Audio control in sailfish: Setting volume via cmd-line

Hello everyone,

based on the request https://together.jolla.com/question/27201/request-system-wide-equalizer/ I was playing around with pulseaudio and wondering how simple/complicate building a native equalizer might be.

At first I tried "pacmd list-sinks": Jolla shows 4 available sinks, with all on 100%, even when I change the volume on my phone there is no change in this number. So I suppose the volume is controlled on a higher lever. I tried to use amixer to set a different balance between left/right speaker but I only get that the command is unknown. Interestingly if I try the same on the sailfish emulator on the SDK, setting volume over pulseaudio and the use of amixer is possible, altough there is only one sink available.

[nemo@SailfishEmul ~]$ amixer sset Master 80%,20%
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 52429 [80%] [on]
  Front Right: Playback 13108 [20%] [on]
[nemo@SailfishEmul ~]$ pacmd set-sink-volume 0 32768
[nemo@SailfishEmul ~]$ pacmd list-sinks
1 sink(s) available.
  * index: 0
    name: <alsa_output.pci-0000_00_05.0.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY FLAT_VOLUME 
    state: SUSPENDED
    suspend cause: IDLE 
    priority: 9959
    volume: front-left: 32768 /  50% / -18.06 dB,   front-right: 8192 /  13% / -54.19 dB
            balance -0.75
    base volume: 41350 /  63% / -12.00 dB
    volume steps: 65537
[...]

Eventually I found this https://wiki.merproject.org/wiki/Nemo/Audio, where is decribed that at least for Mer/Nemo there is a gateway between the user and pulseaudio. Is there any documentation on this? Basically with alsa on pulseaudio getting a simple equalizer to work should be possible, I suppose.

What are your thoughts to this.

Cheers Mika