Opened 3 years ago

Closed 3 years ago

#93 closed defect (fixed)

Problems with protecting device detach and/or handing over streaming to another device

Reported by: Martin Iturbide Owned by: Lars Erdmann
Priority: minor Component: USBAUDIO
Version: 10.237 Keywords:
Cc: martiniturbide@…

Description (last modified by Martin Iturbide)

Problems with protecting device detach and/or handing over streaming to another device.

Lars. Please let me know how can I help and which tests should I execute for this ticket.

Attachments (38)

audSVN2222.zip (97.1 KB) - added by Lars Erdmann 3 years ago.
SVN rev 2222
audSVN2218_Timidity-BACH-MID_2.ftf (174.2 KB) - added by Martin Iturbide 3 years ago.
audSVN2222-PlugMicTEst.ftf (232.9 KB) - added by Martin Iturbide 3 years ago.
audSVN2222_HP_Cantina_Unplugged-3Sec.ftf (112.4 KB) - added by Martin Iturbide 3 years ago.
usbdrv237_HP_Cantina_Unplugged-3Sec.ftf (91.7 KB) - added by Martin Iturbide 3 years ago.
audSVN2230.zip (97.3 KB) - added by Lars Erdmann 3 years ago.
SVN rev 2230
killstream.exe (22.5 KB) - added by Lars Erdmann 3 years ago.
Tool for killing a stream by stream id
TEST-B- HP_Stop_sound_After_MusicFairy.ftf (169.8 KB) - added by Martin Iturbide 3 years ago.
TESt c USBMouse- Interrupt.ftf (141.1 KB) - added by Martin Iturbide 3 years ago.
AOSL420-20210131-generic.log (145.9 KB) - added by Martin Iturbide 3 years ago.
TEST-D_Unplugging HP Headset.ftf (100.1 KB) - added by Martin Iturbide 3 years ago.
TEST-D_Unplugging HP Headset - Multiple_plug_unplug_WPSPlay.zip (42.0 KB) - added by Martin Iturbide 3 years ago.
audSVN2233.zip (97.4 KB) - added by Lars Erdmann 3 years ago.
SVN rev 2233
audSVN2234.zip (97.5 KB) - added by Lars Erdmann 3 years ago.
SVN rev 2234
audSVN2233_TESTB_HPHeadset.ftf (248.1 KB) - added by Martin Iturbide 3 years ago.
audSVN2233_Killstream_Not working.zip (61.5 KB) - added by Martin Iturbide 3 years ago.
audSVN2233_Trace.zip (70.0 KB) - added by Martin Iturbide 3 years ago.
audSVN2233_Trace_Errors.zip (53.1 KB) - added by Martin Iturbide 3 years ago.
audSVN2236.zip (97.7 KB) - added by Lars Erdmann 3 years ago.
SVN rev 2236
audSVN2238.zip (97.7 KB) - added by Lars Erdmann 3 years ago.
SVN rev 2238
usbehcdSVN2238.zip (33.5 KB) - added by Lars Erdmann 3 years ago.
SVN rev 2238
audSVN2238_HPHeadset_laterMusicFairy.zip (22.5 KB) - added by Martin Iturbide 3 years ago.
WPSPlay_locked.png (5.2 KB) - added by Martin Iturbide 3 years ago.
Long_trace.zip (51.9 KB) - added by Martin Iturbide 3 years ago.
usbdrvSVN2247-Test.zip (59.5 KB) - added by Martin Iturbide 3 years ago.
usbdrvSVN2247-test3.ftf (217.2 KB) - added by Martin Iturbide 3 years ago.
HWManager_1.png (27.7 KB) - added by Martin Iturbide 3 years ago.
HWManager_2.png (28.3 KB) - added by Martin Iturbide 3 years ago.
usbdrvSVN2253_Trace_001.ftf (135.9 KB) - added by Martin Iturbide 3 years ago.
usbdrvSVN2253_Trace_02.zip (22.8 KB) - added by Martin Iturbide 3 years ago.
SVN2255_Trace.zip (21.4 KB) - added by Martin Iturbide 3 years ago.
usbdrvSVN2263.zip (428.6 KB) - added by Lars Erdmann 3 years ago.
SVN rev 2263
usbdrvSVN2263_test.ftf (342.0 KB) - added by Martin Iturbide 3 years ago.
Test2.ftf (471.7 KB) - added by Martin Iturbide 3 years ago.
usbdrvSVN2270.zip (427.7 KB) - added by Lars Erdmann 3 years ago.
SVN rev 2270
SVN2270-Trace001.ftf (213.7 KB) - added by Martin Iturbide 3 years ago.
SVN2270-Trace002.ftf (477.9 KB) - added by Martin Iturbide 3 years ago.
SVN2270-Test003.ftf (387.4 KB) - added by Martin Iturbide 3 years ago.

