All of lore.kernel.org
 help / color / mirror / Atom feed
* Terratec Aureon Space 7.1 and digital out
@ 2003-08-28 21:44 Dennis van der Meer
  2003-08-29  0:48 ` Sync between MIDI and audio Steve deRosier
  0 siblings, 1 reply; 4+ messages in thread
From: Dennis van der Meer @ 2003-08-28 21:44 UTC (permalink / raw)
  To: alsa-devel

Hi everyone,

For quite a long time now I have been trying to get my digital out on my
Terratec Aureon Space 7.1 to work. The analog out is working but since
I only use the digital out it isn't sufficient for me.

Because I was hoping to get an answer as to how to enable the digital
out I posted several emails to the alsa-user mailinglist.
Although the answers I got helped me to better understand how Alsa
works I still haven't received the answer I was hoping for: what should
I do/enable to get sound through the digital out?
Since the information I might need is a little more technical than just a
"run this tool" or "copy this file" I figured that I might get a better answer
when I post my question on this mailinglist.

I tried playing with the mixer to increase the volume and fiddled with some
other controls but no luck there.
I have also tried iecdump and iecset but these tools also didn't provide me
with the necessary results.
The problem will probably have nothing to do with the drivers but it looks
like I have to flip a few bits in order to activate the digital out.
Could someone please provide me with the correct bitmask that I need for
enabling the interface?

I have included some further info below that might be helpful.
It seems that control.18, control.19 and control.20 are the most interesting
controls. But I don't know what bitmask I should use to enable the digital
out and I'm a little afraid to just start playing with the controls. I 
don't want
to break anything by writing invalid values to it.
Control.16 also seems important but since it's on by default I don't think
that I have to worry about that one.


./iecdump -Dhw:1

Mode:           consumer
Data:           audio
Rate:           44100 Hz
Copyright:      protected
Emphasis:       none
Category:       general
Original:       1st generation
Clock:          1000 ppm

./iecdump -Dhw:1 -x

AES0=0x04,AES1=0x80,AES2=0x00,AES3=0x00


/etc/asound.state

state.T71Space {
         control.1 {
                 comment.access read
                 comment.type BYTES
                 iface CARD
                 name 'ICE1724 EEPROM'
                 value 
'1145153b13021380f8c2ffffbf0000000000000000000000000000000000000000000000000000000000000000000000ffffbf00'
         }
         control.2 {
                 comment.access 'read write'
                 comment.type ENUMERATED
                 comment.item.0 '8000'
                 comment.item.1 '9600'
                 comment.item.2 '11025'
                 comment.item.3 '12000'
                 comment.item.4 '16000'
                 comment.item.5 '22050'
                 comment.item.6 '24000'
                 comment.item.7 '32000'
                 comment.item.8 '44100'
                 comment.item.9 '48000'
                 comment.item.10 '64000'
                 comment.item.11 '88200'
                 comment.item.12 '96000'
                 comment.item.13 '176400'
                 comment.item.14 '192000'
                 comment.item.15 'IEC958 Input'
                 iface MIXER
                 name 'Multi Track Internal Clock'
                 value '32000'
         }
         control.3 {
                 comment.access 'read write'
                 comment.type BOOLEAN
                 iface MIXER
                 name 'Multi Track Rate Locking'
                 value false
         }
         control.4 {
                 comment.access 'read write'
                 comment.type BOOLEAN
                 iface MIXER
                 name 'Multi Track Rate Reset'
                 value true
         }
         control.5 {
                 comment.access 'read write'
                 comment.type ENUMERATED
                 comment.item.0 'PCM Out'
                 comment.item.1 'H/W In 0'
                 comment.item.2 'H/W In 1'
                 comment.item.3 'IEC958 In L'
                 comment.item.4 'IEC958 In R'
                 iface MIXER
                 name 'H/W Playback Route'
                 value 'PCM Out'
         }
         control.6 {
                 comment.access 'read write'
                 comment.type ENUMERATED
                 comment.item.0 'PCM Out'
                 comment.item.1 'H/W In 0'
                 comment.item.2 'H/W In 1'
                 comment.item.3 'IEC958 In L'
                 comment.item.4 'IEC958 In R'
                 iface MIXER
                 name 'H/W Playback Route'
                 index 1
                 value 'PCM Out'
         }
         control.7 {
                 comment.access 'read write'
                 comment.type ENUMERATED
                 comment.item.0 'PCM Out'
                 comment.item.1 'H/W In 0'
                 comment.item.2 'H/W In 1'
                 comment.item.3 'IEC958 In L'
                 comment.item.4 'IEC958 In R'
                 iface MIXER
                 name 'H/W Playback Route'
                 index 2
                 value 'PCM Out'
         }
         control.8 {
                 comment.access 'read write'
                 comment.type ENUMERATED
                 comment.item.0 'PCM Out'
                 comment.item.1 'H/W In 0'
                 comment.item.2 'H/W In 1'
                 comment.item.3 'IEC958 In L'
                 comment.item.4 'IEC958 In R'
                 iface MIXER
                 name 'H/W Playback Route'
                 index 3
                 value 'PCM Out'
         }
         control.9 {
                 comment.access 'read write'
                 comment.type ENUMERATED
                 comment.item.0 'PCM Out'
                 comment.item.1 'H/W In 0'
                 comment.item.2 'H/W In 1'
                 comment.item.3 'IEC958 In L'
                 comment.item.4 'IEC958 In R'
                 iface MIXER
                 name 'H/W Playback Route'
                 index 4
                 value 'PCM Out'
         }
         control.10 {
                 comment.access 'read write'
                 comment.type ENUMERATED
                 comment.item.0 'PCM Out'
                 comment.item.1 'H/W In 0'
                 comment.item.2 'H/W In 1'
                 comment.item.3 'IEC958 In L'
                 comment.item.4 'IEC958 In R'
                 iface MIXER
                 name 'H/W Playback Route'
                 index 5
                 value 'PCM Out'
         }
         control.11 {
                 comment.access 'read write'
                 comment.type ENUMERATED
                 comment.item.0 'PCM Out'
                 comment.item.1 'H/W In 0'
                 comment.item.2 'H/W In 1'
                 comment.item.3 'IEC958 In L'
                 comment.item.4 'IEC958 In R'
                 iface MIXER
                 name 'H/W Playback Route'
                 index 6
                 value 'PCM Out'
         }
         control.12 {
                 comment.access 'read write'
                 comment.type ENUMERATED
                 comment.item.0 'PCM Out'
                 comment.item.1 'H/W In 0'
                 comment.item.2 'H/W In 1'
                 comment.item.3 'IEC958 In L'
                 comment.item.4 'IEC958 In R'
                 iface MIXER
                 name 'H/W Playback Route'
                 index 7
                 value 'PCM Out'
         }
         control.13 {
                 comment.access read
                 comment.type INTEGER
                 comment.range '0 - 255'
                 iface MIXER
                 name 'Multi Track Peak'
                 value.0 0
                 value.1 0
                 value.2 0
                 value.3 0
                 value.4 0
                 value.5 0
                 value.6 0
                 value.7 0
                 value.8 0
                 value.9 0
                 value.10 0
                 value.11 0
                 value.12 0
                 value.13 0
                 value.14 0
                 value.15 0
                 value.16 0
                 value.17 0
                 value.18 0
                 value.19 0
                 value.20 0
                 value.21 0
         }
         control.14 {
                 comment.access 'read write'
                 comment.type ENUMERATED
                 comment.item.0 'PCM Out'
                 comment.item.1 'H/W In 0'
                 comment.item.2 'H/W In 1'
                 comment.item.3 'IEC958 In L'
                 comment.item.4 'IEC958 In R'
                 iface MIXER
                 name 'IEC958 Playback Route'
                 value 'PCM Out'
         }
         control.15 {
                 comment.access 'read write'
                 comment.type ENUMERATED
                 comment.item.0 'PCM Out'
                 comment.item.1 'H/W In 0'
                 comment.item.2 'H/W In 1'
                 comment.item.3 'IEC958 In L'
                 comment.item.4 'IEC958 In R'
                 iface MIXER
                 name 'IEC958 Playback Route'
                 index 1
                 value 'PCM Out'
         }
         control.16 {
                 comment.access 'read write'
                 comment.type BOOLEAN
                 iface MIXER
                 name 'IEC958 Output Switch'
                 value true
         }
         control.17 {
                 comment.access 'read write'
                 comment.type IEC958
                 iface PCM
                 device 1
                 name 'IEC958 Playback Default'
                 value 
'0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
         }
         control.18 {
                 comment.access read
                 comment.type IEC958
                 iface MIXER
                 device 1
                 name 'IEC958 Playback Con Mask'
                 value 
'3fff000f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
         }
         control.19 {
                 comment.access read
                 comment.type IEC958
                 iface MIXER
                 device 1
                 name 'IEC958 Playback Pro Mask'
                 value 
df00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
         }
         control.20 {
                 comment.access 'read write'
                 comment.type INTEGER
                 comment.range '0 - 101'
                 iface MIXER
                 name 'DAC Volume'
                 value 88
         }
         control.21 {
                 comment.access 'read write'
                 comment.type INTEGER
                 comment.range '0 - 101'
                 iface MIXER
                 name 'DAC Volume'
                 index 1
                 value 88
         }
         control.22 {
                 comment.access 'read write'
                 comment.type INTEGER
                 comment.range '0 - 101'
                 iface MIXER
                 name 'DAC Volume'
                 index 2
                 value 88
         }
         control.23 {
                 comment.access 'read write'
                 comment.type INTEGER
                 comment.range '0 - 101'
                 iface MIXER
                 name 'DAC Volume'
                 index 3
                 value 88
         }
         control.24 {
                 comment.access 'read write'
                 comment.type INTEGER
                 comment.range '0 - 101'
                 iface MIXER
                 name 'DAC Volume'
                 index 4
                 value 92
         }
         control.25 {
                 comment.access 'read write'
                 comment.type INTEGER
                 comment.range '0 - 101'
                 iface MIXER
                 name 'DAC Volume'
                 index 5
                 value 90
         }
         control.26 {
                 comment.access 'read write'
                 comment.type INTEGER
                 comment.range '0 - 101'
                 iface MIXER
                 name 'DAC Volume'
                 index 6
                 value 92
         }
         control.27 {
                 comment.access 'read write'
                 comment.type INTEGER
                 comment.range '0 - 101'
                 iface MIXER
                 name 'DAC Volume'
                 index 7
                 value 90
         }
         control.28 {
                 comment.access 'read write'
                 comment.type INTEGER
                 comment.range '0 - 101'
                 iface MIXER
                 name 'Master Playback Volume'
                 value 90
         }
         control.29 {
                 comment.access 'read write'
                 comment.type INTEGER
                 comment.range '0 - 31'
                 iface MIXER
                 name 'ADC Volume'
                 value 27
         }
         control.30 {
                 comment.access 'read write'
                 comment.type INTEGER
                 comment.range '0 - 31'
                 iface MIXER
                 name 'ADC Volume'
                 index 1
                 value 27
         }
         control.31 {
                 comment.access 'read write'
                 comment.type ENUMERATED
                 comment.item.0 'CD Left'
                 comment.item.1 'CD Right'
                 comment.item.2 'Aux Left'
                 comment.item.3 'Aux Right'
                 comment.item.4 'Line Left'
                 comment.item.5 'Line Right'
                 comment.item.6 'Mic Left'
                 comment.item.7 'Mic Right'
                 iface MIXER
                 name 'Capture Route'
                 value.0 'CD Left'
                 value.1 'CD Left'
         }
}


Kind regards,

Dennis van der Meer



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Sync between MIDI and audio
  2003-08-28 21:44 Terratec Aureon Space 7.1 and digital out Dennis van der Meer
@ 2003-08-29  0:48 ` Steve deRosier
  2003-08-29  1:27   ` Paul Davis
  0 siblings, 1 reply; 4+ messages in thread
From: Steve deRosier @ 2003-08-29  0:48 UTC (permalink / raw)
  To: alsa-devel

I'm writting an app that plays a special format and uses both the Alsa 
seq and pcm interfaces to output MIDI and audio data together.  I'm 
almost done, but I've got one problem that is plaugeing me: I can't get 
the two to stay in sync.

Basically, what I'm doing is using writei() to send frames to the audio 
and for midi:
void SendTimeEvent( snd_seq_event_t *event, snd_seq_real_time_t *iRealTime)
{
   snd_seq_ev_set_source( event, mPort );
   snd_seq_ev_set_subs(event);
   snd_seq_ev_schedule_real(event, mQueue, 0, iRealTime );
   snd_seq_event_output(hSeq, event);
   snd_seq_drain_output(hSeq);
}

I call this with iRealTime calculated based on the number of frames I've 
sent to the audio.  I recieve the MIDI data and the audio samples in 
sync from a different portion of the program, and the time that the MIDI 
should be played at is the time that sample gets played plus a constant 
offset.

Both the MIDI and audio play just fine (the piano plays and so does the 
digital audio).

The problem: the MIDI and audio start synced up, but after a while they 
start to drift further and further apart.  I've checked my stuff 
exaustively to make sure that it's not the fault of my program, so I'm 
figuring it is caused by me not setting up something properly in alsa to 
make the two streams synced up.

Any ideas of where to look?

Thanks in advance,
- Steve



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Sync between MIDI and audio
  2003-08-29  0:48 ` Sync between MIDI and audio Steve deRosier
