Skip to content

Commit

Permalink
Bring dropped bluez4 back
Browse files Browse the repository at this point in the history
  • Loading branch information
elros34 committed Mar 20, 2022
1 parent b3b8cd0 commit 94fcec9
Show file tree
Hide file tree
Showing 16 changed files with 485 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .gitignore
@@ -1,3 +1,8 @@
documentation.list
debugfiles.list
debuglinks.list
debugsourcefiles.list
debugsources.list
elfbins.list
installroot
tmp
27 changes: 27 additions & 0 deletions rpm/droid-config-moto_msm8960_jbbl.spec
Expand Up @@ -22,6 +22,33 @@
# We assume most devices will
%define have_modem 1

# dropped bluez4 packaging
Provides: droid-config-%{device}-bluez4
Conflicts: droid-config-%{device}-bluez5
Provides: %{device}-bluez-configs

Requires: bluez
Conflicts: bluez5

Requires: bluez-libs
Conflicts: bluez5-libs

Requires: obexd
Conflicts: bluez5-obexd

Requires: obexd-server
# no obexd-server equivalent in BlueZ 5, so no conflict

Requires: kf5bluezqt-bluez4
Conflicts: kf5bluezqt-bluez5

Provides: bluez-configs
Conflicts: bluez5-configs
Obsoletes: bluez-configs-sailfish > 0.0.1
Obsoletes: bluez-configs-mer > 0.0.1

Requires: pulseaudio-modules-bluez4

%include droid-configs-device/droid-configs.inc
%include patterns/patterns-sailfish-device-adaptation-moto_msm8960_jbbl.inc
%include patterns/patterns-sailfish-device-configuration-moto_msm8960_jbbl.inc
Expand Down
1 change: 1 addition & 0 deletions sparse/etc/bluetooth
9 changes: 9 additions & 0 deletions sparse/etc/bluez4/bluetooth/input.conf
@@ -0,0 +1,9 @@
# Configuration file for the input service

# This section contains options which are not specific to any
# particular interface
[General]

# Set idle timeout (in minutes) before the connection will
# be disconnect (defaults to 0 for no timeout)
#IdleTimeout=30
5 changes: 5 additions & 0 deletions sparse/etc/bluez4/bluetooth/jolla.conf
@@ -0,0 +1,5 @@
[General]
Wakelocks=true

[Security]
DBusAuthorizedGroups=root,privileged
65 changes: 65 additions & 0 deletions sparse/etc/bluez4/bluetooth/main.conf
@@ -0,0 +1,65 @@
[General]

# List of plugins that should not be loaded on bluetoothd startup
#DisablePlugins = network,input

# Default adaper name
# %h - substituted for hostname
# %d - substituted for adapter id
Name=

# Default device class. Only the major and minor device class bits are
# considered.
# Phone, smart-phone
Class = 0x00020c

# How long to stay in discoverable mode before going back to non-discoverable
# The value is in seconds. Default is 180, i.e. 3 minutes.
# 0 = disable timer, i.e. stay discoverable forever
DiscoverableTimeout = 0

# How long to stay in pairable mode before going back to non-discoverable
# The value is in seconds. Default is 0.
# 0 = disable timer, i.e. stay pairable forever
PairableTimeout = 0

# Use some other page timeout than the controller default one
# which is 16384 (10 seconds).
PageTimeout = 8192

# Automatic connection for bonded devices driven by platform/user events.
# If a platform plugin uses this mechanism, automatic connections will be
# enabled during the interval defined below. Initially, this feature
# intends to be used to establish connections to ATT channels.
AutoConnectTimeout = 60

# What value should be assumed for the adapter Powered property when
# SetProperty(Powered, ...) hasn't been called yet. Defaults to true
InitiallyPowered = true

# Remember the previously stored Powered state when initializing adapters
RememberPowered = true

# Use vendor id source (assigner), vendor, product and version information for
# DID profile support. The values are separated by ":" and assigner, VID, PID
# and version.
# Possible vendor id source values: bluetooth, usb (defaults to usb)
#DeviceID = bluetooth:1234:5678:abcd

# Do reverse service discovery for previously unknown devices that connect to
# us. This option is really only needed for qualification since the BITE tester
# doesn't like us doing reverse SDP for some test cases (though there could in
# theory be other useful purposes for this too). Defaults to true.
ReverseServiceDiscovery = true

# Enable name resolving after inquiry. Set it to 'false' if you don't need
# remote devices name and want shorter discovery cycle. Defaults to 'true'.
NameResolving = true