Change History (102)

comment:1 Changed 3 years ago by Martin Iturbide

Description: modified (diff)

comment:2 Changed 3 years ago by Martin Iturbide

Owner: set to Lars Erdmann
Status: newassigned

comment:3 Changed 3 years ago by Lars Erdmann

Cc: martiniturbide@… added

Changed 3 years ago by Lars Erdmann

Attachment: audSVN2222.zip added

SVN rev 2222

comment:4 Changed 3 years ago by Lars Erdmann

Please do this:
1) replace all files with SVN2222, reboot
2) start tracing (before device attach !)
3) attach a USB audio playback device (your headset, for example)
3) play a WAV file, take a slightly longer file, see next point
4) while playing, insert another USB audio device (your USB microphone, for example)
5) stop tracce

Let me know if sound stutters on playback (because of the mutex protection I added, I don't know the performance impact). Also let me know of any hangs that might occur when you add the second USB audio device. Also let me know if the sound continues to play undisturbed when you attach that second device.

Changed 3 years ago by Martin Iturbide

comment:5 Changed 3 years ago by Martin Iturbide

Oops. sorry I did MIDI test before reading your post.

I uploaded a trace with audSVN2218 running bach.mid with Alex Taylor's Timidity port (http://www.altsan.org/programming/ports/) and I installed also eawpats to have sounds (I was missing that). I run "TimidiPM", opened bach.mid and play it. Sound was working, I stopped it, exit timidiPM and took the trace.

I will do the testing you require with "SVN2222", sorry for shifting away with the MID.

Regards

Changed 3 years ago by Martin Iturbide

Attachment: audSVN2222-PlugMicTEst.ftf added

comment:6 Changed 3 years ago by Martin Iturbide

Hi. I just tried the test without any issue.

When I plugged the Mic nothing happened. There was no interruption.

Regards

comment:7 Changed 3 years ago by Martin Iturbide

Hi

I did a different test.

  • Without anything attached to the USB I played CantinaBand60.wav (WPSPlay) with Uniaud.
  • While it was playing I attached USB Mic. No interruption happened. (Good)
  • While it was playing I attached the USB HP Headset. No interruption happened it keep playing on Uniaud. (Not sure if its good, but maybe that is how it is supposed to work)

Different test.

  • I plugged HP Headset and run CantinaBand60.wav
  • Unplugged headset. WPSPlay gets stuck. No reproduction on Uniaud, and if reconnect HP Headset, the wav file is still stuck.

Do you want the trace for this?

Last edited 3 years ago by Martin Iturbide (previous) (diff)

comment:8 Changed 3 years ago by Lars Erdmann

about mixed use of UNIAUD and USBAUDIO: this test is of little use. You will have 1 device (driver) selected as the default. If you want to play via UNIAUD, then UNIAUD will be the default device. If you then plug in USB audio devices, they will be ignored to the extent that the multimedia subsystem will not use them (of course they are recognized by the USBAUDIO driver and they are ready for use). I think even if the ArcaOS feature to reselect the default audio device to USB on USB audio device insertion is enabled, the CURRENT stream will not switch over. Only on the starting of a new stream will the new default device be used.

about test case with HP Headset (only): did you unplug the HP Headset WHILE the WAV was still playing ? If yes, this is exactly the error that needs to be caught.

I'll need to add some additional tracing to the driver for this last test case in order to find out what is going wrong. I'll come back if I am done.

Last edited 3 years ago by Lars Erdmann (previous) (diff)

comment:9 Changed 3 years ago by Lars Erdmann

Martin, can you please repeat that last test case (playing an audio stream and removing the USB audio device while still playing) with the 10.237 driver (replace everything) and see if the same problem occurs ?
If possible, also trace this.

Last edited 3 years ago by Lars Erdmann (previous) (diff)

Changed 3 years ago by Martin Iturbide

Changed 3 years ago by Martin Iturbide

comment:10 Changed 3 years ago by Martin Iturbide

Hi

Here it is the test.

  • 1) Plug the HP Headset
  • 2) Enable Trace
  • 3) Play Cantina.wav
  • 4) Unplugged HP Headset at 3 seconds.
  • 5) Save the trace file

One trace with audSVN2222, the other with usbdrv237.

Regards

Last edited 3 years ago by Martin Iturbide (previous) (diff)

comment:11 Changed 3 years ago by Lars Erdmann

Did both cause the problem that you mentioned ? Or only one ? which one ?

Changed 3 years ago by Lars Erdmann

Attachment: audSVN2230.zip added

SVN rev 2230

comment:12 Changed 3 years ago by Lars Erdmann