@ 2003-08-29  1:27   ` Paul Davis
  2003-09-02 16:39     ` Steve deRosier
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Davis @ 2003-08-29  1:27 UTC (permalink / raw)
  To: derosier; +Cc: alsa-devel

>The problem: the MIDI and audio start synced up, but after a while they 
>start to drift further and further apart.  I've checked my stuff 
>exaustively to make sure that it's not the fault of my program, so I'm 
>figuring it is caused by me not setting up something properly in alsa to 
>make the two streams synced up.

you either have to force the sequencer queue to use the PCM device as
a clock, or you have to use the RTC as the clock for both (which will
cause audio glitches every so often since it drifts w.r.t. the audio
clock). you can't expect this to "just work" - you've created a system
with two clocks (the sequencer queue and the PCM device), and such
systems will never stay in sync.

this is a very tricky area of linux audio/MIDI programming, and my
personal advice would be to use kernel 2.5/2.6 or the backport of the
hi-res timers code. you can then get usec-accurate scheduling of
events (in SCHED_FIFO tasks, anyway) and forget the ALSA
queue. hopefully, the ALSA sequencer will at some point take advantage
of the new timers. even so, its still not a simple thing to do.

--p


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Sync between MIDI and audio
  2003-08-29  1:27   ` Paul Davis
@ 2003-09-02 16:39     ` Steve deRosier
  0 siblings, 0 replies; 4+ messages in thread
