• Category Archives Software
  • How to make PulseAudio work with Nvidia HDMI audio outputs under Fedora and Ubuntu

    Normally the sound setup for my machine consists of a pair of Wharfedale speakers and a Temple Audio Bantam XC2 amplifier. Due to the fact I’ll be returning home later this morning for my final Easter vacation, pretty much everything I have is packed up in boxes right now; the machine and screen remain on the desk, however. Driven by the desire to listen to music while I finished packing, I decided to get output over HDMI working (having had problems with it in Fedora [14] and Ubuntu [10.10] in the past). I have an iiyama monitor which has speakers built in and is connected to a GTX 470 graphics card by HDMI.

    The problem was that although the PulseAudio Volume Control applet (pavucontrol) showed the output (as “G100 High Definition Audio Controller (HDMI)”), when I redirected output streams to the device I simply heard no sound. As I didn’t have this problem under Windows I knew it was a software issue.

    After some more experimentation using aplay I figured out that the problem was due to PulseAudio outputting to the wrong HDMI subdevice. This I did by running aplay -l:

    [dhpiggott@panther ~]$ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: Intel [HDA Intel], device 0: ALC889 Analog [ALC889 Analog]
    Subdevices: 0/1
    Subdevice #0: subdevice #0
    card 0: Intel [HDA Intel], device 1: ALC889 Digital [ALC889 Digital]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: NVidia [HDA NVidia], device 7: NVIDIA HDMI [NVIDIA HDMI]
    Subdevices: 0/1
    Subdevice #0: subdevice #0
    card 1: NVidia [HDA NVidia], device 8: NVIDIA HDMI [NVIDIA HDMI]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: NVidia [HDA NVidia], device 9: NVIDIA HDMI [NVIDIA HDMI]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    

    I then tested out each subdevice to determine which actually produced sound:

    aplay -D hw:1,3 testsound.wav
    aplay -D hw:1,7 testsound.wav
    aplay -D hw:1,8 testsound.wav
    aplay -D hw:1,9 testsound.wav
    

    I found that 7, 8 and 9 would produce sound while 3 did not. Assuming the problem was that PulseAudio was using 3, I set about changing that:

    1. Open /etc/pulse/default.pa
    2. Find the line “load-module module-udev-detect” and comment it out with a #
    3. Paste in at the end of the file entries that will manually load the necessary modules for your hardware. In my case:
    load-module module-alsa-sink device=hw:1,7
    load-module module-alsa-sink device=hw:0,0 (necessary so I can also use the Wharfedale speakers, since it will no longer be autoloaded).

    Having done this a simple killall pulseaudio was enough to make things work; I could resume Spotify playback and then redirect it successfully to the iiyama speakers using pavucontrol. One problem that came about was that the volume hotkeys on my keyboard stopped having any effect on actual audio volume as they weren’t being mapped to the right sink. Before I got a chance to look into it more I’d had to reboot the machine to move some cables, and this turned out to be enough. Perhaps even just logging out and back in again would have been sufficient.

    Hopefully this guide will help a few people; I came across plenty of posts by people having the same problem when I Googled it but no solutions.

    Notes:
    1. The system I did this on is running Fedora 14. As such I haven’t actually tested the solution on Ubuntu 10.10, but I know that the same problem exists from when this machine ran Ubuntu.
    2. It may be necessary to unmute the HDMI output channels using alsamixer (press F6 when in alsamixer to change device, press m to toggle mute/unmute status).


  • A small contribution to My Tracks

    Following on from SO37-38, O4, I’ve gone and reimplemented the import from GPX functionality (which just exposes existing import functionality to the user) to My Tracks that I hacked into it for Return to Cambridge and yet more cycling (I needed it again because today’s nightly build of CyanogenMod 7 for the HTC Hero seems to have made GPS fixes very intermittent). It turns out that there was actually an issue posted requesting such functionality back in May last year, and so I decided I may as well do a proper job this time and get it merged into My Tracks rather than just hacking something together and deleting it once I’d used it. I’ve set up my own clone of My Tracks, pushed the change to it and posted a review request. Hopefully it will get merged in soon and make its way into a Market release!


  • Route Tracer

    Route Tracer is a utility application I wrote a month or two ago, at the start of my final year project. Market QR code is after the description:

    Route Tracer is a utility that records smartphone sensor data to gzipped text log files on the SD card. Logs are tagged with a transportation mode (selected when recording is triggered).

    Recorded data:

    Accelerometer, light sensor, magnetic field, orientation, GPS location, GPS satellites

    Transportation tags:

    Bike, bus, walk, car, train

    RouteTracer is only half of an application; it provides recording but no viewing. What is done with the recorded data is up to you. Data is extracted by copying the files directly from the SD card.

    Depending on the phone type, it may be the case that only GPS data is recorded when the screen is switched off. This is due to a problem with certain Android phones, not this application. As a workaround, Route Tracer has an option to prevent the screen from being switched off when recording RouteTraces.

    Data can be recorded at one of four rates; with the default rate of HIGH, expect older phones to slow down while recording.

    Preview

    routetracer_1-0_screenshot_1 routetracer_1-0_screenshot_2

    New in 1.0.1

    • Added backwards compatability with Android 2.1.

    QR code


  • Note to self: todo.txt-cli

    I alternate between using pen and paper and a text file as my todo list. Both ways are pretty basic (anything more would be overkill). This morning I thought it might be handy to have a Bash script that would allow me to query and update the list in basic ways. The reason for not using anything more advanced (e.g. a specialised task management program, or writing my own that would use a database) is because it’s important that the list remains human readable and editable in any text editor. I was actually about to start writing a script that would do what I wanted but checked Google for an existing solution and found a nice script on github - todo.txt-cli - that does what I want.

    I’ve put the script in my home directory and set it to use my Desktop as the data directory; this means I get done.txt, report.txt and todo.txt files on my Desktop that I can edit myself, or interact with using the scipt. I’ve aliased it as t, as suggested in the project’s documentation – so to add a task I can just do:

    “t add Blog post about todo.txt-cli”

    The great thing about this is that I can use it via ConnectBot on my phone – and there is no synchronisation to do because there is just one list.

    Attached is a copy of 2.7 for my own reference – you can get the latest at from the github download page.

    todo.txt-cli (167)


  • Note to self: Logitech MX Revolution on Ubuntu 10.04 LTS

    To get the Logitech MX Revolution working in Ubuntu 10.04 there are two problems to overcome:

    1) The middle button doesn’t send middle click events by default but instead changes the scroll mode
    I installed revoco, having first of all modified the USB deviceID in the source to make it work with my Revolution which seems to be a newer version than that which revoco was written for (I found this out using lsusb). In principle you should only need to run the resulting binary once as it sets the default mode for the mouse on power up, but just to be sure I set up my Gnome session to run it every time I login.

    line: #define MX_REVOLUTION2 0xc525 // version RQR02.00_B0020
    becomes: #define MX_REVOLUTION2 0xc526 // version RQR02.00_B0020

    It’s then just a case of running make and executing the resulting revoco binary as ‘revoco free’.

    2) Not all the mouse buttons can be used
    I installed btnx and setup the buttons as I like them.

    See also: I’ve just stumbled across this blog post but haven’t tried it out.

    Attached is an unmodified copy of the revoco 0.5 source.
    Revoco 0.5 source (120)



  • dinamic_sidebar 4 none

©2012 piggott.me.uk Entries (RSS) and Comments (RSS)  Raindrops Theme