I am new to python, and currently i am working on a module where i
need to make a audio recorder in wxpython.
i am importing gst, dbus, sys and time in my program and making a
recorder that works on command line. It asks for a input device to
select and then asks for the path and filename to record the audio
in .ogg format. I tested this code on a machine and it worked fine,
but when i am trying on the other machine, i am getting errors. Below
is the list of errors thrown during execution.
vam@bot:~$ ./PythonGstreamerAudioRecorder.py
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
Traceback (most recent call last):
File "./PythonGstreamerAudioRecorder.py", line 135, in <module>
device_id = audiorecorder.get_capture_device_id()
File "./PythonGstreamerAudioRecorder.py", line 62, in
get_capture_device_id
identifiers = self.list_capture_devices()
File "./PythonGstreamerAudioRecorder.py", line 40, in
list_capture_devices
hal_manager = bus.get_object("org.freedesktop.Hal", "/org/
freedesktop/Hal/Manager")
File "/usr/lib/pymodules/python2.6/dbus/bus.py", line 244, in
get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 241, in
__init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib/pymodules/python2.6/dbus/bus.py", line 183, in
activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib/pymodules/python2.6/dbus/bus.py", line 281, in
start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 620, in
call_blocking
message, timeout)
dbus.exceptions.DBusException:
org.freedesktop.DBus.Error.ServiceUnknown: The name
org.freedesktop.Hal was not provided by any .service files
What could be the possible reason for these errors??
Note: i have tested the microphone on this machine using the default
audio recorder application of Ubuntu 10.10, and it works fine.
I am new to python, and currently i am working on a module where i
need to make a audio recorder in wxpython.
i am importing gst, dbus, sys and time in my program and making a
recorder that works on command line. It asks for a input device to
select and then asks for the path and filename to record the audio
in .ogg format. I tested this code on a machine and it worked fine,
but when i am trying on the other machine, i am getting errors. Below
is the list of errors thrown during execution.
vam@bot:~$ ./PythonGstreamerAudioRecorder.py
...
File "./PythonGstreamerAudioRecorder.py", line 40, in
list_capture_devices
hal_manager = bus.get_object("org.freedesktop.Hal", "/org/
freedesktop/Hal/Manager")
...
dbus.exceptions.DBusException:
org.freedesktop.DBus.Error.ServiceUnknown: The name
org.freedesktop.Hal was not provided by any .service files
What could be the possible reason for these errors??
Well, this is just one error. It seems pretty clear -- the dbus
implementation on this machine doesn't have an interface called
"org.freedesktop.Hal". D-Bus implementations are still quite fluid.
It's likely that your second machine is using a different distribution
of Linux, or an older kernel, or a different desktop environment that
implements D-Bus differently.
You will have to trap this error (using try/except, for example), and
use a different strategy for enumerating the audio devices on this
machine. Is that what you're using D-Bus for?
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.