From: Steve deRosier @ 2003-09-02 16:39 UTC (permalink / raw)
  To: Paul Davis; +Cc: alsa-devel

Paul,

Ah, well that explains it.  Thanks.  Can you point me to some info on 
how I would link the two clocks (I guess it would be to make the seq use 
the PCM clock)?

As far as using kernel 2.5/2.6 or the backport of the hi-res timers 
code... unfortunately this isn't an option for me.  I can't change the 
kernel version and even if I could, the rest of the people wouldn't 
allow it at this point.  But, even if I used the hi-res stuff, wouldn't 
I still have the same problem with having 2 clocks and those drifting 
apart over time?

Thanks,
- Steve

Paul Davis wrote:
>>The problem: the MIDI and audio start synced up, but after a while they 
>>start to drift further and further apart.  I've checked my stuff 
>>exaustively to make sure that it's not the fault of my program, so I'm 
>>figuring it is caused by me not setting up something properly in alsa to 
>>make the two streams synced up.
> 
> 
> you either have to force the sequencer queue to use the PCM device as
> a clock, or you have to use the RTC as the clock for both (which will
> cause audio glitches every so often since it drifts w.r.t. the audio
> clock). you can't expect this to "just work" - you've created a system
> with two clocks (the sequencer queue and the PCM device), and such
> systems will never stay in sync.
> 
> this is a very tricky area of linux audio/MIDI programming, and my
> personal advice would be to use kernel 2.5/2.6 or the backport of the
> hi-res timers code. you can then get usec-accurate scheduling of
> events (in SCHED_FIFO tasks, anyway) and forget the ALSA
> queue. hopefully, the ALSA sequencer will at some point take advantage
> of the new timers. even so, its still not a simple thing to do.
> 
> --p
> 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-02 16:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-28 21:44 Terratec Aureon Space 7.1 and digital out Dennis van der Meer
2003-08-29  0:48 ` Sync between MIDI and audio Steve deRosier
2003-08-29  1:27   ` Paul Davis
2003-09-02 16:39     ` Steve deRosier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.