RE: [Alsa-devel] Pops at start of song

2003-11-24 Thread Mark Knecht

 Ok, it's a thing that we would like to eliminate, but when I tried to
 figure what's going on in the past, I wasn't successful. The best
 thing to
 measure if ALSA sends a wrong sample sequence to the output is to use the
 digital I/O (S/PDIF or profi IEC958) for on playback side and capture the
 whole stream on the other side.


Jaroslav,
   I tried a number of times over the weekend to accomplish this, but it
turns out it's somewhat harder than I expected. Please tell me if any of
this is of interest. Again, the HDSP 9652 is the master clock. All the other
devices receive their clocks via their ADAT connections.

MasterSlaves via ADAT

s/pdif  Pro Tools (no clock)
ADAT-1  Pro Tools (clock)
ADAT-2  Alesis AI-3
ADAT-3  GigaStudio

Also, I set up audio connections from the AI-3 to Pro Tools to record the
pop/glitch noise:

AI-3 --- Pro Tools audio input

At this point I tried a number of things:

1) With the Pro Tools PC synced to the HDSP 9652 via ADAT I can start
recording. However, anytime the problem occurs and the HDSP 9652 momentarily
changes it's clock frequency, the Pro Tools hardware complains and
immediately stops recording. This does not capture anything of interest.

2) I can run both the Pro Tools PC and the HDSP 9652 at 44.1KHz, but
unsynced. In this case I can capture digital audio of the problem, but since
the two are unsynced I also get normal clicks and pops that are expected
when you do this. If you think you can get information from this file I'll
send it to you. Possibly, if I sent you all 5 stereo files captured
digitally via ADAT and s/pdif you'd get more info since the problem occurs
on all 10 channels and both cables at the same time.

3) I can run both unsynced again, but I record the audio glitch using the
Pro Tools A/D's. This works fine, but it isn't pure digital information so I
expect that it's not of that much interest.

One thing I noted was that when Pro Tools and the HDSP 9652 run unsynced
there is far more digital noise on ADAT-2, channels 7  8 than on the other
6 channels. I can see no reason for this, but it happens.

   If you get a chance to respond today then I'll get you what I can
quickly. I'll be traveling after Tuesday evening California time so nothing
will come for about a week after that.

Thanks for trying to help!

Mark




---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


RE: [Alsa-devel] Pops at start of song

2003-11-24 Thread Jaroslav Kysela
On Mon, 24 Nov 2003, Mark Knecht wrote:

 
  Ok, it's a thing that we would like to eliminate, but when I tried to
  figure what's going on in the past, I wasn't successful. The best
  thing to
  measure if ALSA sends a wrong sample sequence to the output is to use the
  digital I/O (S/PDIF or profi IEC958) for on playback side and capture the
  whole stream on the other side.
 
 
 Jaroslav,
I tried a number of times over the weekend to accomplish this, but it
 turns out it's somewhat harder than I expected. Please tell me if any of
 this is of interest. Again, the HDSP 9652 is the master clock. All the other
 devices receive their clocks via their ADAT connections.
 
 MasterSlaves via ADAT
 
 s/pdif  Pro Tools (no clock)
 ADAT-1  Pro Tools (clock)
 ADAT-2  Alesis AI-3
 ADAT-3  GigaStudio
 
 Also, I set up audio connections from the AI-3 to Pro Tools to record the
 pop/glitch noise:
 
 AI-3 --- Pro Tools audio input
 
 At this point I tried a number of things:
 
 1) With the Pro Tools PC synced to the HDSP 9652 via ADAT I can start
 recording. However, anytime the problem occurs and the HDSP 9652 momentarily
 changes it's clock frequency, the Pro Tools hardware complains and
 immediately stops recording. This does not capture anything of interest.

Ok, can you force the master rate for HDSP? Then you can simply send some
short (a few seconds) .wav file (or other file) with same rate to selected
channels (maybe via aplay if you have a good configuration in
~/.asoundrc). Then you can compare (maybe via some editor) if the whole
.wav file is in the recorded stream (plus some zero samples at begging and
end of this stream). Or, you can send me your source and recorded files
and I'll compare them for you (only mark which file is master).