replace all files

1) please start trace FIRST
2) THEN attach the USB headset
3) play the WAV
4) while the WAV is still playing, unplug the USB headset
5) PLEASE let me know if you still have the problem that a new restart of the WAV will hang and never terminate (for example by attempting to play it via UNIAUD instead)

Please note for 5) that it is irrelevant if you play with UNIAUD or with a USB device. If the system gets confused and thinks the stream is still not properly terminated, it will attempt to create a new one but that obviously leads to the effect that then that new stream will terminate too early.

I will now also write a quick hack tool so that you will be able to terminate a stream with this tool. If that then fixes the hang, that proves that there is a problem with stream creation and termination. That is not really a bug in the driver. But it could mean that I will need to modify the driver that if a device is detached while a sound is still playing that then, a stream termination call will need to be issued which also means that it is impossible for another device to take over and continue playing the stream. The driver cannot do that termination call but the VSD (USBAUDIF.DLL) could. I already have a plan.

Last edited 3 years ago by Lars Erdmann (previous) (diff)

Changed 3 years ago by Lars Erdmann

Attachment: killstream.exe added

Tool for killing a stream by stream id

comment:13 Changed 3 years ago by Lars Erdmann

Find tool attached. You pass it the stream ID. This will be trial and error but the system will start numbering the active streams starting with 1 and up. Therefore, if you play a WAV and then attempt to play a second WAV, you can specify 1 to kill the first stream and 2 to kill the second.

comment:14 Changed 3 years ago by Martin Iturbide

Hi Lars.

I want to evaluate the issue again to be sure I'm understanding it for the tests.

I installed audSVN2230.zip.

1) While running a Audio with an USB audio (output) device, if you plug another USB audio device, it should not break the playback.

Test a) I tested the HP Headset, played a 1Min wav (Cantina), plugged the C-Media USB Mic (Audio Input Only), it did not interrupt the playback. That is good. No issue.

Test b) ISSUE: If I'm playing a 1Min wav (Cantina) on the HP Headset and plugged another USB Audio Input/Output? device (At 4 sec of playing), like the Music Fairy, it will break the audio connection. The WPSPlay will show the minutes going on (CWMM), but the sound stopped. (TEST B trace attached)

Test C) ISSUE: If I'm playing a 1Min wav (Cantina) on the HP Headset and I unplug and plug back the USB Mouse, sound will stop, but the WPSPLay will continue reproducing (increasing the numbers).

Let me know if those are the issues that we are looking for and any more tests I should try.

Regards

Last edited 3 years ago by Martin Iturbide (previous) (diff)

Changed 3 years ago by Martin Iturbide

Changed 3 years ago by Martin Iturbide

Changed 3 years ago by Martin Iturbide

comment:15 in reply to:  12 Changed 3 years ago by Martin Iturbide

Replying to Lars Erdmann:

replace all files

1) please start trace FIRST
2) THEN attach the USB headset
3) play the WAV
4) while the WAV is still playing, unplug the USB headset
5) PLEASE let me know if you still have the problem that a new restart of the WAV will hang and never terminate (for example by attempting to play it via UNIAUD instead)

I'm calling this one "TEST D" for the Trace.

When I unplug the HP Headset, while playing the file with WPSPlay, the WPS Audio file pauses the second (counter on the bottom of the file CWMM). If I close and reopen the window, the counter on the bottom of the file will disappear. If I replug the HP Headset and double click the file it will start playback again with sound.

I guess there is no issue here, but some visualization issues with CWMM.

I repeat the test with a trace (2) plugging and unplugging the HP Headset and playing again the file, unplugging, replugging, several times.

Regards

Changed 3 years ago by Martin Iturbide

comment:16 Changed 3 years ago by Lars Erdmann

Martin, would you please start the tracing BEFORE you plug in the first device ? I can only see one device attach in the trace and then I don't know for which device.

As to TEST C: that cannot be an audio device driver issue. When you plug in the USB mouse, this device will also be offered to USBAUDIO for service because the USB stack initially does not know what type of device has been plugged in. It just asks all class/client drivers.
But USBAUDIO successfully rejects that device and that is ALL that it does. It must be an issue with the rest of the USB stack. If possible, try my complete USB stack. You can always revert to the ArcaOS stack later on (my stack is limited to USB 2.x though).

As to TEST D: what you could check with "killstream" is, if you can successfully kill stream Number 1 AFTER you have restarted to play the sound file again. If that is successful and if the stream still continues to play (you can still hear sound), then we know there is a problem with the system managing streams because that would mean that the system has started a new stream Number 2 (for playing the sound file again) but without properly terminating stream Number 1.

Last edited 3 years ago by Lars Erdmann (previous) (diff)