# Enable runtime persistency of debug link keys. Default is false which
# makes debug link keys valid only for the duration of the connection
# that they were created for.
DebugKeys = false

# Enable the GATT functionality. Default is false
EnableGatt = false
6 changes: 6 additions & 0 deletions sparse/etc/bluez4/bluetooth/network.conf
@@ -0,0 +1,6 @@
# Configuration file for the network service

[General]

# Disable link encryption: default=false
#DisableSecurity=true
17 changes: 17 additions & 0 deletions sparse/etc/bluez4/bluetooth/rfcomm.conf
@@ -0,0 +1,17 @@
#
# RFCOMM configuration file.
#

#rfcomm0 {
# # Automatically bind the device at startup
# bind no;
#
# # Bluetooth address of the device
# device 11:22:33:44:55:66;
#
# # RFCOMM channel for the connection
# channel 1;
#
# # Description of the connection
# comment "Example Bluetooth device";
#}
10 changes: 10 additions & 0 deletions sparse/etc/bluez4/bluetooth/serial.conf
@@ -0,0 +1,10 @@
# Configuration file for serial

# There could be multiple proxy sections, the format is [Proxy <user chosen name>]
#[Proxy DUN]

# UUID for DUN proxy service
#UUID=00001103-0000-1000-8000-00805F9B34FB

# Address for device node
#Address=/dev/ttyx
3 changes: 0 additions & 3 deletions sparse/etc/pulse/arm_droid_card_custom.pa

This file was deleted.

137 changes: 137 additions & 0 deletions sparse/etc/pulse/arm_droid_default.pa
@@ -0,0 +1,137 @@
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.nofail

.fail

# Transitional check as keepalive module is moved away from droid modules.
.ifexists module-keepalive.so
load-module module-keepalive
.else
load-module module-droid-keepalive
.endif

### If droid-card needs other arguments than the default, have the new
### load-module line in /etc/pulse/arm_droid_card_custom.pa
.ifexists /etc/pulse/arm_droid_card_custom.pa
.include /etc/pulse/arm_droid_card_custom.pa
.else
load-module module-droid-card rate=48000 quirks=+input_atoi
.endif

### Needed on many new devices. HADK guide explains how to implement this fully
.ifexists module-droid-glue.so
.nofail
load-module module-droid-glue
.fail
.endif

.ifexists module-droid-hidl.so
.nofail
load-module module-droid-hidl
.fail
.endif

load-module module-meego-parameters cache=1 directory=/var/lib/nemo-pulseaudio-parameters use_voice=false
load-module module-meego-mainvolume virtual_stream=true unmute_delay=600

### Automatically restore the volume of streams
# load configuration based on bluez version
.ifexists /etc/pulse/bluez5_stream_restore.pa
.include /etc/pulse/bluez5_stream_restore.pa
.else
.include /etc/pulse/bluez4_stream_restore.pa
# fake sco sink and source are needed only by bluez4 device
load-module module-null-sink sink_name=sink.fake.sco rate=8000 channels=1
load-module module-null-source source_name=source.fake.sco rate=8000 channels=1
.endif

load-module module-match table=/etc/pulse/x-maemo-match.table key=application.name

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

load-module module-null-sink sink_name=sink.null rate=48000
load-module module-null-source source_name=source.null rate=48000

load-module module-bluetooth-discover bluez4_args="sco_sink=sink.fake.sco sco_source=source.fake.sco" bluez5_args="headset=droid"

load-module module-policy-enforcement

load-module module-role-ducking trigger_roles=notification,warning ducking_roles=x-maemo volume=-12dB duck_while_corked=true

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GConf settings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gconf.so
.nofail
load-module module-gconf
.fail
.endif

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle timeout=1

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Load DBus protocol
.ifexists module-dbus-protocol.so
load-module module-dbus-protocol
.endif

### Set default sink and source to sink.null and source.null, respectively. PulseAudio default
### sink/source handling will move orphaned sink-inputs and source-outputs to default ones.
### Policy enforcement module then moves the streams to new appropriate sinks or sources.
set-default-sink sink.null
set-default-source source.null
2 changes: 2 additions & 0 deletions sparse/etc/pulse/bluez4_stream_restore.pa
@@ -0,0 +1,2 @@
### Bluez4 specific module arguments
load-module module-stream-restore-nemo restore_device=no restore_volume=yes restore_muted=no route_table=/etc/pulse/x-maemo-route.table fallback_table=/etc/pulse/x-maemo-stream-restore.table use_voice=false sink_volume_table=/etc/pulse/x-maemo-sink-volume.table

0 comments on commit 94fcec9

Please sign in to comment.