Jaroslav

-
Jaroslav Kysela [EMAIL PROTECTED]
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


RE: [Alsa-devel] Pops at start of song

2003-11-24 Thread Mark Knecht

 Ok, can you force the master rate for HDSP?

Yes, I can force the HDSP master rate to be 44.1KHz.

I can then force the Pro Tools PC be a master also, at 44.1K, but there will
be random clicks and pops since the two are not synced to each other. If I
do this and record on the Pro Tools PC, I get all zeros with a random click
here and there. This is the only way I can record using Pro Tools as the
problem with the HDSP happens and shuts down Pro Tools since it doesn't like
the clock changing. (I.e. - the Pro Tools session is 44.1K, and the clock
changes to 48K, so it gets upset and stops recording.)

 Then you can simply send some
 short (a few seconds) .wav file (or other file) with same rate to selected
 channels (maybe via aplay if you have a good configuration in
 ~/.asoundrc).

There is no problem when using aplay, or at least using alsaplayer there
isn't. I've never had these problems with any Alsa application. Only with
apps that seem to use the OSS emulator, I think. I will try to get the noise
recorded when using xmms. You should get zeros leading in, then this noise,
and then the audio.


 Then you can compare (maybe via some editor) if the whole
 .wav file is in the recorded stream (plus some zero samples at begging and
 end of this stream). Or, you can send me your source and recorded files
 and I'll compare them for you (only mark which file is master).

   Jaroslav

I've just set up an apache server at home, so later today I'll put the audio
files there, and then give you an IP address where you can pick them up.
What time zone are you in by the way?

Thanks very much,
Mark





---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


RE: [Alsa-devel] Pops at start of song

2003-11-24 Thread Mark Knecht
  Then you can compare (maybe via some editor) if the whole
  .wav file is in the recorded stream (plus some zero samples at
 begging and
  end of this stream). Or, you can send me your source and recorded files
  and I'll compare them for you (only mark which file is master).
 
  Jaroslav

 I've just set up an apache server at home, so later today I'll
 put the audio
 files there, and then give you an IP address where you can pick them up.
 What time zone are you in by the way?

 Thanks very much,
 Mark

Hi,
   Couldn't get the web server to serve the files, so I've sent them zipped
by email.
Cheers,
Mark




---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


RE: [Alsa-devel] Pops at start of song

2003-11-24 Thread Mark Knecht
Thomas  Jaroslav,
   Here's a graphical representation of the noise problem I'm having
using the HDSP 9652. The attached png file shows the wave file I'm
playing on the top line, and then two separate outputs from the HDSP
9652. The two separate Pro Tools captures were done at the same time and
are definitely in sync. I have adjusted the wave file input to be in
line with where it probably was when I played the file.

   The next line shows what's captured by Pro Tools over the ADAT-2
cable. It appears the first .1 Sec is not transferred by the HDSP 9652.

   The final group shows what is captured by Pro Tools on an audio input
that is the same as my main speaker output. Levels are reduced a bit
since I have hdspmixer cutting the level a bit, but you can clearly see
the noise at the beginning, which is very loud, and then the same delay
before the actual audio starts playing. This last group is ADAT-1 out
going to the AI-3 and then into a Pro Tools input.

   I hope this helps explain the problem.

Cheers,
Mark




HDSPnoise.xpm.gz
Description: GNU Zip compressed data


RE: [Alsa-devel] Pops at start of song

2003-11-20 Thread Jaroslav Kysela
On Wed, 19 Nov 2003, Mark Knecht wrote:

 Steve,
You're the first person I can remember to report something very similar
 to what I'm dealing with every day. I get a huge loud cracking noise at the
 start of any audio operation that is not vanilla Alsa - i.e. - anything
 accessing OSS I think. In my case I think it's hardware based, but I'm not
 sure. This happens only on my HDSP 9652 system. I have two other systems,
 one using an onboard NForce audio device, and the other using an RME
 Hammerfall Light, that act correctly.
 