Changed 3 years ago by Lars Erdmann

Attachment: audSVN2233.zip added

SVN rev 2233

comment:17 Changed 3 years ago by Lars Erdmann

Please redo Test B

1) start trace FIRST
2) attach HP Gaming Headset H320GS (0D8C:0012)
3) start running the WAV file
4) plug in Music Fairy USB 2.0 (0D8C:000C)
5) try stopping the stream by again doubleclicking on the WPS icon, tell me if that will stop the time counter
6) stop trace, save trace formatted trace file, attach to this ticket

What would also be interesting: if after step 4), the WAV file continues to play, even if you don't hear anything, please use "killstream 1" and see if that will stop it (stop the time counter)

Changed 3 years ago by Lars Erdmann

Attachment: audSVN2234.zip added

SVN rev 2234

comment:18 Changed 3 years ago by Lars Erdmann

I improved the info traced, use SVN2234 instead of SVN2233

comment:19 in reply to:  17 ; Changed 3 years ago by Martin Iturbide

Replying to Lars Erdmann:

Please redo Test B

1) start trace FIRST
2) attach HP Gaming Headset H320GS (0D8C:0012)
3) start running the WAV file
4) plug in Music Fairy USB 2.0 (0D8C:000C)
5) try stopping the stream by again doubleclicking on the WPS icon, tell me if that will stop the time counter
6) stop trace, save trace formatted trace file, attach to this ticket

I followed this instructions for trace. Here it is the trace, there was no issues, the sound did no get interrupted when I plugged the Music Fairy.

Last edited 3 years ago by Martin Iturbide (previous) (diff)

Changed 3 years ago by Martin Iturbide

comment:20 in reply to:  17 Changed 3 years ago by Martin Iturbide

Replying to Lars Erdmann:

What would also be interesting: if after step 4), the WAV file continues to play, even if you don't hear anything, please use "killstream 1" and see if that will stop it (stop the time counter)

I tried to but I get this message with Killstream

[X:\DESKTOP\ATest]killstream 1
Invalid stream handle specified.

It did not stopped the sound after the execution.

Last edited 3 years ago by Martin Iturbide (previous) (diff)

Changed 3 years ago by Martin Iturbide

comment:21 in reply to:  19 ; Changed 3 years ago by Lars Erdmann

Replying to Martin Iturbide:

Replying to Lars Erdmann:

Please redo Test B

1) start trace FIRST
2) attach HP Gaming Headset H320GS (0D8C:0012)
3) start running the WAV file
4) plug in Music Fairy USB 2.0 (0D8C:000C)
5) try stopping the stream by again doubleclicking on the WPS icon, tell me if that will stop the time counter
6) stop trace, save trace formatted trace file, attach to this ticket

I followed this instructions for trace. Here it is the trace, there was no issues, the sound did no get interrupted when I plugged the Music Fairy.

This is really surprising. The only thing I changed between SVN2230 and SVN2234 is to add additional tracing and to move a global control variable update inside an access serialized block of code. The latter must have brought the fix (changing the tracing has no effect on the operation apart from some very minor runtime delay).

Anyway: here is a test that checks what happens on device removal. You need two USB audio devices that can do playback and that can actually play sound via either headphone or speaker:
1) start trace FIRST
2) attach HP Gaming Headset H320GS (0D8C:0012)
3) start running the WAV file, you should be able to hear the sound on the headset
4) plug in Music Fairy USB 2.0 (0D8C:000C)
5) with the WAV still playing, DETACH the HP Gaming Headset H320GS (0D8C:0012)
6) check if you can now hear the sound on the Music Fairy USB 2.0 (0D8C:000C), let me know
7) stop trace, save trace formatted trace file, attach to this ticket

Of course, you will need to attach some speaker to the Music Fairy in order to hear anything.
What this is supposed to test is, if the handover from the Headset to the Music Fairy works.
And if not, if at least the system remains stable. AFTER stopping the trace and if the handover does not work, you can retry to play something and also tell me if THAT works at least.

Changed 3 years ago by Martin Iturbide

Attachment: audSVN2233_Trace.zip added

comment:22 Changed 3 years ago by Martin Iturbide

Hi

I did the test that you told me, but even that I got it working, sometimes I didn't get a consistent test. The working tests where first the HP headset, later connecting Muscir Fairey, disconnect HP headset and the sound went to the Music Fairy.

There is one trace that strangely went to Uniaud instead of Music Fairy.

But I have a different issue. I played cantina on the HP headset, plug MusicFairy?, Unplugged HP Headset, hear sound on Music Fairy, ...while playing cantina I was tooking the trace and the music starting to chop, and later stopped. After that it blocked the WPSPLay for that cantina file. Im going to try with VLC just to rule out some issue of WPSPlay and CWMM.

