Linux PS3 Wireless Stereo Headset on XBMCbuntu
#1
Question 
Greetings!

I purchased a PS3 Wireless Stereo Headset for use with my PS3 and Windows machines (where the USB dongle provides total plug-and-play configuration). After reading about Chris Lane's flawless plug-and-play experience using this headset on an Ubuntu 11 machine, I decided I wanted to investigate getting this headset to work with my XBMCbuntu (which, obviously, shares a great deal in common with Ubuntu 11) .

My XBMCbuntu machine is an Acer AspireRevo 1600 running XBMCbuntu Eden.

My experience thus far:

1. Plug the USB dongle into the Revo
2. Navigate to Settings -> System -> Audio output
3. Change "Audio output device" to each of the three related settings
3.a. Wireless Stereo Headset - hdmi - 0 (ALSA)
3.b. Wireless Stereo Headset - iec958 - 0 (ALSA)
3.c. Wireless Stereo Headset - default - 0 (ALSA)
4. Change "Passthrough output device" to each of the two related settings
4.a. Wireless Stereo Headset - hdmi - 0 (ALSA)
4.b. Wireless Stereo Headset - iec958 - 0 (ALSA)

So far, every combination of settings I select provides the same results... on opening any video file, an error notification displays saying "Failed to initialize audio device" as the video plays silently.

The only other thing I could think to check was SSH'ing into my XBMCbuntu and running alsamixer. In alsamixer, I can select a second card - Wireless Stereo Headset. Nothing seems out of the ordinary there, although I admit I don't know exactly what to look for.

Can anyone provide some guidance about how I should proceed?

Thanks!
XBMCbuntu 11 (Eden)
Acer AspireRevo 1600
Reply
#2
With the dongle plugged in, drop to a terminal and issue the following command:
Code:
sudo aplay -l
This should list all playback devices. Post the results here, you may have to create an /etc/asound.conf file and have custom entries for output devices to get the headset to work.
Reply
#3
(2012-05-29, 23:04)pumkinut Wrote: With the dongle plugged in, drop to a terminal and issue the following command:
Code:
sudo aplay -l
This should list all playback devices. Post the results here, you may have to create an /etc/asound.conf file and have custom entries for output devices to get the headset to work.

Code:
**** List of PLAYBACK Hardware Devices ****
Home directory /home/user not ours.
card 0: NVidia [HDA NVidia], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Headset [Wireless Stereo Headset], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
XBMCbuntu 11 (Eden)
Acer AspireRevo 1600
Reply
#4
Ran a few more queries:

Code:
$ cat /proc/asound/modules
0 snd_hda_intel
1 snd_usb_audio

Code:
$ cat /proc/asound/cards
0 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xfae78000 irq 20
1 [Headset        ]: USB-Audio - Wireless Stereo Headset
                      Sony Computer Entertainment Wireless Stereo Headset at usb-0000:00:04.0-6, full

I followed the suggestions of this fellow, who was providing sample alsa-base.conf and asound.conf entries to automatically set up a USB Audio device. But it seems his advice was more about that default selection than simply working, per se. Needless to say, following his suggestions did absolutely nothing to make sound come through my headset.

Any advice would be greatly appreciated.
By the way, I did also try this as an asound.conf

Code:
pcm.!default {
    type hw
    card 1
}
ctl.!default {
    type hw
    card 1
}

No dice.
XBMCbuntu 11 (Eden)
Acer AspireRevo 1600
Reply
#5
Sorry, I meant to get back to you, but life got in the way.

From your output of aplay -l, it looks like your wireless dongle is card 1 device 0. What you can try as an /etc/asound.conf file is as follows:
Code:
pcm.!default {
   type plug
   slave {
       pcm "hw:1,0"
   }
}