With the RME products we have the hdspconf application which shows the
 sync frequency of the card. I normally run at 44.1K, but if I open hdspconf
 and watch the card's frequency, it tells me that the card becomes unlocked
 and changes sample rates when the noise happens. This happens when starting
 any app that uses OSS (I think) like gxine, or xmms, or most games, or
 browsing web pages. It does not happen when starting a native Alsa
 application like alsaplayer.
 
Does this sound at all like what you're experiencing?

Ok, it's a thing that we would like to eliminate, but when I tried to 
figure what's going on in the past, I wasn't successful. The best thing to 
measure if ALSA sends a wrong sample sequence to the output is to use the 
digital I/O (S/PDIF or profi IEC958) for on playback side and capture the 
whole stream on the other side.

It seems to me, that some audio hardware (in the analog path) does not
have compensation for the big volume change at the start or stop of the
PCM stream. In this case, the application must do this compensation itself
to avoid the clicks. It's difficult to do the stream modification in the
driver.

Jaroslav

-
Jaroslav Kysela [EMAIL PROTECTED]
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


Re: [Alsa-devel] Pops at start of song

2003-11-20 Thread Jaroslav Kysela
On Wed, 19 Nov 2003, Steve deRosier wrote:

 Mark,
 
 I don't know if it's the same effect or not.  We're working on an 
 embedded Linux device.  It has a full Linux kernel and basically is a 
 hand-built distribution of stock Linux stuff, but is very stripped down 
 and some of our apps are custom.  As we're not using OSS in any way 
 (neither apps nor the Alsa OSS emulation layer) so I can't speak to that.
 
 One of our engrs here seems to think it's a hardware issue also, and the 
 only way to get our apps to deal with it is to on the stop command push 
 values into the pcm buffer that ramp down to 0 and then fill a full 
 buffer-size number of samples of 0 into the buffer before closeing it. 

I think that you can attenuate the volumes in a few ms to reduce the big
speaker (volume) move, but yes, doing the slow attenuation is the right 
thing when hardware doesn't have the click compensation itself.

Jaroslav

-
Jaroslav Kysela [EMAIL PROTECTED]
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


RE: [Alsa-devel] Pops at start of song

2003-11-20 Thread Mark Knecht
Jaroslav,
   I certainly want you to know that I have always sensed your commitment to
solving these problems and making Alsa better. I also understand that it's
terribly difficult for you to debug these things at a distance with a putz
like me who isn't a developer, and apparently the only person having this
problem.

   Please tell me how specifically what you want in the s/pdif recording.
Would you like me to record the HDSP s/pdif audio output on my Pro Tools box
and see if the noise is there? Easy to do and I'll do it this evening.

   Would having an account and root password on this system help you in any
way? If so, we can arrange that. This is how Thomas and I helped move the
HDSP 9652 driver forward. He programmed. I looked and listened.

   Please remember that this problem does not occur when I use Alsa