Regards

Last edited 3 years ago by Martin Iturbide (previous) (diff)

comment:23 Changed 3 years ago by Martin Iturbide

I Rebooted and Took some more traces- This computer has three USB ports. I was using one at the right and one at the left. Now I used only the two on the right side.

My results were issues. 1) HP Headset was reproducing fine, plugged Music Fairy and the sound stopped, but the wav file counter keeps moving. I tried it with first HP Headset, first MusicFairy? with VLC and later one with WPSPlay.

Also, once I unplugged both USB audio devices, the WPS play keep locking the file. (no trace of that).

Regards

Changed 3 years ago by Martin Iturbide

Attachment: audSVN2233_Trace_Errors.zip added

comment:24 Changed 3 years ago by Lars Erdmann

As to switching to UNIAUD, the reason is this: for some reason, the first device detached when you added the second device, I assume that maybe the USB plug is not seated firmly.
You would be able to detect that by looking at the HW manager that lists the USB devices currently attached.
Because under ArcaOS, you have that "auto handover to UNIAUD if a USB audio device is detached, auto handover to USB if a USB audio device is attached" activated, that in turn will lead to UNIAUD becoming the default sound device (because ONE USB audio device was detached, even though you had inserted a second one).
If you turn off that auto feature, this should no longer happen.

comment:25 Changed 3 years ago by Lars Erdmann

By the way: if the file counter keeps moving but you no longer hear sound, can you stop the stream by doubleclicking on the WPS again ? That should stop the stream and therefore also the counter.

comment:26 Changed 3 years ago by Lars Erdmann

I am coming to the conclusion that a stable handover between USB devices is not possible. I'll now go for a solution where a stream is terminated if the USB audio device that is playing it is removed. That is better than experiencing this odd WPS behaviour with the file counter continuing to count but no more sound to be heard.

comment:27 in reply to:  26 Changed 3 years ago by Martin Iturbide

Replying to Lars Erdmann:

I am coming to the conclusion that a stable handover between USB devices is not possible. I'll now go for a solution where a stream is terminated if the USB audio device that is playing it is removed. That is better than experiencing this odd WPS behaviour with the file counter continuing to count but no more sound to be heard.

You are right, maybe that is the best way.

Changed 3 years ago by Lars Erdmann

Attachment: audSVN2236.zip added

SVN rev 2236

comment:28 Changed 3 years ago by Lars Erdmann

Martin, please try SVN rev2236. I have found a long existing bug in the drivers. Maybe with this fix, the handover will work.

Changed 3 years ago by Lars Erdmann

Attachment: audSVN2238.zip added

SVN rev 2238

Changed 3 years ago by Lars Erdmann

Attachment: usbehcdSVN2238.zip added

SVN rev 2238

comment:29 Changed 3 years ago by Lars Erdmann

Hallo Martin,
try audSVN2238, you can now attach a USB audio "record only" and WEPM.EXE will be able to operate it. Follow the steps above to take the trace.

Also important: back up USBEHCD.SYS and USBEHCD.SYM (if you are using my drivers) and try the attached usbehcdSVN2238.zip. It hopefully fixes a trap (which I was experiencing at least) on streaming data.

comment:30 in reply to:  21 Changed 3 years ago by Martin Iturbide

Replying to Lars Erdmann:

1) start trace FIRST
2) attach HP Gaming Headset H320GS (0D8C:0012)
3) start running the WAV file, you should be able to hear the sound on the headset
4) plug in Music Fairy USB 2.0 (0D8C:000C)
5) with the WAV still playing, DETACH the HP Gaming Headset H320GS (0D8C:0012)
6) check if you can now hear the sound on the Music Fairy USB 2.0 (0D8C:000C), let me know
7) stop trace, save trace formatted trace file, attach to this ticket

Hi I tried this test again with audSVN2238 (not yet with usbehcdSVN2238.zip​, I'm still using AN USB).

1) start trace FIRST
2) attach HP Gaming Headset H320GS (0D8C:0012)
3) start running the WAV file, you should be able to hear the sound on the headset

Here, when I plugged the Music Fairy, the wav stopped sound on HP Gaming set and it did not sound anywhere else. The WPSPlay keep moving the counter while providing no sound. (trace off)

I unplugged the USB devices and I can not unlock the wav file in WPSPlay. THe stop function does not work to unlock the file.

Regards

Last edited 3 years ago by Martin Iturbide (previous) (diff)

Changed 3 years ago by Martin Iturbide

Changed 3 years ago by Martin Iturbide

Attachment: WPSPlay_locked.png added

comment:31 Changed 3 years ago by Lars Erdmann

Can you please try my complete driver set ? Either by replacing the ArcaOS stack or, if you have such, on a separate partition.