Then in your settings, under audio output try "Custom" and in the open field type in "plughw:1,0" (remembering it's case sensitive).

I can't guarantee that will work, but it's worth a shot.

Edit:
You can also test different settings with the speakertest command that comes with alsa-utils. Basically, you feed it card parameters and it outputs an audio signal using them. If you can hear sound, then the settings should be good. For your settup, given the results of aplay -l, you could try:
Code:
speaker-test -D plughw:1,0 -c2
This uses card 1, device 0, and 2 channel sound.
Reply
#6
Awesome, it works! Thanks!
XBMCbuntu 11 (Eden)
Acer AspireRevo 1600
Reply
#7
Thank you pumkinut...your post helped me with a similar headphone jack output problem on a ZBOX AD04 Plus. Just picked it up from Fry's last night.

First, I listed the devices with aplay -l to see what's available. Card 1: SB [HDA ATI SB], device:0 ALC892 Analog [ALC892 Analog] looked like the right choice.

In XBMC's audio settings, I used Analog 2.1 (old Soundblaster speakers/sub), and set the output to Custom, typing plughw:1,0

So happy now that I don't have to use our plasma's speakers through HDMI Big Grin

Been using XBMCbuntu for a few months now on various hardware, and loving it. Also enjoying the Constellation app on the iPhone.

Reply
#8
(2012-06-03, 03:36)ping_localhost Wrote: Awesome, it works! Thanks!

Great! Glad to hear it's working.
You're welcome.
Reply
#9
Followup question...

I wanted to mess around with named PCMs, the end goal being to make a simultaneous output between the HDMI and USB headset. The first step was the individual plugs.

Code:
pcm.digital {
   type plug
   slave {
       pcm "hw:0,3"
   }
}

pcm.usb {
   type plug
   slave {
       pcm "hw:1,0"
   }
}

My base test was to set the custom audio output setting to "digital" or "plug:digital". When I tried to open video files, I got that dreaded "Failed to initialize audio device". However -- if I run
Code:
speaker-test -D digital -c2
I get the correct sound from the TV.

How do I properly reference a named PCM entry from XBMC so it will play through the TV correctly as well?

Thanks!
XBMCbuntu 11 (Eden)
Acer AspireRevo 1600
Reply
#10
Not sure, maybe try plughw:digital?
Reply
#11
Alright! First, I had lots of trouble getting named PCMs to be used, until I found the key. Address them with "alsa" -- "alsa:digital", and reboot after all the changes I made to the configuration.

That said, I was really driven to find a way to have multiple audio outputs -- the HDMI for the television itself, the USB headset, and (hey, why not?) the stereo jack on the Revo.

I basically attached what I learned from pumkinut (who I greatly thank for putting me on the right path), to this fully built out configuration from liamf. And it all works!

My configuration:
Code:
# ~/.asoundrc or /etc/asound.conf
# ALSA configuration file

##### USAGE #####
# Save this file as "~/.asoundrc" (for user-specific sound configuration) or
# "/etc/asound.conf" (for system-wide sound configuration) and specify ALSA
# device names ad described in the next section.


##### DEVICE NAMES #####
# This configuration file defines four devices for use by the user.  Those
# devices are "analog", "mixed-analog", "digital", and "mixed-digital".  The
# user may also re-define "default" to be identical to one of the above-named
# devices (i.e. to send all sound output to the digital output unless otherwise
# specified).  Use the device names as described below:
#  - "analog" outputs to the analog output directly and (at least on software
#  sound cards) blocks other audio output.  After playback completes, "queued"
#  sounds are output in sequence.
#  - "mixed-analog" mixes audio output from multiple programs into the analog
#  output (so you can hear beeps, alerts, and other noises while playing back
#  an audio stream).
#  - "digital" outputs to the digital output directly.  Since most (all?)
#  digital outputs expect 48kHz PCM audio, this may not work for some playback
#  (i.e. CD's--which are 44.1kHz PCM audio--or 32kHz audio streams from TV
#  recordings, etc.).
#  - "mixed-digital"

# All other devices created within this file are used only by the configuration
# file itself and should /not/ be used directly.  In other words, do not use
# the devices "analog-hw", "dmix-analog", "digital-hw", or "dmix-digital".


##### IMPORTANT #####
# To make this ALSA configuration file work with your sound card, you will need
# to define the appropriate card and device information for the "analog-hw" and
# "digital-hw" devices below.  You can find the card and device information
# using "aplay -l".

# Alias for (converted) analog output on the card
# - This is identical to the device named "default"--which always exists and
# refers to hw:0,0 (unless overridden)
# - Therefore, we can specify "hw:0,0", "default", or "analog" to access analog
# output on the card
# - Note that as of ALSA 1.0.9, "software" sound card definitions redefine
# "default" to do mixing, meaning this device is different from "default" and
# allows playback while blocking other sound sources (until playback
# completes).
pcm.analog {
  type plug
  slave.pcm "analog-hw"
  hint {
    show on
    description "Analog Output - Use analog outputs, converting samples, format, and rate as necessary."
  }
}

# Control device (mixer, etc.) for the card
ctl.analog {
  type hw
  card 0
}

# Alias for (converted) mixed analog output on the card
# - This will accept audio input--regardless of rate--and convert to the rate
# required for the dmix plugin (in this case 48000Hz)
# - Note that as of ALSA 1.0.9, "software" sound card definitions redefine
# "default" to do mixing, meaning this device is identical to "default" for
# "software" sound cards.
pcm.mixed-analog {
  type plug
  slave.pcm "dmix-analog"
  hint {
    show on
    description "Mixed Analog Output - Use analog outputs, converting samples, format, and rate as necessary. Allows mixing with system sounds."
  }
}

# Control device (mixer, etc.) for the card
ctl.mixed-analog {
  type hw
  card 0
}

# Alias for (converted) digital (HDMI) output on the card
pcm.digital {
  type plug
  slave.pcm "digital-hw"
  hint {
    show on
    description "Digital Output - Use digital outputs, converting samples, format, and rate as necessary."
  }
}

# Control device (mixer, etc.) for the card
ctl.digital {
  type hw
  card 0
}

# Alias for mixed (converted) digital (HDMI) output on the card

pcm.mixed-digital {
  type plug
  slave.pcm "dmix-digital"
  hint {
    show on
    description "Mixed Digital Output - Use digital outputs, converting samples, format, and rate as necessary. Allows mixing with system sounds."
  }
}

# Control device (mixer, etc.) for the card
ctl.mixed-digital {
  type hw
  card 0
}

# Alias for (converted) USB output on the card
pcm.usb {
  type plug
  slave.pcm "usb-hw"
  hint {
    show on
    description "USB Output - Use USB outputs, converting samples, format, and rate as necessary."
  }
}

# Control device (mixer, etc.) for the card
ctl.usb {
  type hw
  card 0
}

# Alias for mixed (converted) digital (HDMI) output on the card

pcm.mixed-usb {
  type plug
  slave.pcm "dmix-usb"
  hint {
    show on
    description "Mixed USB Output - Use USB outputs, converting samples, format, and rate as necessary. Allows mixing with system sounds."
  }
}

# Control device (mixer, etc.) for the card
ctl.mixed-usb {
  type hw
  card 0
}

# The following devices are not useful by themselves.  They require specific
# rates, channels, and formats.  Therefore, you probably do not want to use
# them directly.  Instead use of of the devices defined above.

# Alias for analog output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.analog-hw {
  type hw
  card 0
  device 0
}