applications, which should help us focus in on the cause. It happens only
when using applications that are not specifically Alsa, so I guess that
means they are using OSS. I have tried things like plughw and other stuff in
my .asoundrc file but none of that has helped this problem. (Of course, I do
not understand the .asoundrc file language, so it's probably wrong anyway.)

   In thinking about this problem, I have come to wonder if the problem is
related to the type of A/D-D/A hardware that I have attached to ADAT2, and
which is part of my output signal chain. The Alesis AI-3 is a simple
8-in/8-out unit. It works very well, but it has one particular quirk, if you
will, in that it always wants to run at 48KHz unless it is given a sync
signal via its ADAT input at a different frequency. I run at 44.1K, and my
sense is that the AI-3 is jumping to 48K when this happens. That does not
mean that the HDSP 9652 is also jumping to 48K. Possibly the HDSP 9652 stops
sending a sync signal, or does something else strange.

   The same noise occurs when I simply change sample rates using hdspconf.
For this reason, I started thinking that it was a problem like Steve's since
I imagined that if all zeros were sent to the buffer while the rate was
being changed it might eliminate that problem.

   Or possibly this has to do with the specific way I have things hooked up?

HDSP 9652 is the clock Master
Clocks to slaves are over ADAT

ADAT-1 == Pro Tools/Win XP system
ADAT-2 == Alesis AI-3 --- Speakers  headphone amps
ADAT-3 == Hammerfall Light/WinME/GigaStudio/Reaktor-or-Linux soft
synths

   Maybe this is an ADAT-2 problem specifically and wouldn't happen if the
Alesis was on ADAT-1?

   Thanks for your help.

Mark


 Ok, it's a thing that we would like to eliminate, but when I tried to
 figure what's going on in the past, I wasn't successful. The best
 thing to
 measure if ALSA sends a wrong sample sequence to the output is to use the
 digital I/O (S/PDIF or profi IEC958) for on playback side and capture the
 whole stream on the other side.

 It seems to me, that some audio hardware (in the analog path) does not
 have compensation for the big volume change at the start or stop of the
 PCM stream. In this case, the application must do this compensation itself
 to avoid the clicks. It's difficult to do the stream modification in the
 driver.

   Jaroslav

 -
 Jaroslav Kysela [EMAIL PROTECTED]
 Linux Kernel Sound Maintainer
 ALSA Project, SuSE Labs






---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


Re: [Alsa-devel] Pops at start of song

2003-11-20 Thread Martin Langer
 
  Ok, it's a thing that we would like to eliminate, but when I tried to
  figure what's going on in the past, I wasn't successful. The best
  thing to
  measure if ALSA sends a wrong sample sequence to the output is to use the
  digital I/O (S/PDIF or profi IEC958) for on playback side and capture the
  whole stream on the other side.
 
  It seems to me, that some audio hardware (in the analog path) does not
  have compensation for the big volume change at the start or stop of the
  PCM stream. In this case, the application must do this compensation itself
  to avoid the clicks. It's difficult to do the stream modification in the
  driver.

just an idea from rme32:

I know this start click from my Digi32. But this card has an register bit
called mute. Setting it, will switch to digital mute (=zeros) of the
output. The driver set this bit on each playback_prepare and playback_stop
and there's no click anymore:)

I don't have the docs about the hdsp hardware. Perhaps they have no longer
this register bit in the hdsp hardware, but the hdsp driver authors should
know much more about their register bits than I. 

...it's just an idea.

martin


---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


[Alsa-devel] Pops at start of song

2003-11-19 Thread Steve deRosier
All,

We're having a problem with some of our audio applications.  When a song 
starts playing we will often hear a loud pop out of the speakers before 
it plays audio.  It seems dependent upon where we stoped and the specfic 
content of the last song, if we hit our stop control and abort in the 
middle of the song it may pop uppon restarting or starting a new song.

One of our engrs found if he fills the entire buffer with zeros before 
quitting the program, on the next start it won't pop (though that moves 
the pop to the end of the previous due to a disconnect/jump in the 
created waveform).  Unless this is a hardware issue, this doesn't seem 
to be the right solution to me.  So:

* What are things that we can do in our program using the alsa pcm 
functions to eliminate this?  Maybe a specific function we need to call 
or a particular sequence?
* Or, is this something inherent in hardware and other than filling with 
zeros before we quit there's nothing we can do?

I figure some of you have encountered this before, so maybe there's some 
ideas out there?

If you're wondering what we do when a stop command comes in: pretty 
much nothing.  Basically my ALSASender routine ends and calls:
void CDSP::ClosePCM( void )
{
  // some other bookkeeping goes here snip

  snd_pcm_close( hPCM );

  if( mPCMStatus )
  {
 snd_pcm_status_free( mPCMStatus );
 mPCMStatus = NULL;
  }
  // Non-alsa related cleanup goes here snip
}
Also, note that we do get the same pops with using aplay.

Thanks,
- Steve
PS Takashi - I haven't given up on my serial driver patch, I was 
working on it when I got interupted with something else, it should be on 
its way soon; thanks for your help.



