[alsa-devel] PS3 - Surround sound on SPDIF set-up
Hi, I've been beating my had against this for several weeks now. (started with fedora 6, tried adding in the plugings etc (version 1.0.12) -- also tried upgrading to the current 1.0.14 version, without success (couldn't produce surround-sound on teh spdif output). I have now switched to fedorea 7 and was able to have rythmbox play surround sound via spdif, but have since lost that ability. (but I'm convinced the hardware and low-level drivers support it). In order to limit the number of moving parts, I have reduced to just trying to get speaker-test to play on all 6 speakers.
from pirut & I have alsa-lib 1.0.14-0.4.rc3.fc7.ppc(64) and alsa-utils 1.0.14-0.7.rc2.fc7.ppc
The default install has no asound.conf file. (attempts to create a "better" one didn't improve the situation).
I do not see a file matching the ps3 device in etc/alsa/cards nor etc/alsa/pcm, but I have not found any documentation on adding entries to the above directories.
[root@ps3 pcm0p]# cat /proc/asound/card0/pcm0p/info card: 0 device: 0 subdevice: 0 stream: PLAYBACK id: SPDIF name: SPDIF subname: subdevice #0 class: 0 subclass: 0 subdevices_count: 1 subdevices_avail: 1
[root@ps3 ~]# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: PS3 [PS3], device 0: SPDIF [SPDIF] Subdevices: 1/1 Subdevice #0: subdevice #0 [root@ps3 ~]# aplay -L null Discard all samples (playback) or generate zero samples (capture) [root@ps3 ~]# amixer [root@ps3 ~]# amixer scontrols [root@ps3 ~]# speaker-test -c 6
speaker-test 1.0.14rc2
Playback device is default Stream parameters are 48000Hz, S16_BE, 6 channels Using 16 octaves of pink noise Rate set to 48000Hz (requested 48000Hz) Buffer size range from 4096 to 8192 Period size range from 256 to 256 Using max buffer size 8192 Periods = 4 was set period_size = 256 was set buffer_size = 8192 0 - Front Left 4 - Center 1 - Front Right 3 - Rear Right 2 - Rear Left 5 - LFE Time per period = 17.821324
* above test only produces sound on channels 0 & 1.
xmms produces no sound and emits the following: ** WARNING **: alsa_setup_mixer(): Failed to find mixer element: PCM
Is it possible to get some help/pointers in the right direction? thanks GT* *
On 7/2/07, gt bradley gt.bradley@gmail.com wrote:
Hi, I've been beating my had against this for several weeks now. (started with fedora 6, tried adding in the plugings etc (version 1.0.12) -- also tried upgrading to the current 1.0.14 version, without success (couldn't produce surround-sound on teh spdif output). I have now switched to fedorea 7 and was able to have rythmbox play surround sound via spdif, but have since lost that ability. (but I'm convinced the hardware and low-level drivers support it). In order to limit the number of moving parts, I have reduced to just trying to get speaker-test to play on all 6 speakers.
SPDIF only supports 2 channels unless the stream is AC3 encoded.
Lee
At Mon, 02 Jul 2007 19:17:35 -0700, gt bradley wrote:
Hi, I've been beating my had against this for several weeks now. (started with fedora 6, tried adding in the plugings etc (version 1.0.12) -- also tried upgrading to the current 1.0.14 version, without success (couldn't produce surround-sound on teh spdif output). I have now switched to fedorea 7 and was able to have rythmbox play surround sound via spdif, but have since lost that ability. (but I'm convinced the hardware and low-level drivers support it). In order to limit the number of moving parts, I have reduced to just trying to get speaker-test to play on all 6 speakers.
SPDIF is basically only for a two-channel PCM stream. For 5.1 outputs, you'll have to encode the raw multi-channel PCM to some compressed format such as AC3 or DTS and embed in SPDIF frames. And, that's not the driver job, so far -- at least the current driver doesn't do any conversion. Thus a software has to do it.
You can try a52 plugin for the on-the-fly encoding, found in alsa-plugins package. The plugin seems working for some apps but for some not yet well, unfortunately...
Takashi
yes, I am aware that AC3 is required, I'm trying to get the AC3 pass-through configured. From your response, I understand now that speaker-test is performing as expected, however I have tired other things also: I have some AC3 encoded test files, and I have also tried installing ffmpeg, and liba52. and the ac3dec utility which I understand should pass through the AC3/DTS encoded files, but I recieve:
[root@ps3 Surround-SDL-testfiles]# ac3dec -C dolby-canyon.ogg Using PCM device 'plug:iec958:{AES0 0x2 AES1 0x82 AES2 0x0 AES3 0x2}' ALSA lib conf.c:3939:(snd_config_expand) Unknown parameters {AES0 0x2 AES1 0x82 AES2 0x0 AES3 0x2} ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM iec958:{AES0 0x2 AES1 0x82 AES2 0x0 AES3 0x2} snd_pcm_open: Invalid argument Output open failed
However if I am planning to write ac3 to the linux driver, are you saying that I would be better to write directly to the driver rather than through the ALSA layer?
thanks GT
Takashi Iwai wrote:
At Mon, 02 Jul 2007 19:17:35 -0700, gt bradley wrote:
Hi, I've been beating my had against this for several weeks now. (started with fedora 6, tried adding in the plugings etc (version 1.0.12) -- also tried upgrading to the current 1.0.14 version, without success (couldn't produce surround-sound on teh spdif output). I have now switched to fedorea 7 and was able to have rythmbox play surround sound via spdif, but have since lost that ability. (but I'm convinced the hardware and low-level drivers support it). In order to limit the number of moving parts, I have reduced to just trying to get speaker-test to play on all 6 speakers.
SPDIF is basically only for a two-channel PCM stream. For 5.1 outputs, you'll have to encode the raw multi-channel PCM to some compressed format such as AC3 or DTS and embed in SPDIF frames. And, that's not the driver job, so far -- at least the current driver doesn't do any conversion. Thus a software has to do it.
You can try a52 plugin for the on-the-fly encoding, found in alsa-plugins package. The plugin seems working for some apps but for some not yet well, unfortunately...
Takashi
At Tue, 03 Jul 2007 11:50:34 -0700, GT Bradley wrote:
yes, I am aware that AC3 is required, I'm trying to get the AC3 pass-through configured. From your response, I understand now that speaker-test is performing as expected, however I have tired other things also: I have some AC3 encoded test files, and I have also tried installing ffmpeg, and liba52. and the ac3dec utility which I understand should pass through the AC3/DTS encoded files, but I recieve:
[root@ps3 Surround-SDL-testfiles]# ac3dec -C dolby-canyon.ogg Using PCM device 'plug:iec958:{AES0 0x2 AES1 0x82 AES2 0x0 AES3 0x2}' ALSA lib conf.c:3939:(snd_config_expand) Unknown parameters {AES0 0x2 AES1 0x82 AES2 0x0 AES3 0x2} ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM iec958:{AES0 0x2 AES1 0x82 AES2 0x0 AES3 0x2} snd_pcm_open: Invalid argument Output open failed
However if I am planning to write ac3 to the linux driver, are you saying that I would be better to write directly to the driver rather than through the ALSA layer?
You need set up the configuration for alsa-lib. Otherwise the iec958 PCM isn't defined. Usually the card-specific configuration is stored in /usr/share/alsa/cards/*.conf.
Takashi
right, For my Fedora install, these files are at /etc/alsa/cards, (although the iec958.conf) is in /etc/alsa/pcm).
The iec958.conf seems resonable, although I don't fully understand the syntax of the file, nor understand how the asoundrc file wires to /etc/alsa/... to the actual linux driver. It seems to pass through to the default device (which is what I want)
using the system-config-soundcard utility, I do get surround sound, and is displays the card as PS3 whcih matches the output of aplay -l I've tryed createing a /etc/alsa/cards/PS3.conf file as follows:
I've added the following to my /etc/asound.conf:
pcm.myspdif { type iec958 slave { pcm { type hw card 0 device 0 # whatever you like } format IEC958_SUBFRAME_BE } # the below should be corrected with 44.1kHz rates status [ 0x04 0x92 0x10 0x02 ] }
I've created a PS3.conf file as follows:
[root@ps3 Surround-SDL-testfiles]# ac3dec -Dmyspdif -C dolby-canyon.ogg Using PCM device 'myspdif' Broken configuration for this PCM: no configurations availableOutput open failed
trying to create a SPDIF device has yeilded [root@ps3 Surround-SDL-testfiles]# ac3dec -Dmyspdif -C dolby-canyon.ogg Using PCM device 'myspdif' snd_pcm_open: No such file or directory Output open failed
(by an y of the following:) pcm_slave.SPDIF { pcm iec958 }
pcm_slave.SPDIF { type hw card 0 device 0 }
pcm_type.SPDIF { redirect { name iec958 } }
the sytem-config-soundcard util is still able to play the test tones via AT3 over spdif. the default device is as shown below...
GT
Takashi Iwai wrote:
At Tue, 03 Jul 2007 11:50:34 -0700, GT Bradley wrote:
yes, I am aware that AC3 is required, I'm trying to get the AC3 pass-through configured. From your response, I understand now that speaker-test is performing as expected, however I have tired other things also: I have some AC3 encoded test files, and I have also tried installing ffmpeg, and liba52. and the ac3dec utility which I understand should pass through the AC3/DTS encoded files, but I recieve:
[root@ps3 Surround-SDL-testfiles]# ac3dec -C dolby-canyon.ogg Using PCM device 'plug:iec958:{AES0 0x2 AES1 0x82 AES2 0x0 AES3 0x2}' ALSA lib conf.c:3939:(snd_config_expand) Unknown parameters {AES0 0x2 AES1 0x82 AES2 0x0 AES3 0x2} ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM iec958:{AES0 0x2 AES1 0x82 AES2 0x0 AES3 0x2} snd_pcm_open: Invalid argument Output open failed
However if I am planning to write ac3 to the linux driver, are you saying that I would be better to write directly to the driver rather than through the ALSA layer?
You need set up the configuration for alsa-lib. Otherwise the iec958 PCM isn't defined. Usually the card-specific configuration is stored in /usr/share/alsa/cards/*.conf.
Takashi
At Wed, 04 Jul 2007 18:23:09 -0700, GT Bradley wrote:
right, For my Fedora install, these files are at /etc/alsa/cards, (although the iec958.conf) is in /etc/alsa/pcm).
The iec958.conf seems resonable, although I don't fully understand the syntax of the file, nor understand how the asoundrc file wires to /etc/alsa/... to the actual linux driver. It seems to pass through to the default device (which is what I want)
using the system-config-soundcard utility, I do get surround sound, and is displays the card as PS3 whcih matches the output of aplay -l I've tryed createing a /etc/alsa/cards/PS3.conf file as follows:
It seems that the current PS3 driver doesn't support the passthru properly yet. For AC3, you'd have to set up the IEC958 status bits, but the driver doesn't support it. Some receivers are robust that work even without non-audio bit, but many receivers require the proper status bits. I'll contact with SCE guys for fixing this issue.
Takashi
I'm running Fedora 7 on a PS3 (2.6.22 kernel, 1.0.14rc2 alsa).
I'm trying to create a multi-channel device by following the instructions at: http://www.alsa-project.org/alsa-doc/doc-php/asoundrc.php
On the section on "virtual multi channel devices"
I also tried changing the slave b hardware number to 7 to match my set-up. ( and tried putting 7 -> 0 and 1->0 to make the snd_ps3 the "second" device w/o record).
attempting to run the test command yeilds: [root@ps3 Surround-SDL-testfiles]# arecord -f S16_LE -r 44100 -c 4 -D multi | aplay -f S16_LE -r 44100 -c 4 -D multi arecord: main:545: audio open error: No such file or directory aplay: playback:2018: read error
to remove the record part of things, I've also tried : [root@ps3 Surround-SDL-testfiles]# aplay -f S16_LE -r 44100 -c 4 -D multi dolby-canyon.ogg Playing raw data 'dolby-canyon.ogg' : Signed 16 bit Little Endian, Rate 44100 Hz, Channels 4 aplay: set_params:878: Broken configuration for this PCM: no configurations available
(I also tried Big-endian).
Looking at http://bugtrack.alsa-project.org/main/index.php/Matrix:Module-usb-audio
the relevent part of my kernel config file is below: and the output of lsmod. I notice that soundcore.o is in my build tree, but I'm unable to find a soundcore.ko file. I'm assuming that this is being statically linked into the kernel. (I can find .soundcore_open in the System.map file for my kernel). this looks reasonable to me.
From my various tries at this I believe I have a configuration issue, and would appriciate some pointers in the right direction.
thanks GT
***********Config info: ****************** I'm able to run speaker-test -c 2 and get sound out of L&R for each of the two cards.
the output of aplay -l is [root@ps3 Surround-SDL-testfiles]# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: PS3 [PS3], device 0: SPDIF [SPDIF] Subdevices: 1/1 Subdevice #0: subdevice #0 card 7: MP3 [Sound Blaster MP3+], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0
The out-put of aplay -l is as follows: [root@ps3 Surround-SDL-testfiles]# aplay -L null Discard all samples (playback) or generate zero samples (capture) default:CARD=MP3 Sound Blaster MP3+, USB Audio Default Audio Device front:CARD=MP3,DEV=0 Sound Blaster MP3+, USB Audio Front speakers surround40:CARD=MP3,DEV=0 Sound Blaster MP3+, USB Audio 4.0 Surround output to Front and Rear speakers surround41:CARD=MP3,DEV=0 Sound Blaster MP3+, USB Audio 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=MP3,DEV=0 Sound Blaster MP3+, USB Audio 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=MP3,DEV=0 Sound Blaster MP3+, USB Audio 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=MP3,DEV=0 Sound Blaster MP3+, USB Audio 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers iec958:CARD=MP3,DEV=0 Sound Blaster MP3+, USB Audio IEC958 (S/PDIF) Digital Audio Output
_From http://bugtrack.alsa-project.org/main/index.php/Matrix:Vendor-Creative_Labs I see that only analog output is supported
.configure file:
# # Sound # CONFIG_SOUND=y
# # Advanced Linux Sound Architecture # CONFIG_SND=m CONFIG_SND_TIMER=m CONFIG_SND_PCM=m CONFIG_SND_HWDEP=m CONFIG_SND_RAWMIDI=m CONFIG_SND_SEQUENCER=m # CONFIG_SND_SEQ_DUMMY is not set # CONFIG_SND_MIXER_OSS is not set # CONFIG_SND_PCM_OSS is not set # CONFIG_SND_SEQUENCER_OSS is not set # CONFIG_SND_DYNAMIC_MINORS is not set CONFIG_SND_SUPPORT_OLD_API=y CONFIG_SND_VERBOSE_PROCFS=y # CONFIG_SND_VERBOSE_PRINTK is not set # CONFIG_SND_DEBUG is not set
# # Generic devices # # CONFIG_SND_DUMMY is not set # CONFIG_SND_VIRMIDI is not set # CONFIG_SND_MTPAV is not set # CONFIG_SND_SERIAL_U16550 is not set # CONFIG_SND_MPU401 is not set
# # ALSA PowerMac devices #
# # ALSA PowerMac requires I2C #
# # ALSA PowerPC devices
***** loaded modules **** [root@ps3 usb]# lsmod Module Size Used by hidp 27896 0 rfcomm 59208 0 l2cap 34312 6 hidp,rfcomm snd_usb_audio 114200 0 snd_usb_lib 25544 1 snd_usb_audio snd_rawmidi 34408 1 snd_usb_lib snd_ps3 19128 0 hci_usb 23172 2 bluetooth 81524 8 hidp,rfcomm,l2cap,hci_usb usb_storage 54236 0 snd_seq_device 11692 1 snd_rawmidi snd_hwdep 14368 1 snd_usb_audio snd_pcm 123132 2 snd_usb_audio,snd_ps3 usbhid 28828 0 snd_page_alloc 10816 1 snd_pcm sys_manager 7052 0 [permanent] snd_timer 33872 1 snd_pcm snd 77328 7 snd_usb_audio,snd_rawmidi,snd_ps3,snd_seq_device,snd_hwdep,snd_pcm,snd_timer sg 46816 0 ext2 75584 5
participants (4)
-
gt bradley
-
GT Bradley
-
Lee Revell
-
Takashi Iwai