# Control device (mixer, etc.) for the card
ctl.analog-hw {
  type hw
  card 0
}

# Alias for digital (HDMI) output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.digital-hw {
  type hw
  card 0
  device 3
}

# Control device (mixer, etc.) for the card
ctl.digital-hw {
  type hw
  card 0
}

# Alias for USB output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.usb-hw {
  type hw
  card 1
  device 0
}

# Control device (mixer, etc.) for the card
ctl.usb-hw {
  type hw
  card 1
}

# Direct software mixing plugin for analog output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.dmix-analog {
  type dmix
  ipc_key 1234
  slave {
    pcm "analog-hw"
    period_time 0
    period_size 1024
    buffer_size 4096
    rate 48000
  }
}

# Control device (mixer, etc.) for the card
ctl.dmix-analog {
  type hw
  card 0
}

# Direct software mixing plugin for digital (S/PDIF) output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.dmix-digital {
  type dmix
  ipc_key 1235
  slave {
    pcm "digital-hw"
    period_time 0
    period_size 1024
    buffer_size 4096
    rate 48000
  }
}

# Control device (mixer, etc.) for the card
ctl.dmix-digital {
  type hw
  card 0
}

# Direct software mixing plugin for USB output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.dmix-usb {
  type dmix
  ipc_key 4321
  slave {
    pcm "usb-hw"
    period_time 0
    period_size 1024
    buffer_size 4096
    rate 48000
  }
}

# Control device (mixer, etc.) for the card
ctl.dmix-usb {
  type hw
  card 1
}

# Make joint analog/HDMI the default
pcm.!default {
  type plug
  slave {
    pcm multi
    rate 48000
  }
  ttable.0.0 1.0
  ttable.1.1 1.0
  ttable.0.2 1.0
  ttable.1.3 1.0
  ttable.0.4 1.0
  ttable.1.5 1.0
}

# Control device (mixer, etc.) for the card
ctl.!default {
  type hw
  card 0
}

pcm.xbmc {
  type plug
  slave {
    pcm multi
    rate 48000
    channels 4
  }
  ttable.0.0 1.0
  ttable.1.1 1.0
  ttable.0.2 1.0
  ttable.1.3 1.0
  ttable.0.4 1.0
  ttable.1.5 1.0
}


ctl.xbmc {
  type hw
  card 0
}

pcm.multi {
  type multi
  slaves.a.pcm "analog-hw"
  slaves.a.channels 2
  slaves.b.pcm "digital-hw"
  slaves.b.channels 2
  slaves.c.pcm "usb-hw"
  slaves.c.channels 2
  bindings.0.slave a
  bindings.0.channel 0
  bindings.1.slave a
  bindings.1.channel 1
  bindings.2.slave b
  bindings.2.channel 0
  bindings.3.slave b
  bindings.3.channel 1
  bindings.4.slave c
  bindings.4.channel 0
  bindings.5.slave c
  bindings.5.channel 1
}

ctl.multi {
  type hw
  card 0
}

Now off to enjoy my many audio outputs!
XBMCbuntu 11 (Eden)
Acer AspireRevo 1600
Reply
#12
(2012-06-02, 18:43)pumkinut Wrote: From your output of aplay -l, it looks like your wireless dongle is card 1 device 0. What you can try as an /etc/asound.conf file is as follows:
Code:
pcm.!default {
   type plug
   slave {
       pcm "hw:1,0"
   }
}

Awesome. This worked for me. I have an old PC that I'm converting to a home theater, running Linux Mint 15 and XBMC.

The difference on my PC was that a Soundblaster card was card 0, the motherboard's onboard audio was card 1, and the USB was card 2. I changed the line to
Code:
pcm "hw:2,0,1"
This worked.
Reply

Logout Mark Read Team Forum Stats Members Help
PS3 Wireless Stereo Headset on XBMCbuntu2