---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


RE: [Alsa-devel] Pops at start of song

2003-11-19 Thread Mark Knecht
Steve,
   You're the first person I can remember to report something very similar
to what I'm dealing with every day. I get a huge loud cracking noise at the
start of any audio operation that is not vanilla Alsa - i.e. - anything
accessing OSS I think. In my case I think it's hardware based, but I'm not
sure. This happens only on my HDSP 9652 system. I have two other systems,
one using an onboard NForce audio device, and the other using an RME
Hammerfall Light, that act correctly.

   With the RME products we have the hdspconf application which shows the
sync frequency of the card. I normally run at 44.1K, but if I open hdspconf
and watch the card's frequency, it tells me that the card becomes unlocked
and changes sample rates when the noise happens. This happens when starting
any app that uses OSS (I think) like gxine, or xmms, or most games, or
browsing web pages. It does not happen when starting a native Alsa
application like alsaplayer.

   Does this sound at all like what you're experiencing?

- Mark

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Steve
 deRosier
 Sent: Wednesday, November 19, 2003 2:15 PM
 To: [EMAIL PROTECTED]
 Subject: [Alsa-devel] Pops at start of song


 All,

 We're having a problem with some of our audio applications.  When a song
 starts playing we will often hear a loud pop out of the speakers before
 it plays audio.  It seems dependent upon where we stoped and the specfic
 content of the last song, if we hit our stop control and abort in the
 middle of the song it may pop uppon restarting or starting a new song.

 One of our engrs found if he fills the entire buffer with zeros before
 quitting the program, on the next start it won't pop (though that moves
 the pop to the end of the previous due to a disconnect/jump in the
 created waveform).  Unless this is a hardware issue, this doesn't seem
 to be the right solution to me.  So:

 * What are things that we can do in our program using the alsa pcm
 functions to eliminate this?  Maybe a specific function we need to call
 or a particular sequence?
 * Or, is this something inherent in hardware and other than filling with
 zeros before we quit there's nothing we can do?

 I figure some of you have encountered this before, so maybe there's some
 ideas out there?

 If you're wondering what we do when a stop command comes in: pretty
 much nothing.  Basically my ALSASender routine ends and calls:
 void CDSP::ClosePCM( void )
 {
// some other bookkeeping goes here snip

snd_pcm_close( hPCM );

if( mPCMStatus )
{
   snd_pcm_status_free( mPCMStatus );
   mPCMStatus = NULL;
}

// Non-alsa related cleanup goes here snip
 }

 Also, note that we do get the same pops with using aplay.

 Thanks,
 - Steve

 PS Takashi - I haven't given up on my serial driver patch, I was
 working on it when I got interupted with something else, it should be on
 its way soon; thanks for your help.



 ---
 This SF.net email is sponsored by: SF.net Giveback Program.
 Does SourceForge.net help you be more productive?  Does it
 help you create better code?  SHARE THE LOVE, and help us help
 YOU!  Click Here: http://sourceforge.net/donate/
 ___
 Alsa-devel mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/alsa-devel






---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


Re: [Alsa-devel] Pops at start of song

2003-11-19 Thread Steve deRosier
Mark,

I don't know if it's the same effect or not.  We're working on an 
embedded Linux device.  It has a full Linux kernel and basically is a 
hand-built distribution of stock Linux stuff, but is very stripped down 
and some of our apps are custom.  As we're not using OSS in any way 
(neither apps nor the Alsa OSS emulation layer) so I can't speak to that.

One of our engrs here seems to think it's a hardware issue also, and the 
only way to get our apps to deal with it is to on the stop command push 
values into the pcm buffer that ramp down to 0 and then fill a full 
buffer-size number of samples of 0 into the buffer before closeing it. 
I'm not sure I agree (if it HW based, then yes I agree) and was hoping 
there was an approprate alsa-way.  Our device is one of those mini-itx 
via based boards (frequently seen mentioned on /.).  It seems it uses 
VIA 82xx audio.