You should be able to revert back to the ArcaOS stack. But check if you necessarily need USB 3.0 (if you only have 3.0 only HC controllers) in which case you cannot use my driver stack.

comment:32 Changed 3 years ago by Lars Erdmann

Where can I send you the full driver set ? I cannot send it to your gmail account, I cannot attach anything to a private message on OS2WORLD.

comment:33 Changed 3 years ago by Martin Iturbide

Hi Lars. I will install your full driver set. This machine does not has USB 3.0 anyways. We can transfer files with https://www.plustransfer.com/. After uploading the file, add my email and some message.

Regards

comment:34 Changed 3 years ago by Lars Erdmann

Ok, I sent via plustransfer, please check

comment:35 Changed 3 years ago by Lars Erdmann

I now sent the final version (if it works). I have changed the USB audio drivers to immediately stop the stream and discard any pending stream buffers if a USB device is removed while recording or playback. That should prevent hangs with the stream continuing with no device inserted.
But it will no longer pass over to another USB device (if any). I think that also does not make sense from a users point of view (who would have >= 2 USB audio devices installed and expect the sound to continue when the one playing is removed ?

Last edited 3 years ago by Lars Erdmann (previous) (diff)

Changed 3 years ago by Martin Iturbide

Attachment: Long_trace.zip added

comment:36 Changed 3 years ago by Martin Iturbide

Hi

I switched to you USB build, but only the things for the "/os2" folder. For USBAudio I'm still using audSVN2238. No issues.

  • Pluged HP headset, play cantina.wav (WPSPlay). Ok
  • Plugged Music Faire. No problem, no audio break. ok
  • Unplugged HP headset, the audio on WPSPlay stopped. ok

I tried that a second time.

  • Pluged HP headset, play cantina.wav (WPSPlay). Ok
  • Plugged Music Faire. No problem, no audio break. ok
  • Unplugged HP headset, the audio on WPSPlay keep going (counter) with no sound.

I stopped the file, and the file got locked.

Later I plugged Music Fairy, other wav files was working fine with WPSPlay, but cantina was locked.

That is what is on the trace.

Regards

comment:37 Changed 3 years ago by Lars Erdmann

Sorry, but try the latest I just uploaded to plustransfer. That should prevent all these stream hangs but handover will no longer work.

Changed 3 years ago by Martin Iturbide

Attachment: usbdrvSVN2247-Test.zip added

comment:38 Changed 3 years ago by Martin Iturbide

Hi

I installed USBdrvsvn2247. USB and USBAudio from it.

  • Pluged HP headset, play cantina.wav (WPSPlay). Ok
  • Plugged Music Faire. No problem, no audio break. ok
  • Unplugged HP headset, the audio on WPSPlay stopped. ok

WPSPlay was free and I was able to plug again the HP headset and play the same over and over again without issue (Test2).

But if I unplugged HP headset, the cantina wav stopped, I plugged Music Fairy, I was not able to reproduce any sound on the music fairy. Later I also tried on UniAud? and no audio was able to be reproduced.

I even got a error like:

[X:\DESKTOP\ATEST]play FILE=pinkpanther60.wav
MciCmd= OPEN PINKPANTHER60.WAV ALIAS REXXALIAS WAIT
Err:mciRxSendString RC= 5074 63672
mciRxGetErrorString(5074) = File Attribute error specified.

It seems that after some tests, the system audio got locked, until the next reboot.

Regards

Last edited 3 years ago by Martin Iturbide (previous) (diff)

Changed 3 years ago by Martin Iturbide

Attachment: usbdrvSVN2247-test3.ftf added

comment:39 Changed 3 years ago by Martin Iturbide

On test 3, I only tried it with the Music Fairy after a reboot. I keep plugging, and un pluggin the Music Fairy and doing playback of a wav file, until Music Fairy got ingnored and even if it is plugged the sound was only playing with UniAud?.

Regards

comment:40 Changed 3 years ago by Lars Erdmann

In the meantime, I continued work and found an issue with OHCI in conjunction with the USB audio drivers (and handling of isochronous (that is:streaming) devices) that has been there from day one.

Can you tell me to what Host controller your audio devices connect to ?
You can find out by opening the Hardware Manager and then, plugging in the USB device. If you use the AN stack, the device will show up under one of the host controller drivers (EHCI, UHCI or OHCI). If you use my stack, the device will show up under the proper hub with the hub indicating "attached to EHCI_xxx" or "attached to OHCI_xxx" or "attached to UHCI_xxx".

I can tell you that with OHCI, I ran into the same issue as you (at some point, you can no longer do playback / record with the USB audio device) and I believe to have fixed that in the meantime.

As to playing via the USB devices or UNIAUD: please be aware that if you do a regular audio driver install, the settings for the default device get lost. You will need to reopen the Multimedia Object and reset the default device by doubleclicking the entry or doing a select+enter on the entry.

Changed 3 years ago by Martin Iturbide

Attachment: HWManager_1.png added

Changed 3 years ago by Martin Iturbide

Attachment: HWManager_2.png added

comment:41 in reply to:  40 Changed 3 years ago by Martin Iturbide

Replying to Lars Erdmann:

Can you tell me to what Host controller your audio devices connect to ?
You can find out by opening the Hardware Manager and then, plugging in the USB device. If you use the AN stack, the device will show up under one of the host controller drivers (EHCI, UHCI or OHCI). If you use my stack, the device will show up under the proper hub with the hub indicating "attached to EHCI_xxx" or "attached to OHCI_xxx" or "attached to UHCI_xxx".

I do not have too much experience with HWManager, let me know if the screenshots I uploaded tell you something. I can see EHCI USB, but I don't know which one is the one that has the HP Headset connected.

I'm using your latest SVN stack.

Replying to Lars Erdmann:

As to playing via the USB devices or UNIAUD: please be aware that if you do a regular audio driver install, the settings for the default device get lost. You will need to reopen the Multimedia Object and reset the default device by doubleclicking the entry or doing a select+enter on the entry.

You are possible right, I haven't tested to see what happened to the "Multimedia Object".

Regards

comment:42 Changed 3 years ago by Lars Erdmann

Unfortunately, the screen shots are of no use:

1) best is to get my Hardware Manager extension (it does a better job of naming USB devices):
https://hobbes.nmsu.edu/download/pub/os2/util/wps/hwman16.wpi
2) open Hardware Manager in TREEVIEW (important !)
3) plug in a USB device
4) observe where in the tree the device pops up, it should pop up under one of the Hub_ or RootHub_ objects
5) read what HC the hub is connected to ("attached to ....")

comment:43 Changed 3 years ago by Lars Erdmann

Looks like you only have EHCI. I'll take that for granted. Nonetheless, I have also done changes to EHCI and UHCI (and not only OHCI). I'll create a new zip and upload that to plustransfer.

comment:44 Changed 3 years ago by Lars Erdmann

Uploaded SVN2252 to plustransfer. Please install EVERYTHING, including audio drivers and retest. Do not forget to reactivate USB audio as default device in Multimedia Object.

comment:45 Changed 3 years ago by Lars Erdmann

Uploaded SVN2253 to plustransfer. Please use that. What you need to check:
1) play a WAV
2) interrupt that playing by selecting a different WAV
3) when that second WAV finishes, check if the first WAV will resume playing

As always, please take trace

Changed 3 years ago by Martin Iturbide

Attachment: usbdrvSVN2253_Trace_001.ftf added

Changed 3 years ago by Martin Iturbide

Attachment: usbdrvSVN2253_Trace_02.zip added

comment:46 in reply to:  45 Changed 3 years ago by Martin Iturbide

Replying to Lars Erdmann:

Uploaded SVN2253 to plustransfer. Please use that. What you need to check:
1) play a WAV
2) interrupt that playing by selecting a different WAV
3) when that second WAV finishes, check if the first WAV will resume playing

As always, please take trace

Hi, did that testing with SVN2253.

Trace 1. When I played the long wav, while playing the second short, it stopped all sound. Both files looked marked on the WPS.

Trace 2. I played the long file cantina.wav, played the short file, it stopped all sound. I double click the short file again to stop it and cantina.wav keeps playing.

Regards

comment:47 Changed 3 years ago by Lars Erdmann

Please try SVN2255, send via plustransfer. Redo test, take trace.

comment:48 Changed 3 years ago by Lars Erdmann

Please try SVN 2259, send via plustransfer. Redo test, take trace.

comment:49 Changed 3 years ago by Martin Iturbide

Hi

Sorry for the late reply. I had to reinstall the ArcaOS this machine. Can you please send me again the "SVN 2259". I can not find the email with that link.

Regards

Changed 3 years ago by Martin Iturbide

Attachment: SVN2255_Trace.zip added

comment:50 in reply to:  45 Changed 3 years ago by Martin Iturbide

Replying to Lars Erdmann:

1) play a WAV

2) interrupt that playing by selecting a different WAV
3) when that second WAV finishes, check if the first WAV will resume playing

Hi

I tried this with "SVN2255". It did not work. I played cantinawav, it was producing sound. Once I played Applause it stopped all sound. Later I double click on "beeoong.wav" also no sound. Stopped trace there.

Please send me again the link of the latest SVN version to try it out.

Regards

comment:51 Changed 3 years ago by Lars Erdmann

I found another error, so I sent SVN2260 via plustransfer. Use that. Take trace.

comment:52 Changed 3 years ago by Martin Iturbide

Hi Lars. I'm not longer receiving emails from Plustransfer. It seems to be a issue with the service, since I send something to myself and I haven't received the e-mail yet.

I'm also chatting with Adrian to see if he can increase the size of the attachments.

Regards

comment:53 Changed 3 years ago by Martin Iturbide

Hi Lars. The upload size had been increased to 1MB on Trac. Can you try to upload the test SVN here ?

Regards

Changed 3 years ago by Lars Erdmann

Attachment: usbdrvSVN2263.zip added

SVN rev 2263

comment:54 Changed 3 years ago by Lars Erdmann

Try SVN2263, ignore all older stuff. Take trace.
In particular, test what has been already listed before:
1) play a length WAV
2) interrupt that WAV by playing another WAV (which can be short)
3) check if playing of first WAV properly resumes

comment:55 in reply to:  54 Changed 3 years ago by Martin Iturbide

Replying to Lars Erdmann:

Try SVN2263, ignore all older stuff. Take trace.
In particular, test what has been already listed before:
1) play a length WAV
2) interrupt that WAV by playing another WAV (which can be short)
3) check if playing of first WAV properly resumes

Hi

I tried it and worked as expected. I run cantina.wav, played applause, and it returned to cantina after completion. I also run beeoong.wav and it also returned fine to cantina.

Regards

Changed 3 years ago by Martin Iturbide

Attachment: usbdrvSVN2263_test.ftf added

comment:56 Changed 3 years ago by Lars Erdmann

Ok, that sounds promising. Now, do this:
1) play a lengthy WAV
2) detach the USB device while the WAV is still playing
3) check that after reinsertion of the USB device, you will be able to use it again. It might be necessary to stop whatever WAV you had been playing, but a restart of any WAV should work after device reinsertion.

Of course, the system should also not crash if you detach the device during play. If it does, attach the trap screen here (if you have one).

Changed 3 years ago by Martin Iturbide

Attachment: Test2.ftf added

comment:57 in reply to:  56 Changed 3 years ago by Martin Iturbide

Replying to Lars Erdmann:

Ok, that sounds promising. Now, do this:
1) play a lengthy WAV
2) detach the USB device while the WAV is still playing
3) check that after reinsertion of the USB device, you will be able to use it again. It might be necessary to stop whatever WAV you had been playing, but a restart of any WAV should work after device reinsertion.

Of course, the system should also not crash if you detach the device during play. If it does, attach the trap screen here (if you have one).

Hi

I did the test and it worked as expected. No Traps. I played a long file, disconnected the device, reconnected and I was able to play again the files without any issue. There was not WPSPlay lock of the files.

Regards

comment:58 Changed 3 years ago by Lars Erdmann

Do you want to test something additionally ?

If not, I'd suggest to close this bug with resolution:
modified driver to immediately abort all streams streaming on active USB device when that USB device is detached.

comment:59 Changed 3 years ago by Martin Iturbide

HI Lars.

I think we are done with this ticket. I will close it.

Thanks for you help.

comment:60 Changed 3 years ago by Martin Iturbide

Resolution: fixed
Status: assignedclosed

Changed 3 years ago by Lars Erdmann

Attachment: usbdrvSVN2270.zip added

SVN rev 2270

comment:61 Changed 3 years ago by Martin Iturbide

Resolution: fixed
Status: closedreopened

comment:62 Changed 3 years ago by Martin Iturbide

Hi Lars

Sorry for the late reply, I had been having some health issues these days.

I did a test with SVN rev 2270

Trace001

1) play a lengthy WAV

2) detach the USB device while the WAV is still playing

3) WAV will stop, after reinsertion, I can play the same Wav again.

trace002

1) play a lengthy WAV

2) play a short WAV

3) After the short wav, it returns playing the long wav.

It seems to be working fine with the test HP Headset.

Regards

Last edited 3 years ago by Martin Iturbide (previous) (diff)

Changed 3 years ago by Martin Iturbide

Attachment: SVN2270-Trace001.ftf added

Changed 3 years ago by Martin Iturbide

Attachment: SVN2270-Trace002.ftf added

comment:63 Changed 3 years ago by Martin Iturbide

Hi

I was not completely sure I was using the latest usbaudio, so I reinstalled it with mminstall and try this test again

Test03

1) play a lengthy WAV

2) detach the USB device while the WAV is still playing

3) WAV will stop, after reinsertion, I can play the same Wav again.

It seemed to work.

Regards

Changed 3 years ago by Martin Iturbide

Attachment: SVN2270-Test003.ftf added

comment:64 Changed 3 years ago by Lars Erdmann

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.