Your problem sounds more like a configuration or hardware issue, unlike 
ours which I'm guessing is either a hardware or actual (non-alsa) source 
code issue.  Sorry I can't be of more help, but hopefully someone here 
can help, and I'll let you know what we find if anything.

Thanks,
- Steve
Mark Knecht wrote:
Steve,
   You're the first person I can remember to report something very similar
to what I'm dealing with every day. I get a huge loud cracking noise at the
start of any audio operation that is not vanilla Alsa - i.e. - anything
accessing OSS I think. In my case I think it's hardware based, but I'm not
sure. This happens only on my HDSP 9652 system. I have two other systems,
one using an onboard NForce audio device, and the other using an RME
Hammerfall Light, that act correctly.
   With the RME products we have the hdspconf application which shows the
sync frequency of the card. I normally run at 44.1K, but if I open hdspconf
and watch the card's frequency, it tells me that the card becomes unlocked
and changes sample rates when the noise happens. This happens when starting
any app that uses OSS (I think) like gxine, or xmms, or most games, or
browsing web pages. It does not happen when starting a native Alsa
application like alsaplayer.
   Does this sound at all like what you're experiencing?

- Mark


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Steve
deRosier
Sent: Wednesday, November 19, 2003 2:15 PM
To: [EMAIL PROTECTED]
Subject: [Alsa-devel] Pops at start of song
All,

We're having a problem with some of our audio applications.  When a song
starts playing we will often hear a loud pop out of the speakers before
it plays audio.  It seems dependent upon where we stoped and the specfic
content of the last song, if we hit our stop control and abort in the
middle of the song it may pop uppon restarting or starting a new song.
One of our engrs found if he fills the entire buffer with zeros before
quitting the program, on the next start it won't pop (though that moves
the pop to the end of the previous due to a disconnect/jump in the
created waveform).  Unless this is a hardware issue, this doesn't seem
to be the right solution to me.  So:
* What are things that we can do in our program using the alsa pcm
functions to eliminate this?  Maybe a specific function we need to call
or a particular sequence?
* Or, is this something inherent in hardware and other than filling with
zeros before we quit there's nothing we can do?
I figure some of you have encountered this before, so maybe there's some
ideas out there?
If you're wondering what we do when a stop command comes in: pretty
much nothing.  Basically my ALSASender routine ends and calls:
void CDSP::ClosePCM( void )
{
  // some other bookkeeping goes here snip
  snd_pcm_close( hPCM );

  if( mPCMStatus )
  {
 snd_pcm_status_free( mPCMStatus );
 mPCMStatus = NULL;
  }
  // Non-alsa related cleanup goes here snip
}
Also, note that we do get the same pops with using aplay.

Thanks,
- Steve
PS Takashi - I haven't given up on my serial driver patch, I was
working on it when I got interupted with something else, it should be on
its way soon; thanks for your help.


---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel







---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


Re: [Alsa-devel] Pops at start of song

2003-11-19 Thread Apostolos Dimitromanolakis
Hi,

This is not a hardware issue. The problem is that the DAC of your card
gets stopped in some other level than 0V and when you restart playback
the voltage differential causes the pop (because the output of the
digital to analog converter is AC-coupled). To perform a clean stop and
start make sure that when you start the playback, the first few bytes
are zero and when you stop the last few. If they are not, do a gradual
change of the samples (say no more that +/- 500 difference over the
previous sample). I think the problem is more evident in high end
sound-cards which have a flat frequency response down to a few Hz.
Apostolos

Steve deRosier wrote:

All,

We're having a problem with some of our audio applications.  When a 
song starts playing we will often hear a loud pop out of the speakers 
before it plays audio.  It seems dependent upon where we stoped and 
the specfic content of the last song, if we hit our stop control and 
abort in the middle of the song it may pop uppon restarting or 
starting a new song.

One of our engrs found if he fills the entire buffer with zeros before 
quitting the program, on the next start it won't pop (though that 
moves the pop to the end of the previous due to a disconnect/jump in 
the created waveform).  Unless this is a hardware issue, this doesn't 
seem to be the right solution to me.  So:

* What are things that we can do in our program using the alsa pcm 
functions to eliminate this?  Maybe a specific function we need to 
call or a particular sequence?
* Or, is this something inherent in hardware and other than filling 
with zeros before we quit there's nothing we can do?

I figure some of you have encountered this before, so maybe there's 
some ideas out there?

If you're wondering what we do when a stop command comes in: pretty 
much nothing.  Basically my ALSASender routine ends and calls:
void CDSP::ClosePCM( void )
{
  // some other bookkeeping goes here snip

  snd_pcm_close( hPCM );

  if( mPCMStatus )
  {
 snd_pcm_status_free( mPCMStatus );
 mPCMStatus = NULL;
  }
  // Non-alsa related cleanup goes here snip
}
Also, note that we do get the same pops with using aplay.

Thanks,
- Steve
PS Takashi - I haven't given up on my serial driver patch, I was 
working on it when I got interupted with something else, it should be 
on its way soon; thanks for your help.



---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel





---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


Re: [Alsa-devel] Pops at start of song

2003-11-19 Thread Steve deRosier
Hm, sounds like the very definition of a hardware issue to me. ;) When I 
said hardware issue I wasn't refering to a bug in the hardware or 
hardware drivers... more of a that's how it works and we're stuck with 
it.  :)

One of our other engineers has taken that exact approach.  It just seems 
strange to have to manually ramp down the voltage on the hw by the 
application manually inserting data into the pcm to do so.  If this has 
to be done w/ some soundcards and not others, why is the application 
resposible for this and not the driver or the alsa-lib?  I just figured 
it was unique with the fact we pretty much didn't do anything other than 
a snd_pcm_close() after our last snd_pcm_writei() call and that there 
were some type of snd_pcm_cleanup_everything() call that we need to make.

Thanks,
- Steve
Apostolos Dimitromanolakis wrote:
Hi,

This is not a hardware issue. The problem is that the DAC of your card 
gets stopped in some other level than 0V and when you restart playback 
the voltage differential causes the pop (because the output of the 
digital to analog converter is AC-coupled). To perform a clean stop and 
start make sure that when you start the playback, the first few bytes 
are zero and when you stop the last few. If they are not, do a gradual  
change of the samples (say no more that +/- 500 difference over the 
previous sample). I think the problem is more evident in high end 
sound-cards which have a flat frequency response down to a few Hz.

Apostolos

Steve deRosier wrote:

All,

We're having a problem with some of our audio applications.  When a 
song starts playing we will often hear a loud pop out of the speakers 
before it plays audio.  It seems dependent upon where we stoped and 
the specfic content of the last song, if we hit our stop control and 
abort in the middle of the song it may pop uppon restarting or 
starting a new song.

One of our engrs found if he fills the entire buffer with zeros before 
quitting the program, on the next start it won't pop (though that 
moves the pop to the end of the previous due to a disconnect/jump in 
the created waveform).  Unless this is a hardware issue, this doesn't 
seem to be the right solution to me.  So:

* What are things that we can do in our program using the alsa pcm 
functions to eliminate this?  Maybe a specific function we need to 
call or a particular sequence?
* Or, is this something inherent in hardware and other than filling 
with zeros before we quit there's nothing we can do?

I figure some of you have encountered this before, so maybe there's 
some ideas out there?

If you're wondering what we do when a stop command comes in: pretty 
much nothing.  Basically my ALSASender routine ends and calls:
void CDSP::ClosePCM( void )
{
  // some other bookkeeping goes here snip

  snd_pcm_close( hPCM );

  if( mPCMStatus )
  {
 snd_pcm_status_free( mPCMStatus );
 mPCMStatus = NULL;
  }
  // Non-alsa related cleanup goes here snip
}
Also, note that we do get the same pops with using aplay.

Thanks,
- Steve
PS Takashi - I haven't given up on my serial driver patch, I was 
working on it when I got interupted with something else, it should be 
on its way soon; thanks for your help.



---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel






---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel